Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design Doc - Xiaoyue Ma; Alex Fu; Jiefu Ling #19

Open
wants to merge 100 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
f45740c
Create .gitignore
Jeff-Ling Nov 13, 2023
c0789dd
update .gitignore
Jeff-Ling Nov 13, 2023
799785d
Project Created
Jeff-Ling Nov 13, 2023
72efbde
Add some basic scripts
IwakuraRein Nov 14, 2023
bee9bea
Update WFCManager
IwakuraRein Nov 14, 2023
a9fa548
Planet & tiles created, camera interaction
CaballoMa Nov 15, 2023
75c80b2
Update README.md
Jeff-Ling Nov 15, 2023
5158e10
milestone1-xiaoyue-result
CaballoMa Nov 16, 2023
d7e82af
Update
IwakuraRein Nov 16, 2023
21acd87
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
IwakuraRein Nov 16, 2023
b5d437a
Update definition of WFCRule
IwakuraRein Nov 16, 2023
b5c00b7
Update README.md
Jeff-Ling Nov 16, 2023
b47622f
Jiefu Ling Milestone 1 completed
Jeff-Ling Nov 16, 2023
ae0771a
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
Jeff-Ling Nov 16, 2023
bd134e7
Update README.md
IwakuraRein Nov 16, 2023
9f59018
Atmosphere + Cloud Shader Completed
Jeff-Ling Nov 22, 2023
3a23700
Update README.md
Jeff-Ling Nov 22, 2023
83e8f0b
Generate Cell on the Tile
CaballoMa Nov 25, 2023
b2f869b
Cell, Item
IwakuraRein Nov 27, 2023
78eff2a
WFC Rule
IwakuraRein Nov 27, 2023
0282e28
Generate cell in hexagon's local space
IwakuraRein Nov 28, 2023
d6cecc4
Update IWFCItem.cs
IwakuraRein Nov 28, 2023
7d555c0
Milestone 2
IwakuraRein Nov 28, 2023
8a98e19
milestone2-readme-xym
CaballoMa Nov 28, 2023
5918168
Remove Rim Light Based Atmosphere Effect
Jeff-Ling Nov 30, 2023
ce09e60
star sky box
Jeff-Ling Nov 30, 2023
9c7dffb
Import the asset and made some tile template
Jeff-Ling Dec 3, 2023
49c4c8d
alter Cell generation
IwakuraRein Dec 5, 2023
e33983a
alter cell generation
IwakuraRein Dec 5, 2023
6eafb2c
Tile Template
Jeff-Ling Dec 5, 2023
663a84f
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
Jeff-Ling Dec 5, 2023
355d527
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
IwakuraRein Dec 5, 2023
09c135e
Hardcoded hexagon
IwakuraRein Dec 5, 2023
9d7e4d0
Update IWFCItem.cs
IwakuraRein Dec 5, 2023
2a9aa0e
Update Planet.unity
IwakuraRein Dec 5, 2023
4eb33ab
Prefab Updated
Jeff-Ling Dec 5, 2023
f864193
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
Jeff-Ling Dec 5, 2023
4adf4bb
Update
IwakuraRein Dec 5, 2023
77b6d41
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
IwakuraRein Dec 5, 2023
b34f368
Update More Tile Template
Jeff-Ling Dec 5, 2023
9f7e38d
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
Jeff-Ling Dec 5, 2023
62da41d
Fix Hexagon
CaballoMa Dec 5, 2023
455df88
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
CaballoMa Dec 5, 2023
f8f32ca
Hardcode Pentagon (80%)
IwakuraRein Dec 5, 2023
8958eb4
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
IwakuraRein Dec 5, 2023
4c52697
Test cell placement
IwakuraRein Dec 5, 2023
2291784
Update SphereCreation and Tile
IwakuraRein Dec 5, 2023
9b53e47
Fix Hexagon
CaballoMa Dec 5, 2023
3bd54cb
Update
IwakuraRein Dec 5, 2023
0b61732
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
IwakuraRein Dec 5, 2023
09087c0
Update
IwakuraRein Dec 5, 2023
1a35598
Update
IwakuraRein Dec 5, 2023
928249a
UI & Camera movement
CaballoMa Dec 5, 2023
dbfc3a8
Hardcoded pentagon
IwakuraRein Dec 5, 2023
d9e6b1e
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
IwakuraRein Dec 5, 2023
ea799fd
Update SphereCreation.cs
CaballoMa Dec 5, 2023
104219b
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
CaballoMa Dec 5, 2023
587b37f
Update
IwakuraRein Dec 5, 2023
8ae7ef8
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
IwakuraRein Dec 5, 2023
88ac726
Update HexagonTile.cs
IwakuraRein Dec 5, 2023
0a3aa0a
Pentagon Tile
Jeff-Ling Dec 6, 2023
aab8b09
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
Jeff-Ling Dec 6, 2023
c9ef6bd
Fix bug in cell placement
IwakuraRein Dec 6, 2023
88ad367
Fix bug in cell placement
IwakuraRein Dec 6, 2023
c4f3fa6
Update scene
IwakuraRein Dec 6, 2023
7945c92
Hexagon Candidate
IwakuraRein Dec 6, 2023
3faa778
selector
CaballoMa Dec 6, 2023
3777585
Update Planet.unity
CaballoMa Dec 6, 2023
47201a6
Update Planet.unity
IwakuraRein Dec 6, 2023
0ec3f63
selector fix
CaballoMa Dec 6, 2023
60ac210
fix selector for hex only
CaballoMa Dec 6, 2023
9086b0e
Update cell
Jeff-Ling Dec 6, 2023
2ca2f41
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
Jeff-Ling Dec 6, 2023
a6ca659
Close selector change material
CaballoMa Dec 6, 2023
71603ca
fix selector bug
CaballoMa Dec 6, 2023
373749a
Update Cell
Jeff-Ling Dec 6, 2023
9fe3d51
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
Jeff-Ling Dec 6, 2023
edcef96
Prehex
CaballoMa Dec 6, 2023
a728194
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
CaballoMa Dec 6, 2023
aaba5cd
Update
IwakuraRein Dec 6, 2023
11d2599
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
IwakuraRein Dec 6, 2023
d37dca5
Only use house and tree in pentagon
IwakuraRein Dec 6, 2023
f54dfb1
modify pentagon cells
IwakuraRein Dec 6, 2023
c3ae045
Update HardecodedHexagonTilePre.prefab
CaballoMa Dec 6, 2023
f528941
Update Planet.unity
CaballoMa Dec 6, 2023
db0cb21
Update HardecodedHexagonTilePre.prefab
CaballoMa Dec 6, 2023
58fd920
atmosphere
CaballoMa Dec 6, 2023
fec2cc3
Fallback
IwakuraRein Dec 6, 2023
d6af600
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
IwakuraRein Dec 6, 2023
8583fda
Fix bugs
IwakuraRein Dec 6, 2023
1e3aaae
Update Planet.unity
CaballoMa Dec 6, 2023
2f8c304
Update README.md
Jeff-Ling Dec 6, 2023
183ccc4
Readme-xym
CaballoMa Dec 6, 2023
8d06d90
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
CaballoMa Dec 6, 2023
7ac3cf5
Update README.md
CaballoMa Dec 6, 2023
eace8a1
Update README.md
Jeff-Ling Dec 6, 2023
3d68c34
Update Prefab
Jeff-Ling Dec 10, 2023
e2a0aeb
Merge branch 'main' of https://github.com/Jeff-Ling/final-project
Jeff-Ling Dec 10, 2023
3c18b0c
Update README.md
IwakuraRein Dec 11, 2023
744feb7
Update README.md
Jeff-Ling Dec 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
72 changes: 72 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Uu]ser[Ss]ettings/

# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
/[Mm]emoryCaptures/

# Recordings can get excessive in size
/[Rr]ecordings/

# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*

# Autogenerated Jetbrains Rider plugin
/[Aa]ssets/Plugins/Editor/JetBrains*

# Visual Studio cache directory
.vs/

# Gradle cache directory
.gradle/

# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db

# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta

# Unity3D generated file on crash reports
sysinfo.txt

# Builds
*.apk
*.aab
*.unitypackage
*.app

# Crashlytics generated file
crashlytics-build.properties

# Packed Addressables
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*

# Temporary auto-generated Android Assets
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*
6 changes: 6 additions & 0 deletions .vsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}
8 changes: 8 additions & 0 deletions Assets/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions Assets/Editor/CellEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using Planetile;
using System;

[CustomEditor(typeof(Cell))]
public class CellEditor : Editor
{
Cell cell;
string[] itemOptions;
int selectedItem = 0;
void OnEnable()
{
cell = (Cell)target;
if (!cell.IsPentagon)
{
itemOptions = new string[WFCManager.Instance.HexagonItemNum];
for (int i = 0; i < WFCManager.Instance.HexagonItemNum; i++)
{
itemOptions[i] = WFCManager.Instance.GetHexagonItem(i).ItemName;
}
}
else
{
itemOptions = new string[WFCManager.Instance.PentagonItemNum];
for (int i = 0; i < WFCManager.Instance.PentagonItemNum; i++)
{
itemOptions[i] = WFCManager.Instance.GetPentagonItem(i).ItemName;
}
}
}
public override void OnInspectorGUI()
{
DrawDefaultInspector();
if (GUILayout.Button("Place one item"))
{
WFCManager.Instance.Collapse(cell);
}
using (new EditorGUILayout.HorizontalScope())
{
selectedItem = EditorGUILayout.Popup(selectedItem, itemOptions);
if (GUILayout.Button("Place"))
{
if (!cell.IsPentagon)
{
cell.PlaceItem(WFCManager.Instance.GetHexagonItem(selectedItem));
}
else
cell.PlaceItem(WFCManager.Instance.GetPentagonItem(selectedItem));
}
if (GUILayout.Button("Clear"))
{
cell.CleanUp();
}
}
}
}
11 changes: 11 additions & 0 deletions Assets/Editor/CellEditor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions Assets/Editor/TileEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using Planetile;
using System;

[CustomEditor(typeof(HexagonTile))]
public class TileEditor : Editor
{
HexagonTile tile;
void OnEnable()
{
tile = (HexagonTile)target;
}
public override void OnInspectorGUI()
{
DrawDefaultInspector();
using (new EditorGUILayout.HorizontalScope())
{
if (GUILayout.Button("Fill"))
{
WFCManager.Instance.FillOneTile(tile);
}
if (GUILayout.Button("Clear"))
{
foreach(var cell in tile.cellData.Cells)
{
cell.CleanUp();
}
}
}
}
}
11 changes: 11 additions & 0 deletions Assets/Editor/TileEditor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

98 changes: 98 additions & 0 deletions Assets/Editor/WFCRuleTester.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
using UnityEngine;
using UnityEditor;

using Planetile;

public class TemporaryCellClass : IWFCCell
{
public bool IsPentagon => false;
WFCType type = WFCType.Null;
public TemporaryCellClass(WFCType type) { this.type = type; }
public WFCType Type => type;

public IWFCTile Tile => throw new System.NotImplementedException();

public IWFCItem Item => throw new System.NotImplementedException();

public bool IsPlaced => throw new System.NotImplementedException();

public int EdgeNum => throw new System.NotImplementedException();

public IWFCCell[] GetAdjacentCells()
{
throw new System.NotImplementedException();
}

public IWFCCell[] GetAdjacentCellsInTile(IWFCTile tile)
{
throw new System.NotImplementedException();
}

public Vector3 GetWorldPos()
{
throw new System.NotImplementedException();
}

public void PlaceItem(IWFCItem item)
{
throw new System.NotImplementedException();
}
}


public class WFCRuleTester : EditorWindow
{
string inputText = "Input rule.";
WFCRule rule = new WFCRule();
WFCType type0 = WFCType.Null;
WFCType type1 = WFCType.Null;
WFCType type2 = WFCType.Null;
string testResult = "";

[MenuItem("Window/WFC Rule Tester")]
public static void ShowWindow()
{
GetWindow<WFCRuleTester>("WFC Rule Tester");
}

void OnGUI()
{
using (new EditorGUILayout.HorizontalScope())
{
inputText = EditorGUILayout.TextArea(inputText);

if (GUILayout.Button("Parse Rule"))
{
rule.rule = inputText;
rule.InitializeRPN();
testResult = "";
}
}
if (rule.Initialized)
{
using (new EditorGUILayout.HorizontalScope())
{
type0 = (WFCType)EditorGUILayout.EnumFlagsField(type0);
type1 = (WFCType)EditorGUILayout.EnumFlagsField(type1);
type2 = (WFCType)EditorGUILayout.EnumFlagsField(type2);
if (GUILayout.Button("Test"))
{
var neighbors = new TemporaryCellClass[3] {
new TemporaryCellClass(type0),
new TemporaryCellClass(type1),
new TemporaryCellClass(type2),
};
if (rule.SatisfyRule(neighbors))
{
testResult = "True";
}
else
{
testResult = "False";
}
}
}
GUILayout.Label(testResult);
}
}
}
11 changes: 11 additions & 0 deletions Assets/Editor/WFCRuleTester.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Imported.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading