Ejemplo n.º 1
0
 private void Release()
 {
     OnFinishSetSafeArea?.Invoke();
     if (safetyAreaMono != null)
     {
         safetyAreaMono.Release();
         GameObject.Destroy(safetyAreaGameObject);
         safetyAreaMono = null;
     }
 }
Ejemplo n.º 2
0
 private void InitSafetyAreaMono()
 {
     if (safetyAreaMono == null)
     {
         GameObject safetyAreaMonoResource = Resources.Load <GameObject>("SafetyAreaMono");
         safetyAreaGameObject = GameObject.Instantiate(safetyAreaMonoResource);
         safetyAreaMono       = safetyAreaGameObject.GetComponent <SafetyAreaMono>();
     }
     safetyAreaMono.Init();
 }
Ejemplo n.º 3
0
    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);
            }
        }
    }