示例#1
0
    // Use this for initialization
    void Start()
    {
        inTransition = false;
        int currentAct = globalVaraibleList.GetVariableState("act");

        lastAct          = 1;
        musicPlayer.loop = true;
        musicPlayer.clip = act_1;
        musicPlayer.Play();
    }
示例#2
0
    private void Update()
    {
        int nextLocation = 1;


        if (playerController.transform.position.x < worldRect.x + 0.5f)
        {
            int currentAct = globals.GetVariableState("act");
            playerController.inRoomTransition = -1;

            if (locationId == 3)
            {
                nextLocation = 2;
            }
            else if (locationId == 2)
            {
                nextLocation = 1;
            }
            else if (locationId == 1)
            {
                nextLocation = 3;
            }

            string nextScene = string.Format("location_{0}_act_{1}", nextLocation, currentAct);

            UnityEngine.SceneManagement.SceneManager.LoadScene(nextScene);
        }
        else if (playerController.transform.position.x > worldRect.x + worldRect.width - 0.5f)
        {
            int currentAct = globals.GetVariableState("act");

            playerController.inRoomTransition = 1;

            if (locationId == 3)
            {
                nextLocation = 1;
            }
            else if (locationId == 2)
            {
                nextLocation = 3;
            }
            else if (locationId == 1)
            {
                nextLocation = 2;
            }

            string nextScene = string.Format("location_{0}_act_{1}", nextLocation, currentAct);

            UnityEngine.SceneManagement.SceneManager.LoadScene(nextScene);
        }
    }
示例#3
0
 public bool ConditionMeets(string globalId, int desiredState)
 {
     return(desiredState == globalKeyItems.GetVariableState(globalId));
 }