Ejemplo n.º 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();
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 4
0
 public SatisfyUrgentNeed(NEEDSIMNode agent)
     : base(agent)
 {
 }
Ejemplo n.º 5
0
 public DecideGoal(NEEDSIMNode agent)
     : base(agent)
 {
 }
Ejemplo n.º 6
0
 public void AddNEEDSIMNode(NEEDSIMNode node, NEEDSIMNode parent)
 {
     node.AffordanceTreeNode = new AffordanceTreeNode(parent.AffordanceTreeNode, node.name, node.speciesName, node.gameObject.transform.position);
 }
Ejemplo n.º 7
0
 public ChaseSlot(NEEDSIMNode agent)
     : base(agent)
 {
     fox = agent.gameObject.GetComponent <NEEDSIMSampleSceneScripts.Fox>();
 }
Ejemplo n.º 8
0
 public Action(NEEDSIMNode agent)
 {
     this.agent = agent;
 }
Ejemplo n.º 9
0
 public InterruptionFuchsalarm(NEEDSIMNode agent)
     : base(agent)
 {
     scriptReference = GameObject.FindObjectOfType <NEEDSIMSampleSceneScripts.FuchsalarmDemoScript>();
 }
Ejemplo n.º 10
0
 public DecideClosestGoal(NEEDSIMNode agent)
     : base(agent)
 {
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 12
0
 public void AddNEEDSIMNode(NEEDSIMNode node, NEEDSIMNode parent)
 {
     AddNEEDSIMNode(node, parent.AffordanceTreeNode);
 }
Ejemplo n.º 13
0
 public void AddNEEDSIMNode(NEEDSIMNode node)
 {
     AddNEEDSIMNode(node, root);
 }
Ejemplo n.º 14
0
 public MoveToSlot(NEEDSIMNode agent)
     : base(agent)
 {
 }
 public SatisfyGoalWithConversations(NEEDSIMNode agent)
     : base(agent)
 {
 }
Ejemplo n.º 16
0
 public DecideClosestValue(NEEDSIMNode agent)
     : base(agent)
 {
 }
Ejemplo n.º 17
0
 public DecideValue(NEEDSIMNode agent)
     : base(agent)
 {
 }
Ejemplo n.º 18
0
 public SatisfyGoal(NEEDSIMNode agent)
     : base(agent)
 {
 }