Inheritance: MonoBehaviour
    void Start()
    {
        startTime = Time.time;
        wait      = Random.Range(4.0f, 10.0f);

        launcher = GetComponentInChildren <AALauncher>();
        laserAim = GetComponentInChildren <LaserAim>();
    }
Beispiel #2
0
        void Start()
        {
            startTime = Time.time;
            wait      = Random.Range(minWaitTime, maxWaitTime);

            launcher        = GetComponentInChildren <AALauncher>();
            launchTransform = launcher.GetComponent <Transform>();

            laserAim = GetComponentInChildren <LaserAim>();
        }
Beispiel #3
0
    private void Start()
    {
        animator     = GetComponentInChildren <Animator>();
        myHitEffects = GetComponent <MyHitEffects>();
        laserAim     = GetComponentInChildren <LaserAim>();

        currentAmmo = maxAmmo;

        //Time at which AI can start shooting.
        startTime = Time.time;
        // A random time at which AI can start shooting.
        wait = Random.Range(3.0f, 10.0f);

        //Attaches an audio source if its already on the gameobject, if not, then it creates one.
        if (!audio)
        {
            audio = this.GetComponent <AudioSource> ();
            if (!audio)
            {
                this.gameObject.AddComponent <AudioSource>();
            }
        }
    }