blob: de036b727111261902c98ad233779fd8fb8f27e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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)
{
}
}
|