Beispiel #1
0
    void Update()
    {
        if (!isLocalPlayer)
        {
            return;
        }

        Rotate();
        Move();



        if (Input.GetKey(KeyCode.Mouse0))
        {
            anim.Attack(1);
            aUV.SetUVSpeed(0.0001f);

            //If cooldown is reached, attack once
            if (cdLightning.ActionReady())
            {
                cdLightning.UpdateTimer();
                cdReady = true;
            }
            else
            {
                cdReady = false;
            }
            com.LightningAttack(cdReady);
        }
        else if (Input.GetKeyUp(KeyCode.Mouse0))
        {
            anim.StopAttack(1);
            com.StopLightningAttack();
            aUV.SetUVSpeed(0.1f);
        }
    }