protected Node ST_SelectStory(StoryID id) { switch (id) { case StoryID.mainstoryarc: Node SelectmainStory = new SelectorParallel( new DecoratorInvert(new DecoratorLoop(new DecoratorInvert(new LeafAssert(() => currentStoryID != id)))), this.ST_MainStoryArc()); return(SelectmainStory); case StoryID.freeAdam1: Node SelectfreeAdam1 = new SelectorParallel( new DecoratorInvert(new DecoratorLoop(new DecoratorInvert(new LeafAssert(() => currentStoryID != id)))), this.ST_freeAdam1()); return(SelectfreeAdam1); default: return(null); } }
public override bool Equals(object obj) { if (obj is SimpleStory) { return(StoryID.Equals(((SimpleStory)obj).StoryID)); } return(false); }
protected Node ST_CheckfreeAdam1Arc() { Node checkfreeAdam1arc = new Sequence( new LeafAssert(() => adam1Freed), new LeafInvoke(() => currentStoryID = StoryID.freeAdam1) ); return(checkfreeAdam1arc); }
protected Node ST_CheckMainStoryArc() { Node checkmainarc = new Sequence( new LeafAssert(() => !adam1Freed), new LeafInvoke(() => currentStoryID = StoryID.mainstoryarc) ); return(checkmainarc); }
// Use this for initialization void Start() { participants = findBAgent(); Behavior = new BehaviorEvent((Token toke) => this.BuildTreeRoot(), this.participants); //participants = findBAcrowd(); //Crowd = new CrowdBehaviorEvent<AdamBehaviorTree>((AdamBehaviorTree tree, object token)=>this.BuildTreeRoot(),this.participants); currentStoryID = StoryID.mainstoryarc; adam1Freed = false; }
// Update is called once per frame void Update() { eventstatus = Behavior.Status; //eventstatus = Crowd.Status; if (Input.GetKeyDown(KeyCode.E)) { Behavior.StartEvent(1f); //Crowd.StartEvent(1f); } if (Input.GetKeyDown(KeyCode.Q) && eventstatus == EventStatus.Running) { adam1Freed = true; Behavior.Drop(adam1.GetComponent <AdamBehaviorTree>().Object); //Crowd.Drop(adam1.GetComponent<AdamBehaviorTree>().Object); } if (eventstatus == EventStatus.Finished) { adam1Freed = false; currentStoryID = StoryID.mainstoryarc; } }
public override int GetHashCode() { return(StoryID.GetHashCode()); }