예제 #1
0
    void Start()
    {
        width           = 10;
        height          = 10;
        animationScript = GetComponent <g_AIAnimationScript>();
        FindClosestPlayer();
        attackTarget = closestPlayer;
        ActionFunctionsDict.Add(AIAction.ActionState.Spawn, Spawn);

        ActionFunctionsDict.Add(AIAction.ActionState.Idle, Idle);
        ActionFunctionsDict.Add(AIAction.ActionState.Runforward, RunForward);
        ActionFunctionsDict.Add(AIAction.ActionState.Melee, Melee);
        ActionFunctionsDict.Add(AIAction.ActionState.TakeDamage, TakeDamage);
        ActionFunctionsDict.Add(AIAction.ActionState.Animation, Animation);
        ActionFunctionsDict.Add(AIAction.ActionState.WalkForward, WalkForward);
        ActionFunctionsDict.Add(AIAction.ActionState.Roar, Roar);
        ActionFunctionsDict.Add(AIAction.ActionState.Taunt, Taunt);
        ActionFunctionsDict.Add(AIAction.ActionState.WalkLeft, WalkLeft);
        ActionFunctionsDict.Add(AIAction.ActionState.WalkRight, WalkRight);
        ActionFunctionsDict.Add(AIAction.ActionState.MoveLeft, MoveLeft);
        ActionFunctionsDict.Add(AIAction.ActionState.MoveRight, MoveRight);
        ActionFunctionsDict.Add(AIAction.ActionState.FireArrow, FireArrow);
        ActionFunctionsDict.Add(AIAction.ActionState.Patrol, Patrol);

        aIBehavior.Initialize();
        currentState = aIBehavior.StatesDict[aIBehavior.firstState];
        SetupCurrentActionFunc();
        currentState.SetActionTime();
    }
예제 #2
0
 void Start()
 {
     behaviourScript = GetComponent <g_AIBehaviourScript>();
     animationScript = GetComponent <g_AIAnimationScript>();
     gunScript       = GetComponent <g_AIGunScript>();
     soundScript     = GetComponent <g_AISoundScript>();
     coverScript     = GetComponent <g_AISetCoverNode>();
     rotateScript    = GetComponent <g_AIRotateToTarget>();
     navmesh         = GetComponent <NavMeshAgent>();
     dissolveScript  = GetComponent <CustomDissolve>();
     meleeScript     = GetComponent <G_AIMeleeScript>();
     maxHealth       = health;
 }
예제 #3
0
 // Use this for initialization
 void Start()
 {
     navMesh         = GetComponent <NavMeshAgent> ();
     animationScript = GetComponent <g_AIAnimationScript> ();
     gunScript       = GetComponent <g_AIGunScript> ();
     soundScript     = GetComponent <g_AISoundScript>();
     player          = GameObject.Find("Player");
     for (int i = 0; i < Actions.Count; i++)
     {
         Actions[i].Setup();
         if (Actions[i].action == AIAction.ActionStates.crouch)
         {
             GetComponent <g_AISetCoverNode>().SetUpCoverNodes();
             GetComponent <g_AISetCoverNode>().FindCloseCover();
         }
     }
 }