Beispiel #1
0
    private void Awake()
    {
        //Set it on
        currentState = State.on;

        //Set the fire variable
        fire = gameObject.GetComponentInChildren <ParticleSystem>();

        //Set the emission module
        emissionModuleForFire = fire.emission;

        gameManager = GameObject.Find("GameManager").GetComponent <GameManagerHandler>();
    }
Beispiel #2
0
    private void Awake()
    {
        //On awake instantiate the itemList as a list of GameObjects
        itemList = new List <GameObject>();

        //Add all the GameObjects with the tag item to the itemList
        itemList.AddRange(GameObject.FindGameObjectsWithTag("item"));

        MiddleUIInteractionHolder = GameObject.Find("interactionMiddle");

        Text = MiddleUIInteractionHolder.GetComponent <InteractionUIText>();

        GameManager = GameObject.Find("GameManager").GetComponent <GameManagerHandler>();
    }
Beispiel #3
0
    private void Awake()
    {
        //Set the player variable to the player in the scene
        player = GameObject.FindGameObjectWithTag("player");

        gameMng = GameObject.Find("GameManager").GetComponent <GameManagerHandler>();
        pathHnd = GameObject.Find("Pathfinder").GetComponent <PathfindingHandler>();

        //Set the agentRigidBody variable to the rigidbody attached to the gameobject which the handler is attached to
        agentRigidBody = gameObject.GetComponent <Rigidbody>();

        //Initialize the new behavior tree
        test = new BehaviorTree(this);

        //Add the root to the behavior tree
        test.AddRoot();

        test.DynamicAddNode(new SequenceSelector(0, "loneEvent", this), "root");

        test.DynamicAddNode(new VisionLeaf(0, "visionLone", this), "loneEvent");
        test.DynamicAddNode(new SoleInteractionLeaf(1, "loneInteraction", this), "loneEvent");

        //Add Sequence selector to handle the attack sequence
        test.DynamicAddNode(new SequenceSelector(1, "attackSequence", this), "root");

        //Attack Sequence Leaf Nodes
        test.DynamicAddNode(new VisionLeaf(0, "vision", this), "attackSequence");
        test.DynamicAddNode(new ChaseLeaf(1, "chase", this), "attackSequence");
        test.DynamicAddNode(new OpenDoorLeaf(2, "doorAttack", this), "attackSequence");
        test.DynamicAddNode(new AttackLeaf(3, "attack", this), "attackSequence");

        //Patrol Sequence
        test.DynamicAddNode(new SequenceSelector(2, "patrolSequence", this), "root");

        //Patrol Sequence Leaf Nodes
        test.DynamicAddNode(new OpenDoorLeaf(0, "doorPatrol", this), "patrolSequence");
        test.DynamicAddNode(new PatrolLeaf(1, "patrol", this), "patrolSequence");
    }
Beispiel #4
0
 private void Awake()
 {
     gameManager = GameObject.Find("GameManager").GetComponent <GameManagerHandler>();
     doOnce      = false;
 }