Beispiel #1
0
        void Start()
        {
            roomLoader = GameManager.Instance.GetRoomLoader();

            LivingEntity playerEntity = GameManager.Instance.GetPlayerController();

            player = playerEntity.transform;

            playerEntity.OnDeath += OnPlayerDeath;

            nextCampCheckTime = timeBetweenCampingChecks + Time.time;
            prevCampPosition  = player.position;

            currentWaveNumber = startingWaveNumber - 1;
            NextWave();
        }
Beispiel #2
0
        void Awake()
        {
            totalEntities += 1;

            pathfinder = GetComponent <NavMeshAgent>();

            GameObject targetObject
                = GameManager.Instance.GetPlayerController().gameObject;

            if (targetObject != null)
            {
                hasTarget = true;

                target       = targetObject.transform;
                targetEntity = target.GetComponent <LivingEntity>();
            }
            else
            {
                hasTarget = false;
            }
        }
Beispiel #3
0
        void Awake()
        {
            pathfinder     = GetComponent <NavMeshAgent>();
            sharedMaterial = GetComponent <Renderer>().sharedMaterial;

            GameObject targetObject = GameObject.FindGameObjectWithTag("Player");

            if (targetObject != null)
            {
                hasTarget = true;

                target       = targetObject.transform;
                targetEntity = target.GetComponent <LivingEntity>();

                myCollisionRadius     = GetComponent <CapsuleCollider>().radius;
                targetCollisionRadius = target.GetComponent <CapsuleCollider>().radius;
            }
            else
            {
                hasTarget = false;
            }
        }