Esempio n. 1
0
    public void ClickNext()
    {
        GameLord gameLordInstance = GameLord.Instance;

        if (gameLordInstance != null)
        {
            gameLordInstance.NextLevel();
        }
    }
Esempio n. 2
0
    public void ClickMenu()
    {
        GameLord gameLordInstance = GameLord.Instance;

        if (gameLordInstance != null)
        {
            gameLordInstance.BackToMenu();
        }
    }
Esempio n. 3
0
    public void ClickPlayLevel(int index)
    {
        GameLord gameLordInstance = GameLord.Instance;

        if (gameLordInstance != null)
        {
            gameLordInstance.LoadLevel(index);
        }
    }
Esempio n. 4
0
    private void NotifyOnGameStateChanged()
    {
        GameLord gameLordInstance = GameLord.Instance;

        if (gameLordInstance != null)
        {
            gameLordInstance.UpdateTimeScale();
        }

        if (GameManager.OnGameStateChanged != null)
        {
            GameManager.OnGameStateChanged(_currentGameState);
        }
    }
Esempio n. 5
0
    protected override void Awake()
    {
        base.Awake();
        GameLord instance = GameLord.Instance;

        if (instance != null)
        {
        }
        GUILord guiLord = GUILord.Instance;

        if (guiLord != null)
        {
            _referenceResolution = guiLord.ReferenceResolution;
        }
    }
Esempio n. 6
0
    void Awake()
    {
        instance = this;
        DontDestroyOnLoad(gameObject);
        Cursor.visible = false;

        // Tell Oculus to use roomscale
        if (UnityEngine.XR.XRDevice.isPresent)
        {
            if (debug)
            {
                Debug.Log("UnityEngine.XR.XRDevice.model: " + UnityEngine.XR.XRDevice.model);
            }
            if (UnityEngine.XR.XRDevice.model == "Oculus Rift CV1")
            {
                if (debug)
                {
                    Debug.Log("in roomscale set");
                }
                UnityEngine.XR.XRDevice.SetTrackingSpaceType(UnityEngine.XR.TrackingSpaceType.RoomScale);
            }
        }

        Scene   = Scene.Init;
        loading = Loading.Default;

        string model = UnityEngine.XR.XRDevice.model != null ? UnityEngine.XR.XRDevice.model : "";

        if (model.IndexOf("Rift") >= 0)
        {
            deviceType = DeviceType.Oculus;
        }
        else
        {
            deviceType = DeviceType.Vive;
        }

        blackoutLength = 2.0f;
        blackoutTimer  = blackoutLength;

        InitPlayer( );
        InitMusicLord( );
        InitOpponentLord( );
        InitScenes( );
    }
Esempio n. 7
0
    private void InitializeGameLord()
    {
        _currentPlayerData = PlayerData.Load();

        _instance = this;

        UnityEngine.SceneManagement.Scene activeScene = UnityEngine.SceneManagement.SceneManager.GetActiveScene();
        _currentSceneName = activeScene.name;
        if (_currentSceneName == sceneName_start)
        {
            _currentGameState = GameState.GS_MENU;
            _currentSceneName = "";
        }
        else
        {
            _currentGameState = GameState.GS_GAME;
        }
    }
Esempio n. 8
0
    private void Start( )
    {
        instance      = this;
        textWait      = 6.0f;
        opponentCount = 30;
        Ddebug        = false;

        timer     = timerDur;
        GameState = GameStates.Default;

        text.text = "PINATA BIRTHDAY GIRL!";

        InitPlayer( );
        InitOpponentLord( );
        InitCam( );
        Instantiate(environmentPrefab, Vector3.zero, Quaternion.identity);

        // Start game in a few seconds.
        CoHelp.Instance.DoWhen(textWait / 2.0f, delegate { StartCoroutine(GameLoop( )); });
    }
Esempio n. 9
0
    private void InitializeGameLord()
    {
        GameLord._instance = this;

        _currentTransitionState = TransitionState.TS_NONE;
        _targetGameState        = AppState.AS_NONE;

        string loadedSceneName = SceneManager.GetActiveScene().name;

        if (loadedSceneName == startSceneName)
        {
            _currentGameState = AppState.AS_MENU;
        }
        else
        {
            bool foundAny = false;
            for (int i = 0; i < _sceneNameCount; ++i)
            {
                //Debug.LogWarningFormat("Check \"{0}\" with \"{1}\"", _sceneNames[i], loadedSceneName);
                if (_sceneNames[i] == loadedSceneName)
                {
                    foundAny           = true;
                    _currentLevelIndex = i;
                    ChangeGameState(AppState.AS_GAME, true);
                    break;
                }
            }
            if (!foundAny)
            {
                _currentGameState = AppState.AS_NONE;
                Debug.LogErrorFormat("Scene {0} not added to GameLord!!!", loadedSceneName);
            }
        }

        for (int i = 0; i < _stateCount; ++i)
        {
            _stateInfos[i].panelGO.SetActive(_stateInfos[i].state == _currentGameState);
        }

        UpdateTimeScale();
    }
Esempio n. 10
0
 private void InitHudController()
 {
     _gameLord = GameLord.Instance;
     _hudLord = HudLord.Instance;
 }
Esempio n. 11
0
 public void Start()
 {
     audioSource = GetComponent <AudioSource>();
     gameLord    = GameObject.Find("GameLord").GetComponent <GameLord>();
 }
Esempio n. 12
0
 private void HandleAppState(GameLord.AppState appState)
 {
     switch(appState)
     {
         case GameLord.AppState.AS_GAME:
             ChangeGameState(GameState.GS_GAME);
             ResetGame();
             break;
         default:
             ChangeGameState(GameState.GS_NONE);
             break;
     }
 }
Esempio n. 13
0
    private void InitializeGameLord()
    {
        GameLord._instance = this;

        _currentTransitionState = TransitionState.TS_NONE;
        _targetGameState = AppState.AS_NONE;

        string loadedSceneName = SceneManager.GetActiveScene().name;
        if(loadedSceneName == startSceneName)
        {
            _currentGameState = AppState.AS_MENU;
        } else {
            bool foundAny = false;
            for(int i = 0;i < _sceneNameCount;++i)
            {
                //Debug.LogWarningFormat("Check \"{0}\" with \"{1}\"", _sceneNames[i], loadedSceneName);
                if(_sceneNames[i] == loadedSceneName)
                {
                    foundAny = true;
                    _currentLevelIndex = i;
                    ChangeGameState(AppState.AS_GAME,true);
                    break;
                }
            }
            if(!foundAny)
            {
                _currentGameState = AppState.AS_NONE;
                Debug.LogErrorFormat("Scene {0} not added to GameLord!!!", loadedSceneName);
            }
        }

        for(int i = 0;i < _stateCount;++i)
        {
            _stateInfos[i].panelGO.SetActive(_stateInfos[i].state == _currentGameState);
        }

        UpdateTimeScale();
    }
Esempio n. 14
0
 private void InitHudController()
 {
     _gameLord = GameLord.Instance;
     _hudLord  = HudLord.Instance;
 }