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); }
void Move() { cameraManager.IsRun = !cameraManager.IsRun; _anim.PlayAnimation(cameraManager.IsRun ? CAnimation.STATE.WALK : CAnimation.STATE.IDLE); }