private void Awake() { controls = new PlayerControl(); controls.Enable(); controls.Gameplay.Yoyo.performed += ctx => Dash(); controls.Gameplay.Attack.performed += ctx => MeleAttack(); controls.Gameplay.Utilitaire1.performed += ctx => UseSlotInventory(); controls.Gameplay.ChangeWeapon.performed += ctx => SwitchWeapon(); controls.Gameplay.Menu.performed += ctx => manag.MenuPause(); controls.Gameplay.Move.performed += ctx => inputDirMove = ctx.ReadValue <Vector2>(); controls.Gameplay.Move.canceled += ctx => inputDirMove = Vector2.zero; GetComponent <Health>().OnDie.AddListener(Die); anim = GetComponentInChildren <Animator>(); rb = GetComponent <Rigidbody>(); particle = GetComponentInChildren <ParticleSystem>(); manag = FindObjectOfType <LevelManager>(); loader = FindObjectOfType <ProgressSceneLoader>(); tuto = FindObjectOfType <TuToManager>(); }
// Start is called before the first frame update void Start() { anim = GetComponent <Animator>(); manag = FindObjectOfType <TuToManager>(); }