示例#1
0
 // Update is called once per frame
 void Update()
 {
     if (_playerstate == Player.MoveState.Attack)
     {
         _attackCouldown -= Time.deltaTime;
         if (_attackCouldown <= 0)
         {
             _playerstate = Player.MoveState.Idle;
             _animator.Play("Idle");
         }
     }
 }
示例#2
0
    public void addData(bool hasButtonEvent, Player.MoveState moveState)
    {
        byte1[0] = hasButtonEvent;

        switch (moveState)
        {
        case Monster.MoveState.Backward:
            byte1[1] = true;
            byte1[2] = false;
            byte1[3] = false;
            break;

        case Monster.MoveState.Stop:
            byte1[1] = false;
            byte1[2] = true;
            byte1[3] = false;
            break;

        case Monster.MoveState.Forward:
            byte1[1] = false;
            byte1[2] = false;
            byte1[3] = true;
            break;
        }

        byte1[4] = GameManager.me.isAutoPlay;

        byte1[5] = changePlayer;
        byte1[6] = changePVPPlayer;

        _ms.Write(boolArrayToByteArray(byte1), 0, 1);

        if (byte1[0])
        {
            byte2[0] = unitButtons[0];
            byte2[1] = unitButtons[1];
            byte2[2] = unitButtons[2];
            byte2[3] = unitButtons[3];
            byte2[4] = unitButtons[4];
            byte2[5] = skillButtons[0];
            byte2[6] = skillButtons[1];
            byte2[7] = skillButtons[2];

            _ms.Write(boolArrayToByteArray(byte2), 0, 1);
        }
    }
示例#3
0
 // Use this for initialization
 void Start()
 {
     _animator    = GetComponent <Animator> ();
     _player      = GetComponent <Player> ();
     _playerstate = _player.movestate;
 }
示例#4
0
 public void Attack()
 {
     _attackCouldown = 0.15f;
     _playerstate    = Player.MoveState.Attack;
     _animator.Play("Hit2");
 }