コード例 #1
0
        private void Awake()
        {
            controller = GetComponent <CrabController>();

            controller.Died += () => { SFXManager.PlaySound(SFXManager.SFX.damageEnemy); };

            roamDirection = -1;
        }
コード例 #2
0
        // Start is called before the first frame update
        private void Awake()
        {
            controller = GetComponent <CrabController>();

            controller.Died += () =>
            {
                SFXManager.StopOnce(SFXManager.SFX.walk);
                SceneManager.LoadScene("Stage1");
            };
            controller.GroundedStateChanged += (grounded) => {
                if (grounded)
                {
                    PlayJumpEnd();
                }
                else
                {
                    PlayJumpStart();
                }
            };
        }