public void CreateHealthPickupByPos(Vector3 pos) { var exampleEntity = FpsEntityTemplates.HealthPickup(Vector3f.FromUnityVector(pos), 100); var request = new WorldCommands.CreateEntity.Request(exampleEntity); m_CommandSender.SendCreateEntityCommand(request, OnCreateEntityResponse); }
private static Snapshot GenerateDefaultSnapshot() { var snapshot = new Snapshot(); snapshot.AddEntity(FpsEntityTemplates.Spawner(Coordinates.Zero)); return(snapshot); }
private static Snapshot GenerateSessionSnapshot() { var snapshot = new Snapshot(); snapshot.AddEntity(FpsEntityTemplates.Spawner(Coordinates.Zero)); snapshot.AddEntity(FpsEntityTemplates.DeploymentState()); return(snapshot); }
private static void AddHealthPacks(Snapshot snapshot) { // Invoke our static function to create an entity template of our health pack with 100 heath. var healthPack = FpsEntityTemplates.HealthPickup(new Vector3f(5, 0, 0), 100); // Add the entity template to the snapshot. snapshot.AddEntity(healthPack); }
private static void GenerateDefaultSnapshot() { var snapshot = new Snapshot(); var spawner = FpsEntityTemplates.Spawner(); snapshot.AddEntity(spawner); var SimulatedPlayerCoordinatorTrigger = FpsEntityTemplates.SimulatedPlayerCoordinatorTrigger(); snapshot.AddEntity(SimulatedPlayerCoordinatorTrigger); SaveSnapshot(snapshot); }
private static void GenerateFpsSnapshot() { var localSnapshot = new Snapshot(); var cloudSnapshot = new Snapshot(); GenerateSnapshot(localSnapshot); GenerateSnapshot(cloudSnapshot); // The local snapshot is identical to the cloud snapshot, but also includes a simulated player coordinator // trigger. var simulatedPlayerCoordinatorTrigger = FpsEntityTemplates.SimulatedPlayerCoordinatorTrigger(); localSnapshot.AddEntity(simulatedPlayerCoordinatorTrigger); SaveSnapshot(DefaultSnapshotPath, localSnapshot); SaveSnapshot(CloudSnapshotPath, cloudSnapshot); }
private void OnRequestSpawnSoldier(PlayerRes.SpawnSoldier.ReceivedRequest request) { //扣除资源生成士兵,100资源一个 uint needResValue = 100; if (writer.Data.ResValue < needResValue) { return; } uint newvale = writer.Data.ResValue - needResValue; var update = new PlayerRes.Update { ResValue = new Improbable.Gdk.Core.Option <uint>(newvale) }; writer.SendUpdate(update); var exampleEntity = FpsEntityTemplates.Soldier(new Vector3f(request.Payload.X, request.Payload.Y, request.Payload.Z), entityID.Id); var request1 = new WorldCommands.CreateEntity.Request(exampleEntity); worldCommandSender.SendCreateEntityCommand(request1, OnCreateEntityResponse); }
private static void GenerateFpsSnapshot() { var localSnapshot = new Snapshot(); var cloudSnapshot = new Snapshot(); GenerateSnapshot(localSnapshot); GenerateSnapshot(cloudSnapshot); // The local snapshot is identical to the cloud snapshot, but also includes a simulated player coordinator // trigger. var simulatedPlayerCoordinatorTrigger = FpsEntityTemplates.SimulatedPlayerCoordinatorTrigger(); var polController = FpsEntityTemplates.PolControllerEntity(new Improbable.Vector3f(5, 0, 0)); cloudSnapshot.AddEntity(polController); cloudSnapshot.AddEntity(simulatedPlayerCoordinatorTrigger); AddPolEntities(cloudSnapshot, 100); localSnapshot.AddEntity(polController); AddPolEntities(localSnapshot, 100); localSnapshot.AddEntity(simulatedPlayerCoordinatorTrigger); SaveSnapshot(DefaultSnapshotPath, localSnapshot); SaveSnapshot(CloudSnapshotPath, cloudSnapshot); }
private static void GenerateSnapshot(Snapshot snapshot) { snapshot.AddEntity(FpsEntityTemplates.Spawner(Coordinates.Zero)); }
private static void GenerateSnapshot(Snapshot snapshot) { var spawner = FpsEntityTemplates.Spawner(); snapshot.AddEntity(spawner); }