Skip to content

Commit

Permalink
As good as it'll get for now
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobright committed Apr 28, 2021
1 parent f9ea2dc commit 12d95e5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
32 changes: 22 additions & 10 deletions Assets/Scenes/Level.unity
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ Transform:
- {fileID: 1814847932}
- {fileID: 1154908058}
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &186310062 stripped
GameObject:
Expand Down Expand Up @@ -401,7 +401,7 @@ Transform:
m_GameObject: {fileID: 420765474}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -2, z: 0}
m_LocalScale: {x: 5, y: 1, z: 5}
m_LocalScale: {x: 3, y: 1, z: 3}
m_Children: []
m_Father: {fileID: 1182668359}
m_RootOrder: 0
Expand Down Expand Up @@ -813,7 +813,7 @@ Transform:
m_GameObject: {fileID: 622946558}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: -2, z: 0}
m_LocalScale: {x: 5, y: 1, z: 5}
m_LocalScale: {x: 3, y: 1, z: 3}
m_Children: []
m_Father: {fileID: 1696697893}
m_RootOrder: 0
Expand Down Expand Up @@ -872,23 +872,35 @@ PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 186310063}
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 221b990c9b87a9c47b3eda1402483b0d, type: 3}
propertyPath: m_RootOrder
value: 0
value: 5
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 221b990c9b87a9c47b3eda1402483b0d, type: 3}
propertyPath: m_LocalScale.x
value: 2
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 221b990c9b87a9c47b3eda1402483b0d, type: 3}
propertyPath: m_LocalScale.y
value: 2
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 221b990c9b87a9c47b3eda1402483b0d, type: 3}
propertyPath: m_LocalScale.z
value: 2
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 221b990c9b87a9c47b3eda1402483b0d, type: 3}
propertyPath: m_LocalPosition.x
value: 90
value: 180
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 221b990c9b87a9c47b3eda1402483b0d, type: 3}
propertyPath: m_LocalPosition.y
value: -2
value: -4
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 221b990c9b87a9c47b3eda1402483b0d, type: 3}
propertyPath: m_LocalPosition.z
value: 3
value: 6
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 221b990c9b87a9c47b3eda1402483b0d, type: 3}
propertyPath: m_LocalRotation.w
Expand Down Expand Up @@ -1419,7 +1431,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1182668358}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -469, y: 0.4, z: 129}
m_LocalPosition: {x: 0, y: -22, z: 160}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 420765475}
Expand Down Expand Up @@ -1824,7 +1836,7 @@ Transform:
- {fileID: 2146000051}
- {fileID: 1696473517}
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1467896422
GameObject:
Expand Down
9 changes: 8 additions & 1 deletion Assets/Scripts/Managers/ServerGameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ void Update()
RpcCloseDoors();
RpcChangeGameState(GameState.GameReady);
RpcPlaySound(AnnouncerClip.countdown);

for (int i = playersConnected; i < 12; i++) {
SpawnAI(i%2 == 1);
}
Expand Down Expand Up @@ -188,6 +189,12 @@ private void ResetVariables(bool local = false) {

foreach (GameObject flag in GameObject.FindGameObjectsWithTag("Finish"))
GameObject.Destroy(flag);

foreach (GameObject player in GameObject.FindGameObjectsWithTag("Player")) {
if (player.GetComponent<PenguinMove>().isBot) {
GameObject.Destroy(player);
}
}

if (!local && isServer) {
RpcChangeGameState(GameState.TeamSelection);
Expand All @@ -204,7 +211,7 @@ private void SpawnAI(bool greenTeam)
var pos = desiredTransform.position;
pos += new Vector3(Random.Range(-2f, 2f), 0f, Random.Range(-2f, 2f));

var bot = Instantiate(aiPenguin, pos, desiredTransform.rotation);
GameObject bot = GameObject.Instantiate(aiPenguin, pos, desiredTransform.rotation) as GameObject;
NetworkServer.Spawn(bot);
bot.GetComponent<PenguinBase>().StartBot(greenTeam);
}
Expand Down

0 comments on commit 12d95e5

Please sign in to comment.