//[command] void CmdSpawnBullet() { int id = m_gMan.GetNextBulletID(); Transform m_bulletSpawnPoint = m_playerPlane.m_bulletSpawnPoint; Vector3 m_bulletVelocity = m_bulletSpawnPoint.forward.normalized; m_bulletVelocity *= WeaponController.m_bulletSpeed; m_bulletVelocity += m_playerPlane.GetComponent <Rigidbody>().velocity; BulletInfo aBulletInfo = new BulletInfo(m_bulletSpawnPoint.position, m_bulletSpawnPoint.forward.normalized, NetId, m_bulletVelocity, id); GameObject bullet = WeaponController.SpawnBullet(aBulletInfo); m_gMan.AddBulletInfo(aBulletInfo); SendProjectileStart(BombersNetworkManager.BULLET, aBulletInfo.GetDict()); }
public void BulletHitPlayerCommand(BulletInfo bulletInfo, Vector3 aHitPoint) { BombersPlayerController tempController; foreach (LobbyMemberInfo member in BombersNetworkManager.LobbyInfo.Members) { tempController = member.PlayerController; if (tempController.NetId == bulletInfo.m_hitId) { bulletInfo.m_startPosition = tempController.m_playerPlane.transform.position + aHitPoint; SendProjectileStart(BombersNetworkManager.BULLET_HIT, bulletInfo.GetDict()); m_gMan.RpcBulletHitPlayer(bulletInfo); break; } } }
void DeleteBullet(BulletInfo in_info) { m_gMan.DeleteBullet(in_info); //SendDestroy(BombersNetworkManager.BULLET, in_info.m_bulletID.ToString(), in_info.GetJson()); SendProjectileDestroy(BombersNetworkManager.BULLET, in_info.GetDict()); }