Exemple #1
0
    void Update()
    {
        if (levelName != "" && CheckDistance())
        {
            // Player cannot interact with other things while walking through Door.
            if (Input.GetKeyDown(KeyCode.Space) && !pc.frozen)
            {
                // Door sound effect.
                if (GetComponent <AudioSource>() != null)
                {
                    GetComponent <AudioSource>().Play();
                }

                // Update lastSceneName and player's new destination; fade out for transition.
                gm.lastSceneName = gm.currentSceneName;
                pc.destination   = levelName;
                if (transition)
                {
                    tc.Transition(pc.destination);
                }
                else
                {
                    sf.EndScene(pc.destination);
                }
            }
        }
    }
    public void ChangeClass(bool isNext)
    {
        if (CanClick)
        {
            CanClick    = false;
            ActivePanel = isNext ? ActivePanel + 1 : ActivePanel - 1;
            ActivePanel = mod(ActivePanel, Hunters.GetLength(0));

            ActiveSkin  = 0;
            ActiveTrail = 0;

            TransCtrl.Transition();
            StartCoroutine("Switch");
            StartCoroutine("Transition");
        }
    }
 // Update is called once per frame
 void Update()
 {
     if (locMenu.activeSelf)
     {
         if (Input.GetKeyDown(KeyCode.DownArrow))
         {
             if (currentLocationNum < locations.Length - 1)
             {
                 currentLocationNum++;
                 if (locations[currentLocationNum].Equals(gm.currentSceneName))
                 {
                     currentLocationNum++;
                 }
                 DisplayLocations();
             }
         }
         else if (Input.GetKeyDown(KeyCode.UpArrow))
         {
             if (currentLocationNum == 1 && locations[0].Equals(gm.currentSceneName))
             {
             }
             else if (currentLocationNum > 0)
             {
                 currentLocationNum--;
                 if (locations[currentLocationNum].Equals(gm.currentSceneName))
                 {
                     currentLocationNum--;
                 }
                 DisplayLocations();
             }
         }
         //selecting an item and displaying options
         if (Input.GetKeyDown(KeyCode.Return))
         {
             if (currentLocationNum == locations.Length - 1)
             {
                 Close();
                 Cancel();
             }
             else
             {
                 tc.Transition(locations[currentLocationNum]);
                 Close();
             }
         }
     }
 }
Exemple #4
0
    // Update is called once per frame
    void Update()
    {
        //mom will always be to the right of the player, so no mathf.abs
        if (gameObject.transform.position.x - player.transform.position.x < hugDistance && hugged == false)
        {
            an.SetTrigger("hug");
            hugged = true;
            StartCoroutine(hidePlayer());
        }

        //check to see if she's done talking
        if (gameObject.GetComponent <NPCController>().talked&& !triggered)
        {
            Debug.Log("MOM's done talking");
            triggered = true;
            tr.Transition("partyoutside");
        }
    }
Exemple #5
0
 public void AcceptBeginning()
 {
     TransCtrl.SetHold(true);
     TransCtrl.Transition();
     StartCoroutine("AcceptEnding");
 }