Пример #1
0
        private void OnGrow(int nb)
        {
            StopAllCoroutines();

            LegumeManager.State currentState = _state;
            _state = (LegumeManager.State)((int)(_state + nb) % 4);
            Debug.Log(M_Cellule + " OnGrow : " + currentState + " => " + _state);
            _spriteRenderer.sprite = LegumeManager.GetInstance().GetLegumeInfo(Type).m_Sprites[(int)_state];

            switch (_state)
            {
            case LegumeManager.State.Graine:
                OnChangeStateGraine();
                break;

            case LegumeManager.State.Pousse:
                OnChangeStatePousse();
                break;

            case LegumeManager.State.Recolte:
                OnChangeStateRecolte();
                break;

            case LegumeManager.State.Pourri:
                OnChangeStatePourri();
                break;
            }
            //OnState.Invoke(_state);
        }
Пример #2
0
        private void ChangeMonth(int month)
        {
            LegumeManager.State requestState = LegumeManager.GetInstance().GetLegumeInfo(Type).m_Calendar[month];

            switch (requestState)
            {
            case LegumeManager.State.Graine:
                if (_state == LegumeManager.State.Pourri)
                {
                    OnGrow(1);
                }
                break;

            case LegumeManager.State.Pousse:
                if (_state == LegumeManager.State.Graine)
                {
                    OnGrow(1);
                }
                break;

            case LegumeManager.State.Recolte:
                if (_state == LegumeManager.State.Pousse)
                {
                    OnGrow(1);
                }
                break;

            case LegumeManager.State.Pourri:
                if (_state == LegumeManager.State.Graine)
                {
                    M_Cellule.Supprimer();
                }
                else if (_state == LegumeManager.State.Pousse)
                {
                    OnGrow(2);
                }
                else if (_state == LegumeManager.State.Recolte)
                {
                    OnGrow(1);
                    M_Cellule.Fertiliser(1);
                }
                break;
            }
        }
Пример #3
0
 /// <summary>
 /// Deprecated
 /// </summary>
 /// <param name="state"></param>
 private void StateManage(LegumeManager.State state)
 {
     //Sprite sp = LegumeManager.GetInstance()._LegumeSprites[state];
     OnState.Invoke(state);
 }