/// <summary> /// Create an action where the Old Man stands in place /// </summary> /// <param name="priority">How important the action is</param> /// <param name="name">The name of this action</param> /// <param name="standLength">How long the stand lasts for, x lessthan/= 0 for infinite</param> /// <param name="standPoint">The Vector3 to stand at. If null is passed in then there is no movement</param> /// <param name="discardTime">The amount of time this action can spend in the queue without being discarded. 0 for infinite.</param> public void AddStandStillAction(float priority, string name, float standLength = 0, Vector3?standPoint = null, Sprite thoughtItem = null, float discardTime = 0) { OM_Action_StandStill action = new OM_Action_StandStill(priority, name, standLength, standPoint, thoughtItem, discardTime); OM_ActionQueue.Enqueue(action, action.Priority); }
//Called before Start() void Awake() { OM_ActionQueue = new SimplePriorityQueue <OM_Action>(); actionsToRemove = new List <OM_Action>(); //There is always in infinite standStill action at the bottom of the queue OM_Action_StandStill defaultAction = new OM_Action_StandStill(float.MaxValue, "DefaultStandStill"); OM_ActionQueue.Enqueue(defaultAction, defaultAction.Priority); levelFile.SetupLevel(); }