Beispiel #1
0
        // Procedure that turns uncooked to cooked potatoes
        private void CookedProcedure()
        {
            PotatoCookedState     = PotatoCookedState.Cooked;
            SpriteRenderer.sprite = GetSprite;

            ChangeParticlesStartColorAlpha(.05f);
            foreach (var particle in Particles)
            {
                particle.Play();
            }

            rigAnimator.SetInteger("State", 1);
            MicrogameController.instance.playSFX(readySound, AudioHelper.getAudioPan(transform.position.x));
        }
Beispiel #2
0
        // Procedure that turns uncooked to cooked potatoes
        private void BurntProcedure()
        {
            PotatoCookedState     = PotatoCookedState.Burnt;
            SpriteRenderer.sprite = GetSprite;

            ChangeParticlesStartColorAlpha(.4f);
            foreach (var particle in Particles)
            {
                particle.Play();
            }


            rigAnimator.SetInteger("State", 2);
            FoodRoast_VictoryController.Instance.setVictory(false);
            MicrogameController.instance.playSFX(failSound, AudioHelper.getAudioPan(transform.position.x));
        }
Beispiel #3
0
        private void Start()
        {
            var rb2d = GetComponent <Collider2D>();

            for (int i = 0; i < transform.parent.childCount; i++)
            {
                var otherCol2d = transform.parent.GetChild(i).GetComponent <Collider2D>();
                if (otherCol2d != rb2d)
                {
                    Physics2D.IgnoreCollision(rb2d, otherCol2d);
                }
            }

            PotatoCookedState = PotatoCookedState.Uncooked;
            StartCoroutine(AnimationCoroutine());
            StartCoroutine(CookingCoroutine());
        }