//Actors and Sensors private void LoadData() { simulator = new Simulator(modelItems); //modelItems-Liste wird an Simulator übergeben foreach (var item in simulator.Items) //enthält die generierten Demo-Daten aus dem Simulator { if (item.ItemType.Equals(typeof(ISensor))) { SensorList.Add(item); } else if (item.ItemType.Equals(typeof(IActuator))) { ActorList.Add(item); } } }
private void LoadData() { Simulator sim = new Simulator(modelItems); foreach (var item in sim.Items) { if (item.ItemType.Equals(typeof(ISensor))) { SensorList.Add(item); } else if (item.ItemType.Equals(typeof(IActuator))) { ActorList.Add(item); } } }
public void GenerateData() { sim = new Simulator(ModelList); foreach (var item in sim.Items) { if (item.ItemType.Equals(typeof(ISensor))) { SensorList.Add(item); } else if (item.ItemType.Equals(typeof(IActuator))) { ActorList.Add(item); } } }
//DemoDaten laden private void LoadData() { Simulator sim = new Simulator(modelItems); //ueberpruefen ob Sensor oder Actor und zu Liste hinzufuegen foreach (var item in sim.Items) { if (item.ItemType.Equals(typeof(ISensor))) { SensorList.Add(item); } else if (item.ItemType.Equals(typeof(IActuator))) { ActorList.Add(item); } } }
public void AddEntity(IStoryEntityObject obj) { if (obj == null) { return; } if ((obj as IActor) != null) { ActorList.Add(obj as IActor); return; } if ((obj as IEvent) != null) { EventList.Add(obj as IEvent); return; } if ((obj as IStuff) != null) { StuffList.Add(obj as IStuff); return; } if ((obj as IGroup) != null) { GroupList.Add(obj as IGroup); return; } if ((obj as ITask) != null) { TaskList.Add(obj as ITask); return; } if ((obj as ILocation) != null) { LocationList.Add(obj as ILocation); return; } }
protected void AddPartyToActorListNew() { foreach (PartyMember activePartyMember in SingletonBehavior <PartyManager> .Instance.GetActivePartyMembers()) { int absoluteFormationIndex = SingletonBehavior <PartyManager> .Instance.GetAbsoluteFormationIndex(activePartyMember); if (absoluteFormationIndex >= 5) { Debug.Log($"AddPartyToActorList: {activePartyMember.name} {absoluteFormationIndex}"); } if (!(activePartyMember == null)) { if (activePartyMember.IsSecondaryPartyMember()) { if (AnimalCompanionsFollowOwner && activePartyMember.PartyMemberData.MemberType == PartyMemberType.AnimalCompanion) { AIBehavior behavior = AIBehaviorManager.AllocateFollowBehavior(); activePartyMember.AIController.BehaviorStack.PushBehavior(behavior); } } else { var gameObject = activePartyMember.gameObject; if (!activePartyMember.IsPrimaryPartyMember()) { activePartyMember.AIController.IgnoreAsCutsceneObstacle = true; } if (ActiveShot.UsePartyStartLocation && ActiveShot.PartyStartLocation != null) { if (ActiveShot.PartyStartLocation.Waypoints.Length - 1 < absoluteFormationIndex) { Array.Resize(ref ActiveShot.PartyStartLocation.Waypoints, absoluteFormationIndex + 1); } if (ActiveShot.PartyStartLocation.Waypoints[absoluteFormationIndex] == null) { ActiveShot.PartyStartLocation.Waypoints[absoluteFormationIndex] = new GameObject(); var neighbor = ActiveShot.PartyStartLocation.Waypoints[absoluteFormationIndex - 1] ?? ActiveShot.PartyStartLocation.Waypoints[0]; var position = neighbor.transform.position + Vector3.right; var rotation = neighbor.transform.rotation; ActiveShot.PartyStartLocation.Waypoints[absoluteFormationIndex].transform.SetPositionAndRotation(position, rotation); } var cutsceneWaypoint = new CutsceneWaypoint(); cutsceneWaypoint.owner = gameObject; cutsceneWaypoint.MoveType = MovementType.Teleport; cutsceneWaypoint.TeleportVFX = null; cutsceneWaypoint.Location = ActiveShot.PartyStartLocation.Waypoints[absoluteFormationIndex].transform; SpawnWaypointList.Add(cutsceneWaypoint); } if (ActiveShot.UsePartyMoveLocation && ActiveShot.PartyMoveLocation != null) { if (ActiveShot.PartyMoveLocation.Waypoints.Length - 1 < absoluteFormationIndex) { Array.Resize(ref ActiveShot.PartyMoveLocation.Waypoints, absoluteFormationIndex + 1); } if (ActiveShot.PartyMoveLocation.Waypoints[absoluteFormationIndex] == null) { ActiveShot.PartyMoveLocation.Waypoints[absoluteFormationIndex] = new GameObject(); var neighbor = ActiveShot.PartyMoveLocation.Waypoints[absoluteFormationIndex - 1] ?? ActiveShot.PartyMoveLocation.Waypoints[0]; var position = neighbor.transform.position + Vector3.right; var rotation = neighbor.transform.rotation; ActiveShot.PartyMoveLocation.Waypoints[absoluteFormationIndex].transform.SetPositionAndRotation(position, rotation); } var cutsceneWaypoint = new CutsceneWaypoint(); cutsceneWaypoint.owner = gameObject; cutsceneWaypoint.MoveType = MovementType.Teleport; cutsceneWaypoint.TeleportVFX = null; cutsceneWaypoint.Location = ActiveShot.PartyMoveLocation.Waypoints[absoluteFormationIndex].transform; SpawnWaypointList.Add(cutsceneWaypoint); } if (!ActorList.Contains(gameObject)) { ActorList.Add(gameObject); } } } } }