Beispiel #1
0
        public void Initialize(JsonCherry jsonCherry)
        {
            secondForNextState = jsonCherry.TimeForNextState;
            state = jsonCherry.State;
            score = jsonCherry.Score;

            if (state == CherryState.Disable) Hide();
            StartCoroutine(StateChangedCoroutine());
            if (state == CherryState.Pulsation)
                StartCoroutine(Pulsation());

            onCherryAteAgain(score);
        }
Beispiel #2
0
 private void RunPulsation()
 {
     if (secondForNextState < GameConst.CHERRY_PULS_START && state == CherryState.Enable)
     {
         state = CherryState.Pulsation;
         StartCoroutine(Pulsation());
     }
 }
Beispiel #3
0
 private void Show()
 {
     state = CherryState.Enable;
     spriteRender.color = defaultColor;
     coll2D.enabled = true;
     secondForNextState = GameConst.CHERRY_ENABLE_INTERVAL;
 }
Beispiel #4
0
 private void Hide()
 {
     state = CherryState.Disable;
     spriteRender.color = hideColor;
     coll2D.enabled = false;
     secondForNextState = GameConst.CHERRY_DISABLE_INTERVAL;
 }