// -------------------------------------------------------------------------------
        //
        // -------------------------------------------------------------------------------
        protected override void Start()
        {
            proxChecker = GetComponent <NetworkProximityChecker>();

            movementComponent = gameObject.GetComponent <EntityMovementComponent>();

            base.Start();
        }
Exemplo n.º 2
0
 // networkbehaviour ////////////////////////////////////////////////////////
 // cache components on server and clients
 protected virtual void Awake()
 {
     tr          = GetComponent <Transform>();
     agent       = GetComponent <NavMeshAgent>();
     proxchecker = GetComponent <NetworkProximityChecker>();
     anim        = GetComponent <Animator>();
     netIdentity = GetComponent <NetworkIdentity>();
 }
Exemplo n.º 3
0
 // networkbehaviour ////////////////////////////////////////////////////////
 // cache components on server and clients
 protected virtual void Awake()
 {
     agent       = GetComponent <UnityEngine.AI.NavMeshAgent>();
     proxchecker = GetComponent <NetworkProximityChecker>();
     netIdentity = GetComponent <NetworkIdentity>();
     // the collider can also be a child in case of animated entities (where
     // it sits on the pelvis for example). equipment colliders etc. aren't
     // a problem because they are added after awake in case
     collider = GetComponentInChildren <Collider>();
 }
 //LOAD COMPONENTS
 void LoadComponents()
 {
     if (!proxChecker)
     {
         proxChecker = GetComponent <NetworkProximityChecker>();
     }
     if (!movementComponent)
     {
         movementComponent = GetComponent <EntityMovementComponent>();
     }
 }