예제 #1
0
    public void Shot(Vector3 pos, Vector3 forward, Quaternion qt)
    {
        if (_anim.IsDie)
        {
            return;
        }

        _timer = 0f;

        _audioSource.PlayOneShot(_shotEffect, 0.1f);
        _anim.PlayAnimation(CAnimation.STATE.ATTACK);

        GameObject bullet = Instantiate(_bulletPrefab, pos, qt);

        bullet.GetComponentInChildren <Rigidbody>().velocity = forward * _shotPower;
        bullet.GetComponentInChildren <CBullet>()._ownerId   = photonView.ownerId;
        Destroy(bullet, 0.5f);
    }
예제 #2
0
 void Move()
 {
     cameraManager.IsRun = !cameraManager.IsRun;
     _anim.PlayAnimation(cameraManager.IsRun ? CAnimation.STATE.WALK : CAnimation.STATE.IDLE);
 }