Skip to content

Commit

Permalink
Added play mode and terrain.
Browse files Browse the repository at this point in the history
Still needs enemy loading and enemies themselves
  • Loading branch information
jedjoud10 committed Dec 4, 2019
1 parent 1a1f412 commit 6cba2da
Show file tree
Hide file tree
Showing 12 changed files with 2,616 additions and 866 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/[Bb]uild/
/[Bb]uilds/
/Assets/AssetStoreTools*
/Assets/Samples*

# Visual Studio cache directory
.vs/
Expand Down
Binary file added Assets/New Terrain.asset
Binary file not shown.
8 changes: 7 additions & 1 deletion Assets/Player/Building Mechanic/Scripts/BuildingUIScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,13 @@ public void PreviewCraft()
SaveToTemporaryFile();
GameObject.FindObjectOfType<SceneManagerScript>().ChangeScene("PreviewScene");
}
//Make and restart the robot buildin
//Change to play map
public void PlayCraft()
{
SaveToTemporaryFile();
GameObject.FindObjectOfType<SceneManagerScript>().ChangeScene("PlayScene");
}
//Make and restart the robot building
public void MakeNewRobot()
{
BuildingSaverLoaderScript.LoadBuildingPieces("BaseRobot", false);
Expand Down
9 changes: 9 additions & 0 deletions Assets/Player/Building Mechanic/Scripts/SceneManagerScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ public void UpdateScene(string _scenename)
Time.timeScale = 0.0f;
GameObject.FindObjectOfType<SaverLoaderHandlerScript>().LoadRobotPhysics("TemporarySave", "TemporarySave", false);
}
if (_scenename == "PlayScene")
{
Time.timeScale = 1.0f;
GameObject.FindObjectOfType<SaverLoaderHandlerScript>().LoadRobotPhysics("TemporarySave", "TemporarySave", true);
Debug.Log("Moved into preview, will load pieces");
GameObject player = GameObject.FindGameObjectWithTag("Player");//Player robot itself
GameObject playerSpawn = GameObject.FindGameObjectWithTag("PlayerSpawn");//Spawn point of player
player.transform.position = playerSpawn.transform.position;//Go to player position
}
if (_scenename == "PreviewScene")
{
Time.timeScale = 1.0f;
Expand Down
22 changes: 11 additions & 11 deletions Assets/SavedRobots/TemporarySave.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"z": 2.000000476837158
},
"eulerRotation": {
"x": 89.64889526367188,
"y": 189.69908142089845,
"z": 99.39033508300781
"x": 89.65225982666016,
"y": 189.69773864746095,
"z": 99.38894653320313
}
},
{
Expand All @@ -27,7 +27,7 @@
"z": 2.000000476837158
},
"eulerRotation": {
"x": 0.05986157804727554,
"x": 0.05986163392663002,
"y": 90.35015106201172,
"z": 359.6910400390625
}
Expand Down Expand Up @@ -59,9 +59,9 @@
"z": 1.9999995231628419
},
"eulerRotation": {
"x": 270.35443115234377,
"y": 350.3007507324219,
"z": 279.3899841308594
"x": 270.352783203125,
"y": 350.3013000488281,
"z": 279.3896484375
}
},
{
Expand All @@ -75,9 +75,9 @@
"z": -1.999998688697815
},
"eulerRotation": {
"x": 270.35223388671877,
"y": 350.3030700683594,
"z": 279.38775634765627
"x": 270.34942626953127,
"y": 350.300537109375,
"z": 279.3909606933594
}
},
{
Expand Down Expand Up @@ -123,7 +123,7 @@
"z": -2.006118059158325
},
"eulerRotation": {
"x": 0.3712652921676636,
"x": 0.37126463651657107,
"y": 270.40771484375,
"z": 359.34271240234377
}
Expand Down
13 changes: 12 additions & 1 deletion Assets/Scenes/BuildingScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -4144,7 +4144,18 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 1120001946}
m_OnClick:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 963194232}
m_MethodName: PlayCraft
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &1120001946
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down
Loading

0 comments on commit 6cba2da

Please sign in to comment.