Exemple #1
0
    public bool performAction()
    {
        switch (gameObject.name)
        {
        case "opt_StartGame":
            LoadingOverlayHandler.LoadNewScene(1);
            return(false);

        case "opt_Options":
            Animator anim = GameObject.Find("OptionsPane").GetComponent <Animator>();

            anim.SetBool("isVisible", true);
            return(true);

        case "opt_Quit":
            Application.Quit();
            return(false);

        default:
            Debug.Log("Button has no asigned action.");
            return(false);
        }
    }
    void Update()
    {
        if (!DropOff.hasPassanger && passengerNumber == -1 && !NavigationHandler.targetPosition.Equals(NextPassengerPosition))
        {
            NavigationHandler.targetPosition = NextPassengerPosition;
        }

        if (passengerNumber == passengers.Length - 1)
        {
            // Game Over
            if (!GameOverOverlay.GameIsOver)
            {
                GameOverOverlay.Score      = PointSystem.score;
                GameOverOverlay.GameIsOver = true;

                timeFromWin = Time.time;
            }
            else if (Time.time - timeFromWin > InputConstants.MENU_ACTION_DELAY && !LoadingOverlayHandler.IsLoading && (Input.GetKeyDown(KeyCode.E)))
            {
                Debug.Log("Going to Main Menu");
                LoadingOverlayHandler.LoadNewScene(0);
            }
        }
    }