summaryrefslogtreecommitdiff
path: root/Client/Assembly-CSharp/LobbyBehaviour.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assembly-CSharp/LobbyBehaviour.cs')
-rw-r--r--Client/Assembly-CSharp/LobbyBehaviour.cs82
1 files changed, 82 insertions, 0 deletions
diff --git a/Client/Assembly-CSharp/LobbyBehaviour.cs b/Client/Assembly-CSharp/LobbyBehaviour.cs
new file mode 100644
index 0000000..de036b7
--- /dev/null
+++ b/Client/Assembly-CSharp/LobbyBehaviour.cs
@@ -0,0 +1,82 @@
+using System;
+using Hazel;
+using InnerNet;
+using UnityEngine;
+
+public class LobbyBehaviour : InnerNetObject
+{
+ public static LobbyBehaviour Instance;
+
+ public AudioClip SpawnSound;
+
+ public AnimationClip SpawnInClip;
+
+ public Vector2[] SpawnPositions;
+
+ public AudioClip DropShipSound;
+
+ public ShipRoom[] AllRooms;
+
+ private float timer;
+
+ public void Start()
+ {
+ LobbyBehaviour.Instance = this;
+ SoundManager.Instance.StopAllSound();
+ SoundManager.Instance.PlaySound(this.DropShipSound, true, 1f).pitch = 1.2f;
+ Camera main = Camera.main;
+ if (main)
+ {
+ FollowerCamera component = main.GetComponent<FollowerCamera>();
+ if (component)
+ {
+ component.shakeAmount = 0.03f;
+ component.shakePeriod = 400f;
+ }
+ }
+ }
+
+ public void FixedUpdate()
+ {
+ this.timer += Time.deltaTime;
+ if (this.timer < 0.25f)
+ {
+ return;
+ }
+ this.timer = 0f;
+ if (PlayerControl.GameOptions != null)
+ {
+ int numPlayers = GameData.Instance ? GameData.Instance.PlayerCount : 10;
+ DestroyableSingleton<HudManager>.Instance.GameSettings.Text = PlayerControl.GameOptions.ToHudString(numPlayers);
+ DestroyableSingleton<HudManager>.Instance.GameSettings.gameObject.SetActive(true);
+ }
+ }
+
+ public override void OnDestroy()
+ {
+ Camera main = Camera.main;
+ if (main)
+ {
+ FollowerCamera component = main.GetComponent<FollowerCamera>();
+ if (component)
+ {
+ component.shakeAmount = 0.02f;
+ component.shakePeriod = 0.3f;
+ }
+ }
+ base.OnDestroy();
+ }
+
+ public override void HandleRpc(byte callId, MessageReader reader)
+ {
+ }
+
+ public override bool Serialize(MessageWriter writer, bool initialState)
+ {
+ return false;
+ }
+
+ public override void Deserialize(MessageReader reader, bool initialState)
+ {
+ }
+}