public void Add(BaseAIEvent aiEvent) { if (events.Contains(aiEvent)) { Debug.LogWarning("Attempting to add duplicate AI event: " + aiEvent.EventType); return; } aiEvent.Reset(); events.Add(aiEvent); }
public void Init(ProtoBuf.AIStateContainer container, BaseEntity owner) { ID = container.id; State = (AIState)container.state; InputMemorySlot = container.inputMemorySlot; Events = new List <BaseAIEvent>(); if (container.events == null) { return; } foreach (AIEventData @event in container.events) { BaseAIEvent baseAIEvent = BaseAIEvent.CreateEvent((AIEventType)@event.eventType); baseAIEvent.Init(@event, owner); baseAIEvent.Reset(); Events.Add(baseAIEvent); } }