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); }
private void RunPulsation() { if (secondForNextState < GameConst.CHERRY_PULS_START && state == CherryState.Enable) { state = CherryState.Pulsation; StartCoroutine(Pulsation()); } }
private void Show() { state = CherryState.Enable; spriteRender.color = defaultColor; coll2D.enabled = true; secondForNextState = GameConst.CHERRY_ENABLE_INTERVAL; }
private void Hide() { state = CherryState.Disable; spriteRender.color = hideColor; coll2D.enabled = false; secondForNextState = GameConst.CHERRY_DISABLE_INTERVAL; }