Play() public method

Play sound source of given audio clip
public Play ( AudioClip audioClip, float fadeTime = 0f, Transform parent = null, Vector3 position = default(Vector3) ) : SoundSource
audioClip UnityEngine.AudioClip
fadeTime float
parent UnityEngine.Transform
position UnityEngine.Vector3
return SoundSource
Esempio n. 1
0
        private IEnumerator RunTutorial()
        {
            ObjectiveTracker ot        = UIManager.GetMenu <ObjectiveTracker>();
            Inventory        inventory = UIManager.GetMenu <Inventory>();
            FadeMenu         fm        = UIManager.GetMenu <FadeMenu>();
            SoundManager     sm        = GameManager.Get <SoundManager>();

            waypointManager.Huds[0].m_Target = null;
            waypointManager.Huds[1].m_Target = null;
            waypointManager.Huds[2].m_Target = null;

            const float delayTime = 4f;

            fm.Fade(5f, Color.black, Color.clear, true);
            yield return(new WaitForSeconds(3f));

            //
            //look around
            sm.Play(START_MUSIC);
            sm.Play(WIND_EFFECT);
            ShowObjective(ot, "Yes! I got it activated!");
            sm.Play(JENN_ACTIVATED);
            StartCoroutine(GlitchOut());
            yield return(new WaitForSeconds(delayTime));

            //
            //look around
            ShowObjective(ot, "Can you look around?");
            sm.Play(JENN_LOOKAROUND);

            while (Input.GetAxis("Mouse X") != 0 || Input.GetAxis("Mouse Y") != 0 || proceed)
            {
                yield return(null);
            }
            yield return(new WaitForSeconds(delayTime));

            if (fm.IsActive)
            {
                fm.Close();
            }
            //
            //See that rover
            ShowObjective(ot, "Your wheels seem a bit damaged");
            sm.Play(JENN_DAMAGEWHEELS);
            yield return(new WaitForSeconds(delayTime));

            ShowObjective(ot, "See that rover?");
            sm.Play(JENN_SEEROVER);
            waypointManager.Huds[0].m_Target = questWaypoints[0];
            yield return(new WaitForSeconds(delayTime));

            //
            //Take its wheels
            ShowObjective(ot, "Take its wheels");
            sm.Play(JENN_EQUIPWHEELS);
            yield return(new WaitForSeconds(delayTime));

            while (inventory.GetIngredientAmount(wheels) == 0)
            {
                yield return(null);
            }
            //
            //inventory
            ShowObjective(ot, "Good, now equip them from the (i)nventory");
            yield return(new WaitForSeconds(delayTime));

            while (inventory.GetIngredientAmount(wheels) != 0)
            {
                yield return(null);
            }

            //
            //Find the lift
            ShowObjective(ot, "Ok, now find the lift");
            sm.Play(JENN_FINDLIFT);
            waypointManager.Huds[0].m_Target = questWaypoints[1];
            while (!proceed)
            {
                yield return(null);
            }
            proceed = false;
            yield return(new WaitForSeconds(delayTime));

            //
            //Fix it
            ShowObjective(ot, "Console looks damaged.");
            sm.Play(JENN_CONSOLEDAMAGED);
            yield return(new WaitForSeconds(delayTime));

            //
            //get wires
            ShowObjective(ot, "You'll need wires to proceed. Try to scavenge them from that scrapped pod you passed.");
            sm.Play(JENN_SCAVENGEWIRES);
            waypointManager.Huds[0].m_Target = questWaypoints[2];
            yield return(new WaitForSeconds(delayTime));

            while (inventory.GetIngredientAmount(wires) <= 6)
            {
                yield return(null);
            }
            proceed = false;
            ///
            //fix it
            ShowObjective(ot, "Excellent, now fix the lift and ascend");
            sm.Play(JENN_FIXLIFT);
            waypointManager.Huds[0].m_Target = questWaypoints[1];
            while (!proceed)
            {
                yield return(null);
            }
            yield return(new WaitForSeconds(delayTime));

            proceed = false;
            //
            //Compliment
            ShowObjective(ot, "That's a good rover");
            waypointManager.Huds[0].m_Target = null;
            sm.Play(JENN_GOODROVER);
            yield return(new WaitForSeconds(delayTime));

            //
            //exposition
            ShowObjective(ot, "My boss told me not to power you on");
            yield return(new WaitForSeconds(delayTime));

            ShowObjective(ot, "But I need to find out what happened to my friends on the planet.");
            yield return(new WaitForSeconds(delayTime));

            StartCoroutine(RunShelfQuest());
        }
Esempio n. 2
0
        private IEnumerator RunTunnels()
        {
            ObjectiveTracker ot        = UIManager.GetMenu <ObjectiveTracker>();
            Inventory        inventory = UIManager.GetMenu <Inventory>();
            SoundManager     sm        = GameManager.Get <SoundManager>();

            const float delayTime = 4f;

            //
            //ive been waiting
            while (!proceed)
            {
                yield return(null);
            }
            sm.Play(TUNNEL_MUSIC);
            StartCoroutine(GlitchOut());
            ShowObjective(ot, "I've been waiting for you", false);
            yield return(new WaitForSeconds(delayTime));

            //
            //cant always trust
            ShowObjective(ot, "You can't always trust what the voices in your head say", false);
            yield return(new WaitForSeconds(delayTime));

            //
            //trust me
            ShowObjective(ot, "You can trust me though", false);
            yield return(new WaitForSeconds(delayTime));

            //
            //find the crystal
            ShowObjective(ot, "Find the power crystal for the teleporter", false);
            yield return(new WaitForSeconds(delayTime));

            //
            //in here somewhere
            ShowObjective(ot, "It's in here somewhere", false);
            while (!proceed)
            {
                yield return(null);
            }
            proceed = false;
            yield return(new WaitForSeconds(delayTime));

            //
            //take it
            ShowObjective(ot, "Take it, and go back to the teleporter", false);
            while (inventory.GetIngredientAmount(powerCrystal) == 0)
            {
                yield return(null);
            }
            yield return(new WaitForSeconds(delayTime));

            //
            //they are back
            ShowObjective(ot, "Looks like your human is back", false);
            yield return(new WaitForSeconds(delayTime));

            //
            //they are back
            ShowObjective(ot, "Its been lonely since I lost contact with them", false);
            yield return(new WaitForSeconds(delayTime));

            proceed = false;
            //
            //they are back
            ShowObjective(ot, "Now go back, I'll be watching", false);
            tunnelExitObjective.SetActive(true);
            yield return(new WaitForSeconds(delayTime));

            while (!proceed)
            {
                yield return(null);
            }
            proceed = false;
            //
            //you came back
            ShowObjective(ot, "You came back! and you have the power crystal");
            yield return(new WaitForSeconds(delayTime));

            //
            //you came back
            ShowObjective(ot, "I was worried when I came back and there was no signal");
            yield return(new WaitForSeconds(delayTime));

            //
            //plug it into the teleporter
            ShowObjective(ot, "Plug it into the teleporter and lets get you out of that crater.");
            while (!proceed)
            {
                yield return(null);
            }
            proceed = false;
            //
            //plug it into the teleporter
            ShowObjective(ot, "You're going to be the one to find the missing colonists");
        }