// Use this for initialization
	void Start () 
    {
        enemyState = ENEMY_STATE.PATROL;
        puppet = GetComponent<PuppetScript>();
        player = GameObject.FindGameObjectWithTag("Player");
        noticeArea = gameObject.GetComponent<SphereCollider>();
        behaviourTree = gameObject.GetComponent<BehaviourTree>();
        behaviourTree.FuckYouUnity(); 
        foreach (GameObject patrolPoint in patrolPoints)
        {
            behaviourTree.AddBehaviour(new AIBehaviour(AI_STATE.PATROL, patrolPoint.transform.position, 0.0f));    
        }
        if(patrolPoints.Length == 0)
        {
            behaviourTree.AddBehaviour(new AIBehaviour(AI_STATE.PATROL, gameObject.transform.position, 0.0f));
        }
    }
Esempio n. 2
0
	// Use this for initialization
	void Start () 
    {
        puppet = gameObject.GetComponent<PuppetScript>();
        behaviourTree = gameObject.GetComponent<BehaviourTree>();
        switch (trainerType)
        {
            case TRAINER_TYPE.ATTACK_TOP:
                behaviourTree.AddBehaviour(new AIBehaviour(AI_STATE.SLASH_TOP));
                break;
            case TRAINER_TYPE.ATTACK_LEFT:
                behaviourTree.AddBehaviour(new AIBehaviour(AI_STATE.SLASH_LEFT));
                break;
            case TRAINER_TYPE.ATTACK_RIGHT:
                behaviourTree.AddBehaviour(new AIBehaviour(AI_STATE.SLASH_RIGHT));
                break;
            case TRAINER_TYPE.GUARD_LEFT:
                behaviourTree.AddBehaviour(new AIBehaviour(AI_STATE.GUARD_LEFT, 1.5f));
                break;
            case TRAINER_TYPE.GUARD_RIGHT:
                behaviourTree.AddBehaviour(new AIBehaviour(AI_STATE.GUARD_RIGHT, 1.5f));
                break;
            case TRAINER_TYPE.GUARD_TOP:
                behaviourTree.AddBehaviour(new AIBehaviour(AI_STATE.GUARD_TOP, 1.5f));
                break;
			case TRAINER_TYPE.IDLE:
				break;
        }

        behaviourTree.AddBehaviour(new AIBehaviour(AI_STATE.WINDOW_OF_OPPORTUNITY, 1.5f));
	}