Exemplo n.º 1
0
    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();
        }
    }
Exemplo n.º 2
0
 private void OnGameplayFadeIntCallback()
 {
     printCtrl.EnableGraphic(true);
     musicCtrl.PlayGameClip();
     scoreCtrl.Init();
     gameplayPanel.UpdateScore(scoreCtrl.GetCurrentScore());
     HandleOnShapeChange(Direction.None, ShapeController.GetCurrentShape(), false);
 }
Exemplo n.º 3
0
    public bool CheckShape(ShapeScriptable _shape)
    {
        isToGuess = false;

        if (ShapeController.GetCurrentShape() == shape)
        {
            spriteMask.sprite     = shape.shadowSprite;
            spriteRenderer.sprite = shape.shapeSprite;
            return(true);
        }

        return(false);
    }