예제 #1
0
    public void ClickNext()
    {
        GameLord gameLordInstance = GameLord.Instance;

        if (gameLordInstance != null)
        {
            gameLordInstance.NextLevel();
        }
    }
예제 #2
0
    public void ClickMenu()
    {
        GameLord gameLordInstance = GameLord.Instance;

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

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

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

        if (GameManager.OnGameStateChanged != null)
        {
            GameManager.OnGameStateChanged(_currentGameState);
        }
    }
예제 #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;
        }
    }
예제 #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( );
    }
예제 #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;
        }
    }
예제 #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( )); });
    }
예제 #9
0
파일: GameLord.cs 프로젝트: Ret44/SGJ16
    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();
    }
예제 #10
0
 private void InitHudController()
 {
     _gameLord = GameLord.Instance;
     _hudLord = HudLord.Instance;
 }
예제 #11
0
 public void Start()
 {
     audioSource = GetComponent <AudioSource>();
     gameLord    = GameObject.Find("GameLord").GetComponent <GameLord>();
 }
예제 #12
0
파일: GameManager.cs 프로젝트: Ret44/SGJ16
 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;
     }
 }
예제 #13
0
파일: GameLord.cs 프로젝트: Ret44/SGJ16
    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();
    }
예제 #14
0
 private void InitHudController()
 {
     _gameLord = GameLord.Instance;
     _hudLord  = HudLord.Instance;
 }