Ejemplo n.º 1
0
        void Update()
        {
            PlayerControls controls = PlayerControls.Get(character.player_id);

            take_item_timer += Time.deltaTime;
            if (held_item && controls.GetActionDown())
            {
                held_item.UseItem();
            }
        }
Ejemplo n.º 2
0
        //Handle render and controls
        void Update()
        {
            hit_timer += Time.deltaTime;
            move_input = Vector2.zero;

            //Controls
            if (!disable_controls)
            {
                PlayerControls controls = PlayerControls.Get(player_id);
                move_input = controls.GetMove();
            }

            //Update lookat side
            if (move.magnitude > 0.1f)
            {
                lookat = move.normalized;
            }
            if (Mathf.Abs(lookat.x) > 0.02)
            {
                side = Mathf.Sign(lookat.x);
            }
        }