コード例 #1
0
    void Start()
    {
        playerEntity = FindObjectOfType <CubeControl> ();
        playerT      = playerEntity.transform;

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

        map = FindObjectOfType <MapGenerator> ();
        NextWave();
    }
コード例 #2
0
ファイル: Enemy.cs プロジェクト: Rajatnewatia/Simple_Maze_Run
    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());
        }
    }