private void Release() { OnFinishSetSafeArea?.Invoke(); if (safetyAreaMono != null) { safetyAreaMono.Release(); GameObject.Destroy(safetyAreaGameObject); safetyAreaMono = null; } }
private void InitSafetyAreaMono() { if (safetyAreaMono == null) { GameObject safetyAreaMonoResource = Resources.Load <GameObject>("SafetyAreaMono"); safetyAreaGameObject = GameObject.Instantiate(safetyAreaMonoResource); safetyAreaMono = safetyAreaGameObject.GetComponent <SafetyAreaMono>(); } safetyAreaMono.Init(); }
public void InitStateMachine(SafetyAreaMono safetyAreaMono) { if (playAreaStateDic == null) { playAreaStateDic = new Dictionary <PlayAreaStateEnum, AbstractPlayAreaState <SafetyAreaMono> >(); playAreaStateDic.Add(PlayAreaStateEnum.WaitingDraw, new PrepareDrawPlayAreaState()); playAreaStateDic.Add(PlayAreaStateEnum.OK, new PlayAreaOKState()); playAreaStateDic.Add(PlayAreaStateEnum.NotEnough, new PlayAreaNotEnoughState()); foreach (AbstractPlayAreaState <SafetyAreaMono> valueItem in playAreaStateDic.Values) { valueItem.Init(safetyAreaMono); } } }