示例#1
0
        public void StartChainedPitch(ChainPitchInfo info)
        {
            ChainedPitch newChainedPitch = new ChainedPitch(info);

            int lastLocationIndex = -1;

            for (int i = 0; i < newChainedPitch.info.NumberOfPitches; i++)
            {
                //Give it a source
                newChainedPitch.Pitches[i].PitchLocationIndex = RequestPitchLocation(newChainedPitch.info.pitchType, lastLocationIndex);
                newChainedPitch.Pitches[i].Source             = SpawnLocations[newChainedPitch.Pitches[i].PitchLocationIndex];

                //Store it for the next one
                lastLocationIndex = newChainedPitch.Pitches[i].PitchLocationIndex;

                //Find it's target
                newChainedPitch.Pitches[i].intendedTarget = suit.FindRandomLocation().gameObject;

                //Set the type of money we are pitching
                newChainedPitch.Pitches[i].TypeOfMoneyPitched = newChainedPitch.info.PitchContents[i];

                //Maybe give it an intended arc height?
                //Perhaps the air time?

                RunningPossibleScore += HeistManager.Inst.GetMonetaryValue(newChainedPitch.info.PitchContents[i]);
            }

            StartCoroutine(InitiateChainedPitch(newChainedPitch));
        }
示例#2
0
        private void PlayChainedPitchSFX(ChainedPitch chainedPitch)
        {
            AudioClip SFX = chainedPitch.info.GetRandomSFX();

            if (SFX != null)
            {
                AudioManager.Inst.MakeSource(SFX, chainedPitch.GetSFXLocation()).Play();
            }
        }
示例#3
0
        IEnumerator InitiateChainedPitch(ChainedPitch chainedPitch)
        {
            //Debug.Log("Starting chained pitch\n");
            //Play the audio clip.
            //PlayChainedPitchSFX(chainedPitch);

            //multiPitch.info.pitchSFXNames
            WaitForSeconds waitTime = new WaitForSeconds(chainedPitch.info.StartDelay);

            yield return(waitTime);

            for (int i = 0; i < chainedPitch.info.NumberOfPitches; i++)
            {
                //Pitch this one
                chainedPitch.Pitches[i] = PerformPitch(chainedPitch.Pitches[i]);

                //multiPitch.Pitches[i];
                if (i < chainedPitch.info.delayBetweenPitches.Length)
                {
                    yield return(new WaitForSeconds(chainedPitch.info.delayBetweenPitches[i]));
                }
            }
        }
示例#4
0
 public void StartChainedPitch(ChainedPitch pitches)
 {
     StartCoroutine(InitiateChainedPitch(pitches));
 }