Beispiel #1
0
 /// <summary>
 /// To use this please pass the node you want to use as root node to this method. It is assumed that in the scene hierarchy this node is the root node to all other NEEDSIMNodes. So if you have  a village with houses and objects in each house you should, in the scene view, make the village parent of the houses, and the houses object of the village, and each game object should have a NEEDSIMNode. You can leave the interactions set to none for the village and the houses if they are just used to calculate the abstraction for the Affordance Tree.
 /// The method BuildTreeBasedOnSceneHierarchy() that is called here will not work for intermediate objects in the hierarchy - there is only deeper search if a direct ancestor is a NEEDSIMNode.
 /// </summary>
 /// <param name="node"></param>
 public void BuildAffordanceTreeFromNode(NEEDSIMNode node)
 {
     node.AffordanceTreeNode = new AffordanceTreeNode(null, node.name, node.speciesName, node.gameObject.transform.position);
     root = node.AffordanceTreeNode;
     Simulation.Manager.Instance.Data.Root = root;
     node.BuildTreeBasedOnSceneHierarchy();
 }
Beispiel #2
0
        public PlanDemo(NEEDSIMNode agent)
        {
            ActionLibrary = new Dictionary <string, Action>();

            ActionLibrary.Add("DecideGoal", new DecideGoal(agent));
            ActionLibrary.Add("MoveToSlot", new MoveToSlot(agent));
            ActionLibrary.Add("SatisfyGoal", new SatisfyGoal(agent));
            ActionLibrary.Add("DecideValue", new DecideValue(agent));
            ActionLibrary.Add("SatisfyUrgentNeed", new SatisfyUrgentNeed(agent));
            ActionLibrary.Add("ChaseSlot", new ChaseSlot(agent));
            ActionLibrary.Add("InterruptionFuchsalarm", new InterruptionFuchsalarm(agent));

            selectedPlan = agent.selectedPlan;

            Plan = getNewPlan();
        }
        void OnEnable()
        {
            myTarget        = this.target as NEEDSIMNode;
            transform       = myTarget.transform;
            IsAgent         = serializedObject.FindProperty("isAgent");
            ShowDebug       = serializedObject.FindProperty("drawGizmosInGame");
            ModifyLookAt    = serializedObject.FindProperty("ModifyLookAt");
            SpeciesName     = serializedObject.FindProperty("speciesName");
            ShowDebugInGame = serializedObject.FindProperty("showDebugInGame");
            //ShowDebugInSpector = serializedObject.FindProperty("showDebugInInspector");
            selectedPlan = serializedObject.FindProperty("selectedPlan");
            SpecificSatisfactionLevelsAtStart = serializedObject.FindProperty("SpecificSatisfactionLevelsAtStart");

            serializedObject.Update();
            serializedObject.ApplyModifiedProperties();

            CreateOptionsBasedOnDatabase();

            lastTransformPosition = transform.position;
            lastEulerAngles       = transform.rotation.eulerAngles;
            lastScale             = transform.lossyScale;
        }
Beispiel #4
0
 public SatisfyUrgentNeed(NEEDSIMNode agent)
     : base(agent)
 {
 }
Beispiel #5
0
 public DecideGoal(NEEDSIMNode agent)
     : base(agent)
 {
 }
Beispiel #6
0
 public void AddNEEDSIMNode(NEEDSIMNode node, NEEDSIMNode parent)
 {
     node.AffordanceTreeNode = new AffordanceTreeNode(parent.AffordanceTreeNode, node.name, node.speciesName, node.gameObject.transform.position);
 }
Beispiel #7
0
 public ChaseSlot(NEEDSIMNode agent)
     : base(agent)
 {
     fox = agent.gameObject.GetComponent <NEEDSIMSampleSceneScripts.Fox>();
 }
Beispiel #8
0
 public Action(NEEDSIMNode agent)
 {
     this.agent = agent;
 }
Beispiel #9
0
 public InterruptionFuchsalarm(NEEDSIMNode agent)
     : base(agent)
 {
     scriptReference = GameObject.FindObjectOfType <NEEDSIMSampleSceneScripts.FuchsalarmDemoScript>();
 }
 public DecideClosestGoal(NEEDSIMNode agent)
     : base(agent)
 {
 }
Beispiel #11
0
 public void AddNEEDSIMNode(NEEDSIMNode node, AffordanceTreeNode parent)
 {
     node.AffordanceTreeNode = new AffordanceTreeNode(parent, node.name, node.speciesName, node.gameObject.transform.position);
     // In case you do not move NEEDSIMNodes to different gameObjects at runtime you can set the game object here. Otherwise the simplest option is to move this line to NEEDSIMNode.Update()
     node.AffordanceTreeNode.gameObject = node.gameObject;
 }
Beispiel #12
0
 public void AddNEEDSIMNode(NEEDSIMNode node, NEEDSIMNode parent)
 {
     AddNEEDSIMNode(node, parent.AffordanceTreeNode);
 }
Beispiel #13
0
 public void AddNEEDSIMNode(NEEDSIMNode node)
 {
     AddNEEDSIMNode(node, root);
 }
Beispiel #14
0
 public MoveToSlot(NEEDSIMNode agent)
     : base(agent)
 {
 }
 public SatisfyGoalWithConversations(NEEDSIMNode agent)
     : base(agent)
 {
 }
Beispiel #16
0
 public DecideClosestValue(NEEDSIMNode agent)
     : base(agent)
 {
 }
Beispiel #17
0
 public DecideValue(NEEDSIMNode agent)
     : base(agent)
 {
 }
Beispiel #18
0
 public SatisfyGoal(NEEDSIMNode agent)
     : base(agent)
 {
 }