void Start()
    {
        health = 30;

        anim = GetComponent <Animation>();

        bb = GameObject.FindGameObjectWithTag("Blackboard").GetComponent <Blackboard>();
        personalLastSighting = bb.resetPosition;
        previousSighting     = bb.resetPosition;

        memory = GetComponent <SenseMemory>();

        memoryPos = new Vector3(0, 0, 0);

        GameObject newTarget = Instantiate(targetPrefab, transform.position, transform.rotation) as GameObject;

        target = newTarget.transform;

        state = FSMState.Patrolling;

        wayPoints = new Vector3[patrolWayPoints.childCount];
        int c = 0;

        foreach (Transform child in patrolWayPoints)
        {
            wayPoints[c] = child.position;
            c++;
        }

        target.position = wayPoints[0];

        base.Start();
    }
예제 #2
0
    void Start()
    {
        //controller = GetComponent<AIController1>();

        sensorType = SensorType.sound;
        manager.RegisterSensor(this);

        bb           = GameObject.FindGameObjectWithTag("Blackboard").GetComponent <Blackboard>();
        memoryScript = GetComponent <SenseMemory>();
    }