示例#1
0
    private void Start()
    {
        playerEntity          = FindObjectOfType <Player>();
        playerT               = playerEntity.transform;
        playerEntity.OnDeath += OnPlayerDied;

        nextCampingCheckTime = timeBetweencampingChecks + Time.time;
        campPositionOld      = playerT.position;

        map = GameObject.FindObjectOfType <MapGenerator>();
        NextWave();
    }
示例#2
0
    private void Awake()
    {
        pathFinder = GetComponent <NavMeshAgent>();

        if (GameObject.FindGameObjectWithTag("Player") != null)
        {
            hasTarget = true;

            target       = GameObject.FindGameObjectWithTag("Player").transform;
            targetEntity = target.GetComponent <LeavingEntity>();


            myCollisionRadius     = GetComponent <CapsuleCollider>().radius;
            targetCollisionRadius = target.GetComponent <CapsuleCollider>().radius;
        }
    }