Beispiel #1
0
    void Start()
    {
        playerEntity = FindObjectOfType <CubeControl> ();
        playerT      = playerEntity.transform;

        nextCampCheckTime     = timeBetweenCampingChecks + Time.time;
        campPositionOld       = playerT.position;
        playerEntity.OnDeath += OnPlayerDeath;

        map = FindObjectOfType <MapGenerator> ();
        NextWave();
    }
Beispiel #2
0
    protected override void Start()
    {
        base.Start();
        pathfinder     = GetComponent <NavMeshAgent> ();
        skinMaterial   = GetComponent <Renderer> ().material;
        originalColour = skinMaterial.color;

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

            target                = GameObject.FindGameObjectWithTag("Player").transform;
            targetEntity          = target.GetComponent <LivingEntityplayer> ();
            targetEntity.OnDeath += OnTargetDeath;

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

            StartCoroutine(UpdatePath());
        }
    }