private void OnTriggerEnter2D(Collider2D collision) { if (!readCollision) { return; } ShapeMatch shape = collision.GetComponent <ShapeMatch>(); if (shape != null) { if (rightShapeRoutine != null) { StopCoroutine(rightShapeRoutine); } anim.SetTrigger("Print"); if (shape.CheckShape(ShapeController.GetCurrentShape())) { rightShapeRoutine = RightShapeCoroutine(); StartCoroutine(rightShapeRoutine); OnShapeGuessed?.Invoke(); return; } OnShapeWrong?.Invoke(); } }
private void OnGameplayFadeIntCallback() { printCtrl.EnableGraphic(true); musicCtrl.PlayGameClip(); scoreCtrl.Init(); gameplayPanel.UpdateScore(scoreCtrl.GetCurrentScore()); HandleOnShapeChange(Direction.None, ShapeController.GetCurrentShape(), false); }
public bool CheckShape(ShapeScriptable _shape) { isToGuess = false; if (ShapeController.GetCurrentShape() == shape) { spriteMask.sprite = shape.shadowSprite; spriteRenderer.sprite = shape.shapeSprite; return(true); } return(false); }