protected override void OnStart()
        {
            base.OnStart();

            _candyController = _controller as CandyController;
            _candyController.RemainingGelsText += UpdateData;
        }
Exemplo n.º 2
0
 public void MoveCandy(CandyController candyController)
 {
     candyController.AddCandy(m_candyCount);
     if (m_gameCandy)
     {
         GameScore.SetLastScore(m_candyCount);
     }
 }
Exemplo n.º 3
0
    public void SwapSprite(CandyController newCandy)
    {
        if (spriteRenderer.sprite ==
            newCandy.GetComponent <SpriteRenderer>().sprite)
        {
            return;
        }

        Sprite oldCandy = newCandy.spriteRenderer.sprite;

        newCandy.spriteRenderer.sprite = this.spriteRenderer.sprite;
        this.spriteRenderer.sprite     = oldCandy;

        int tempId = newCandy.id;

        newCandy.id = this.id;
        this.id     = tempId;
    }
Exemplo n.º 4
0
 private void DeselectCandy()
 {
     isSelected           = false;
     spriteRenderer.color = Color.white;
     previousSelected     = null;
 }
Exemplo n.º 5
0
 private void SelectCandy()
 {
     isSelected           = true;
     spriteRenderer.color = selectedColor;
     previousSelected     = gameObject.GetComponent <CandyController>();
 }