Esempio n. 1
0
    // Update is called once per frame
    public override void Update()
    {
        var xAxis = movingDisabled ? 0 : Input.GetAxisRaw(ActivePlayerData.Horizontal(activePlayer));
        var yAxis = movingDisabled ? 0 : Input.GetAxisRaw(ActivePlayerData.Vertical(activePlayer));

        animator.SetBool("moving", Mathf.Abs(xAxis) + Mathf.Abs(yAxis) > 0);

        characterMesh.LookAt(transform.localPosition + new Vector3(xAxis, 0f, yAxis).normalized);

        SetVelocity(new Vector3(xAxis, 0f, yAxis).normalized *currentMovementSpeed);

        UpdateGravity();
        MoveCharacter();
    }
Esempio n. 2
0
    void Update()
    {
        if (Input.GetButtonDown(ActivePlayerData.Fire(activePlayer)))
        {
            this.closest = ClosestInRangeItem();
            if (this.closest)
            {
                carryItem = closest is Pickup ? (Pickup)closest : carryItem;
                closest.Interact(this);
            }
        }


        if (Input.GetButtonUp(ActivePlayerData.Fire(activePlayer)))
        {
            if (this.closest)
            {
                this.closest.FinishInteract(this);
            }
        }
    }
Esempio n. 3
0
 public static float GetCurrentGold()
 {
     return(ActivePlayerData.GetCurrentGold());
 }
Esempio n. 4
0
 public static int GetLevel()
 {
     return(ActivePlayerData.GetLevel());
 }
Esempio n. 5
0
 public static string GetSummonerName()
 {
     return(ActivePlayerData.GetSummonerName());
 }