diff --git a/Assets/Zion/Scripts/Adam/FormationManager.cs b/Assets/Zion/Scripts/Adam/FormationManager.cs index a401019c..7cb1201f 100644 --- a/Assets/Zion/Scripts/Adam/FormationManager.cs +++ b/Assets/Zion/Scripts/Adam/FormationManager.cs @@ -27,10 +27,13 @@ public class FormationManager : MonoSingleton public FormationInfo formationInfo; public List allUavms = new List(); public List formationIDs = new List(); + void Awake() + { + SyncCreateRoom.send2roomRequset += OnReciveMsg; + } // Start is called before the first frame update void Start() { - startFormationBtn.onClick.AddListener(OnStartFormation); submitFormationBtn.onClick.AddListener(OnSubmit); cancelFormationBtn.onClick.AddListener(OnCancel); @@ -42,10 +45,6 @@ public class FormationManager : MonoSingleton startFormationBtn.gameObject.SetActive(index == 0); submitFormationBtn.gameObject.SetActive(index == 1); cancelFormationBtn.gameObject.SetActive(index == 1); - if(index == 0) - { - SyncCreateRoom.send2roomRequset -= OnReciveMsg; - } } // Update is called once per frame @@ -180,7 +179,6 @@ public class FormationManager : MonoSingleton public void OnStartFormation() { isStartFormation = true; - SyncCreateRoom.send2roomRequset += OnReciveMsg; CheckBtns(1); }