예제 #1
0
    void Start()
    {
        spawnDelay         = spawnDelayStart;
        timeSinceLastSpawn = spawnDelayStart - 1f;

        gm = GameObject.Find("Dennis Game Manager").GetComponent <DennisGameManager> ();
    }
예제 #2
0
    void Start()
    {
        rb           = GetComponent <Rigidbody> ();
        meshRenderer = GetComponentInChildren <MeshRenderer> ();
        gm           = GameObject.Find("Dennis Game Manager").GetComponent <DennisGameManager> ();

        // Target the player's position.
        targetPos = GameObject.FindGameObjectWithTag("Player").transform.position;
        targetDir = targetPos - transform.position;
        targetDir.Normalize();
        transform.rotation = Quaternion.Euler(targetDir);
    }
예제 #3
0
    void Start()
    {
        health = maxHealth;

        noiseOffset = Random.Range(-100f, 100f);

        nextShotTime      = Random.Range(minShotTime, maxShotTime);
        timeSinceLastShot = 0.0f;

        gm = GameObject.Find("Dennis Game Manager").GetComponent <DennisGameManager> ();
        rb = GetComponent <Rigidbody> ();
    }
예제 #4
0
    void Start()
    {
        gm = GameObject.Find("Dennis Game Manager").GetComponent <DennisGameManager> ();

        timeSinceLastShot = fireRate;

        rb       = GetComponent <Rigidbody> ();
        animator = GetComponent <Animator> ();
        gunTip   = GameObject.Find("Gun Tip").transform;

        audioOn = false;
    }