Beispiel #1
0
    void OnLevelWasLoaded()
    {
        Debug.Log("loaded");

        if (SceneManager.GetActiveScene().name == "Level 1")
        {
            dm               = GameObject.Find("Dialogue").GetComponent <DialogueManager>();
            spySlider        = GameObject.Find("SpySlider").GetComponent <Slider>();
            loveSlider       = GameObject.Find("LoveSlider").GetComponent <Slider>();
            player           = GameObject.Find("Player");
            playerController = player.GetComponent <PlayerController>();

            endingCode = "succeedSpy";

            rhythmUI     = GameObject.Find("RhythmUI").GetComponent <RhythmUI>();
            questionMark = GameObject.Find("QuestionMark").GetComponent <QuestionMark>();
            romanceMusic = GameObject.Find("RomanceMusic").GetComponent <AudioSource>();
            spyMusic     = GameObject.Find("SpyMusic").GetComponent <AudioSource>();

            DontDestroyOnLoad(GameObject.Find("RomanceMusic"));
            DontDestroyOnLoad(GameObject.Find("SpyMusic"));

            audio = GameObject.Find("RhythmUI").GetComponent <AudioSource>();

            clucks1 = (AudioClip)Resources.Load("Audio/SFX/clucks1");
            clucks2 = (AudioClip)Resources.Load("Audio/SFX/clucks2");
            squawk1 = (AudioClip)Resources.Load("Audio/SFX/squawk1");
            squawk2 = (AudioClip)Resources.Load("Audio/SFX/squawk2");

            thisGM.Start();
        }
    }
Beispiel #2
0
 public override void Update(GameTime gameTime)
 {
     base.Update(gameTime);
     if (PatrollingSprite != null)
     {
         PatrollingSprite.Update(gameTime);
         //Adjust beam position based on current animation (state)
         AdjustPatrollBeamPosition();
     }
     if (QuestionMark != null)
     {
         QuestionMark.Update(gameTime);
         AdjustQuestionMarkPosition();
     }
 }
Beispiel #3
0
 private void SetActive()
 {
     Gen.SetActive(true);
     Laurence.SetActive(true);
     Wen.SetActive(true);
     Wally.SetActive(true);
     Yu.SetActive(true);
     QuestionMark.SetActive(true);
     ExclamationMark.SetActive(true);
     LaurenceMark.SetActive(true);
     TBoundary.SetActive(true);
     TColor.SetActive(true);
     S1Boundary.SetActive(true);
     S1Color.SetActive(true);
     S2Boundary.SetActive(true);
     S2Color.SetActive(true);
 }
Beispiel #4
0
        private void DoFadingOut()
        {
            float duration = 1.5f;

            Wally.GetComponent <Image>().CrossFadeAlpha(0, duration, false);
            Gen.GetComponent <Image>().CrossFadeAlpha(0, duration, false);
            Laurence.GetComponent <Image>().CrossFadeAlpha(0, duration, false);
            Yu.GetComponent <Image>().CrossFadeAlpha(0, duration, false);
            Wen.GetComponent <Image>().CrossFadeAlpha(0, duration, false);
            QuestionMark.GetComponent <Image>().CrossFadeAlpha(0, duration, false);
            ExclamationMark.GetComponent <Image>().CrossFadeAlpha(0, duration, false);
            LaurenceMark.GetComponent <Image>().CrossFadeAlpha(0, duration, false);
            TBoundary.GetComponent <Image>().CrossFadeAlpha(0, duration, false);
            TColor.GetComponent <Image>().CrossFadeAlpha(0, duration, false);
            S1Boundary.GetComponent <Image>().CrossFadeAlpha(0, duration, false);
            S1Color.GetComponent <Image>().CrossFadeAlpha(0, duration, false);
            S2Boundary.GetComponent <Image>().CrossFadeAlpha(0, duration, false);
            S2Color.GetComponent <Image>().CrossFadeAlpha(0, duration, false);
            Destroy();
        }
Beispiel #5
0
    void HeadToReceptionist()
    {
        MoveTo sn = gameObject.GetComponent <MoveTo>();

        sn.DataDetails.SetMoveToString("Receptionist");
        sn.DataDetails.SetDialogueAction(EventManager.DialogueAction.Hello);
        sn.DataDetails.SetDialogueAction(EventManager.DialogueAction.CheckIn);
        sn.DataDetails.SetDialogueAction(EventManager.DialogueAction.Accepted);
        sn.DataDetails.SetDialogueAction(EventManager.DialogueAction.Denied);
        sn.DataDetails.SetDialogueAction(EventManager.DialogueAction.GetKey);
        sn.enabled = true;

        //Turn on Guests Scripts
        ThoughtBubbles scriptThoughtBubbles = gameObject.GetComponentInChildren <ThoughtBubbles>();

        if (scriptThoughtBubbles != null)
        {
            CheckIn scriptcheckin = scriptThoughtBubbles.GetComponentInChildren <CheckIn>();
            if (scriptcheckin != null)
            {
                scriptcheckin.enabled = true;
            }
        }

        //Turn on Receptionist Scripts
        GameObject[] AllReceptionists = GameObject.FindGameObjectsWithTag("Receptionist");

        int whichPedIndex = 0;

        for (int i = 0; i < AllReceptionists.Length - 1; i++)
        {
            //Checks for choosing a receptionist,
            whichPedIndex = i;
            i             = AllReceptionists.Length;
        }

        GameObject     TheReceptionist            = AllReceptionists[whichPedIndex];
        ThoughtBubbles ReceptionistThoughtBubbles = TheReceptionist.GetComponentInChildren <ThoughtBubbles>();

        if (ReceptionistThoughtBubbles != null)
        {
            QuestionMark scriptQuestion = ReceptionistThoughtBubbles.GetComponentInChildren <QuestionMark>();
            if (scriptQuestion != null)
            {
                scriptQuestion.enabled = true;
            }

            if (_cash > _checkinCost)
            {
                Success scriptSuccess = ReceptionistThoughtBubbles.GetComponentInChildren <Success>();
                if (scriptSuccess != null)
                {
                    scriptSuccess.enabled = true;
                }
            }
            else
            {
                Failure scriptSuccess = ReceptionistThoughtBubbles.GetComponentInChildren <Failure>();
                if (scriptSuccess != null)
                {
                    scriptSuccess.enabled = true;
                }
            }
        }
    }
Beispiel #6
0
 public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
 {
     base.Draw(gameTime, spriteBatch);
     PatrollingSprite?.Draw(gameTime, spriteBatch);
     QuestionMark?.Draw(gameTime, spriteBatch);
 }