private void Awake()
 {
     _anim           = GetComponent <Animator>();
     _playerAudio    = GetComponent <AudioSource>();
     _playerMovement = GetComponent <OtherPlayerMovement>();
     _playerShooting = GetComponentInChildren <OtherPlayerShooting>();
     CurrentHealth   = StartingHealth;
 }
Example #2
0
    public void OtherPlayerAttack(MsgSCPlayerAttack msg)
    {
        GameObject          obj = playerArray[msg.userID];
        OtherPlayerShooting ops = obj.GetComponentInChildren <OtherPlayerShooting>();

        if (msg.kind == MsgSCPlayerAttack.WEAPON_ATTACK)
        {
            ops.ShootArrow();
        }
        else if (msg.kind == MsgSCPlayerAttack.MAGIC_ATTACK)
        {
            ops.ShootMagic();
        }
    }