示例#1
0
        void Awake()
        {
            //Set default values, calculate squared distances, etc.
            LOSLayermask = TacticalAI.ControllerScript.currentController.GetLayerMask();

            if (!audioSource && bulletSpawn)
            {
                if (bulletSpawn.gameObject.GetComponent <AudioSource>())
                {
                    audioSource = bulletSpawn.gameObject.GetComponent <AudioSource>();
                }
            }

            if (gameObject.GetComponent <SoundScript>())
            {
                soundScript = gameObject.GetComponent <SoundScript>();
            }

            if (!grenadeSpawn)
            {
                grenadeSpawn = bulletSpawn;
            }
            isFiring  = false;
            isWaiting = false;
            currentBulletsUntilReload = bulletsUntilReload;
            timeBetweenBurstBullets   = 1 / burstFireRate;
            timeBetweenBursts         = 1 / rateOfFire;
            minBurstsPerVolley        = (int)(minRoundsPerVolley / shotsPerBurst);
            maxBurstsPerVolley        = (int)(maxRoundsPerVolley / shotsPerBurst);
            maxFiringAngle           /= 2;
            maxSecondaryFireAngle    /= 2;
            minimumDistToFireGun      = minimumDistToFireGun * minimumDistToFireGun;
            maximumDistToFireGun      = maximumDistToFireGun * maximumDistToFireGun;
        }
示例#2
0
 //Initiation stuff.
 void Awake()
 {
     soundScript = gameObject.GetComponent <TacticalAI.SoundScript>();
     if (shields < 0)
     {
         shields = 0.1f;
     }
     maxShields = shields;
 }
示例#3
0
        public virtual void Initiate()
        {
            if (gameObject.GetComponent <TacticalAI.BaseScript>())
            {
                baseScript = gameObject.GetComponent <TacticalAI.BaseScript>();

                gunScript            = baseScript.gunScript;
                soundScript          = baseScript.audioScript;
                rotateToAimGunScript = baseScript.headLookScript;
                animationScript      = baseScript.animationScript;
                coverFinderScript    = baseScript.coverFinderScript;
                myTransform          = baseScript.GetTranform();

                layerMask = TacticalAI.ControllerScript.currentController.GetLayerMask();

                navI = baseScript.GetAgent();
            }
        }