//Handle render and controls void Update() { move_input = Vector2.zero; //Controls if (!disable_controls) { //Controls TopDownControls controls = TopDownControls.Get(player_id); move_input = controls.GetMove(); //Items take_item_timer += Time.deltaTime; if (carry_item && controls.GetActionDown()) { carry_item.UseItem(); } } //Update lookat side if (move.magnitude > 0.1f) { lookat = move.normalized; } if (Mathf.Abs(lookat.x) > 0.02) { side = Mathf.Sign(lookat.x); } //Anims animator.SetFloat("Speed", move.magnitude); animator.SetInteger("Side", GetSideAnim()); animator.SetBool("Hold", GetHoldingItem() != null); }
void Update() { PlayerControls controls = PlayerControls.Get(character.player_id); take_item_timer += Time.deltaTime; if (held_item && controls.GetActionDown()) { held_item.UseItem(); } }