Пример #1
0
 public void Initialize(Player targetPlayer, FragmentController fragmentController)
 {
     this.targetPlayer  = targetPlayer;
     FragmentController = fragmentController;
     transform.position = targetPlayer.Position + new Vector3(UnityEngine.Random.Range(-5, 5), 0, UnityEngine.Random.Range(-5, 5));
     PathFindingAgent.Initialize(this);
 }
Пример #2
0
 void Start()
 {
     m_Rigidbody  = GetComponent <Rigidbody>();
     m_Controller = GetComponent <AeroplaneController>();
     m_NavAgent   = GetComponent <PathFindingAgent>();
     _startingPos = transform.position;
 }
Пример #3
0
    public override void Initialise(Transform[] transforms = null, PairTargets[] pteroGround = null, Transform[] pteroAir = null, Weapon[] weapons = null)
    {
        base.Initialise(transforms, pteroGround, pteroAir);

        agent      = GetComponent <PathFindingAgent>();
        controller = GetComponent <AiController>();
        agent.Init(FindObjectOfType <PathFindingGrid>());
        animator.SetBool("CanAttack", true);
        Destroy(rigidbody);
        targets = transforms;
    }
Пример #4
0
 void Start()
 {
     if (!tc)
     {
         tc = GetComponent <TankControl>();
     }
     if (!pf)
     {
         pf = GetComponent <PathFindingAgent>();
     }
     rigid = GetComponent <Rigidbody>();
     StartCoroutine(FindTargetLoop());
 }
Пример #5
0
 void Awake()
 {
     _myAnim = GetComponent <Animation>();
     _agent  = GetComponent <PathFindingAgent>();
 }