public void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("CloseEnemiesDestroyer"))
        {
            return;
        }

        otherObjController = other.gameObject.GetComponent <ObjectController>();
        string tag = other.gameObject.tag;

        if (tag == "Life")
        {
            ChangeHitPoints(1);
            otherObjController.Kill();
            MainAuidoManager.mainAudio.PlaySound(lifeCollectSound, 0.4f);
        }
        else if (tag == "Coin")
        {
            other.GetComponent <CoinController>().AddSum();
            MainAuidoManager.mainAudio.PlaySound(coinCollectSound, 0.4f);
        }
        else if (tag == "Token")
        {
            tokenManager.AddTokens(1);
        }

        otherObjController.Kill();
    }
예제 #2
0
    private void ShowMainCanvas()
    {
        if (gifts.addedSum > 0)
        {
            moneyController.ChangeMoney(gifts.addedSum);
            PlayerInfo.info.SaveData();
        }

        if (gifts.addedTokens > 0)
        {
            tokenManager.AddTokens(gifts.addedTokens);
            PlayerInfo.info.SaveData();
        }

        gifts.HideGiftGroup();

        messages.ShowObjects();
        blur.enabled = false;
        TouchRotate.isRotatingByDrag = true;
    }