Exemplo n.º 1
0
 public void Resume()
 {
     GamePanel.SetActive(true);
     PausePanel.SetActive(false);
     GameOverPanel.SetActive(false);
     TimeScaleChange(1);
 }
 private void Awake()
 {
     _player  = FindObjectOfType <PlayerController>();
     _pause   = FindObjectOfType <PausePanel>();
     _rotator = FindObjectOfType <Rotator>();
     _cam     = Camera.main;
 }
Exemplo n.º 3
0
 private void Awake()
 {
     StartCoroutine(OnGameWasOpened());
     DontDestroyOnLoad(this);
     Background              = new Background();
     MainMenu                = new UI.PanelMain();
     Pause                   = new PausePanel();
     PauseWindow             = new PauseWindow();
     ProfilePanel            = new ProfilePanel();
     SinglePanel             = new SinglePanel();
     ServerList              = new ServerListPanel();
     SettingsPanel           = new SettingsPanel();
     DebugPanel              = new DebugPanel();
     CharacterSelectionPanel = new CharacterSelectionPanel();
     Chat = new Chat();
     Log  = new Log();
     DontDestroyOnLoad(new GameObject("DiscordManager").AddComponent <Network.Discord.DiscordManager>());
     DestroyMainScene();
     GameModes.ResetOnLoad();
     //Antis.Spam.EventsCounter.OnEventsSpamDetected += (sender, args) =>
     //{
     //    if(args.SpammedObject == 200 || args.SpammedObject == 253 && args.Count < 130)
     //    {
     //        return;
     //    }
     //    PhotonPlayer player = PhotonPlayer.Find(args.Sender);
     //    if (player.RCIgnored)
     //    {
     //        return;
     //    }
     //    Log.AddLine("eventSpam", args.SpammedObject.ToString(), args.Sender.ToString(), args.Count.ToString());
     //};
     //Antis.Spam.RPCCounter.OnRPCSpamDetected += (sender, args) =>
     //{
     //    if(args.SpammedObject == "netPauseAnimation" || args.SpammedObject == "netCrossFade" && args.Count < 75)
     //    {
     //        return;
     //    }
     //    PhotonPlayer player = PhotonPlayer.Find(args.Sender);
     //    if (player.RCIgnored)
     //    {
     //        return;
     //    }
     //    Log.AddLine("rpcSpam", args.SpammedObject.ToString(), args.Sender.ToString(), args.Count.ToString());
     //};
     //Antis.Spam.InstantiateCounter.OnInstantiateSpamDetected += (sender, args) =>
     //{
     //    if (args.SpammedObject.Contains("TITAN") && args.Count <= 50)
     //    {
     //        return;
     //    }
     //    PhotonPlayer player = PhotonPlayer.Find(args.Sender);
     //    if (player.RCIgnored)
     //    {
     //        return;
     //    }
     //    Log.AddLine("instantiateSpam", args.SpammedObject.ToString(), args.Sender.ToString(), args.Count.ToString());
     //};
     Network.BanList.Load();
 }
Exemplo n.º 4
0
    void PauseAction(PointerEventData data)
    {
        GameObject pausePanel = Get <GameObject>((int)GameObjects.PausePanel);

        pausePanel.SetActive(true);
        Time.timeScale = 0;

        PausePanel pauseScript = pausePanel.GetOrAddComponent <PausePanel>();


        /* //1. GameObject item 보류
         * GameObject itemPanel = Get<GameObject>((int) GameObjects.ItemPanel);
         * foreach (Transform child in itemPanel.transform)
         * {
         *  Managers.Resource.Destroy(child.gameObject);
         * }
         *
         * GameObject _pauseItem = Managers.UI.MakeSubItem<PausePanel>(itemPanel.transform).gameObject;
         * _pauseItem.transform.SetParent(itemPanel.transform);
         * Time.timeScale = 0;
         */

        /*Debug.Log($"itemPanel Pos : {itemPanel.transform.position}");
         * Debug.Log($"_pauseItem Pos : {_pauseItem.transform.position}");
         * _pauseItem.transform.position = new Vector3(0, 0, 0);
         * itemPanel.transform.position = new Vector3(0, 0, 0);*/
        //_pauseItem.SetActive(true);

        //PausePanel pauseScript = pauseItem.GetOrAddComponent<PausePanel>();
    }
Exemplo n.º 5
0
 public override void Init(params object[] args)
 {
     base.Init(args);
     layer    = PanelLayer.Panel;
     instance = this;
     ResMusicPanel();
 }
Exemplo n.º 6
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Exemplo n.º 7
0
    // Use this for initialization


    void Awake() {
        if (instance != null && instance != this) {
            // If that is the case, we destroy other instances
            Destroy(gameObject);
        }
        if (instance == null) {
            instance = this;
            mainPanel = transform.Find("MainPanel").gameObject;
            settingsPanel = transform.Find("Settings").gameObject;
            controlsPanel = transform.Find("ControlsPanel").gameObject;
            menuConfirmPanel = transform.Find("MenuConfirm").gameObject;
            desktopConfirmPanel = transform.Find("DesktopConfirm").gameObject;
            background = transform.Find("Background").gameObject;

            resumeButton = transform.Find("MainPanel/ResumeButton").GetComponent<UnityEngine.UI.Button>();
            settingsButton = transform.Find("MainPanel/SettingsButton").GetComponent<UnityEngine.UI.Button>();
            controlsButton = transform.Find("MainPanel/ControlsButton").GetComponent<UnityEngine.UI.Button>();
            menuButton = transform.Find("MainPanel/MenuButton").GetComponent<UnityEngine.UI.Button>();
            quitButton = transform.Find("MainPanel/QuitButton").GetComponent<UnityEngine.UI.Button>();

            settingsBackButton = transform.Find("Settings/BackButton").GetComponent<UnityEngine.UI.Button>();
            controlsBackButton = transform.Find("ControlsPanel/BackButton").GetComponent<UnityEngine.UI.Button>();
            /*
            controlsKeyboardButton = transform.Find("ControlsPanel/KeyboardButton").GetComponent<UnityEngine.UI.Button>();
            controlsPadButton = transform.Find("ControlsPanel/PadButton").GetComponent<UnityEngine.UI.Button>();
            */

        }
    }
Exemplo n.º 8
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var arcanoidMainForm = new ArcanoidMainForm();
            var mainPanel        = new MainPanel();
            var pausePanel       = new PausePanel();
            var gamePanel        = new GamePanel();

            var controlViewsModel = new ControlViewsModel();
            var gameModel         = new GameModel();

            controlViewsModel.AddControl(NameControlEnum.MainForm, arcanoidMainForm);
            controlViewsModel.AddControl(NameControlEnum.GameInterface, gamePanel);
            controlViewsModel.AddControl(NameControlEnum.PauseInterface, pausePanel);
            controlViewsModel.AddControl(NameControlEnum.MainInterface, mainPanel);

            var mainIntefacePresetner   = new MainInterfacePresenter(mainPanel, controlViewsModel, gameModel);
            var pauseInterfacePresenter = new PauseInterfacePresenter(pausePanel, controlViewsModel, gameModel);
            var gameInterfacePresenter  = new GameInterfacePresenter(gamePanel, controlViewsModel, gameModel);

            arcanoidMainForm.Controls.Add(mainPanel);

            Application.Run(arcanoidMainForm);
        }
Exemplo n.º 9
0
        public void Ctor(IReactiveProperty <EnumBattleWindow> battleState)
        {
            base.Ctor();
            LevelGeneratorPanel.Ctor();
            FightPanel.Ctor();
            VictoryPanel.Ctor();
            PausePanel.Ctor();
            FailPanel.Ctor();

            _battleState = battleState;

            _battleState.Subscribe(_ =>
            {
                if (!enabled)
                {
                    return;
                }
                if (_battleState.Value == EnumBattleWindow.DungeonGenerator)
                {
                    LevelGeneratorPanel.Show();
                }
                else
                {
                    LevelGeneratorPanel.Hide();
                }
                if (_battleState.Value == EnumBattleWindow.Fight)
                {
                    FightPanel.Show();
                }
                else
                {
                    FightPanel.Hide();
                }
                if (_battleState.Value == EnumBattleWindow.Victory)
                {
                    VictoryPanel.Show();
                }
                else
                {
                    VictoryPanel.Hide();
                }
                if (_battleState.Value == EnumBattleWindow.Fail)
                {
                    FailPanel.Show();
                }
                else
                {
                    FailPanel.Hide();
                }
                if (_battleState.Value == EnumBattleWindow.Pause)
                {
                    PausePanel.Show();
                }
                else
                {
                    PausePanel.Hide();
                }
            }).AddTo(_subscriptions);
        }
Exemplo n.º 10
0
 public void Instructions()
 {
     gameObject.SetActive(false);
     InstructionsPanel.SetActive(true);
     MainMenuPanel.SetActive(false);
     PausePanel.SetActive(false);
     Console.WriteLine("Instructions menu controller");
 }
Exemplo n.º 11
0
 public void PauseClick(BaseEventData data)
 {
     if (!Play)
         return;
     Time.timeScale = 0;
     Play = false;
     PausePanel.SetActive(true);
 }
Exemplo n.º 12
0
 public override void Awake(object param1 = null, object param2 = null, object param3 = null)
 {
     m_PausePanel = m_GameObject.GetComponent <PausePanel>();
     AddButtonClickListener(m_PausePanel.m_Back, () =>
     {
         UIManager.Instance.PopUpWnd(PathCollections.UI_In_GameSreen);
         //TODO ·µ»ØÕ½¶·½çÃæ
     });
 }
Exemplo n.º 13
0
 private void Awake()
 {
     state = GameState.GamePlay;
     GameOverPanel.SetActive(false);
     PausePanel.SetActive(false);
     GamePlayPanel.SetActive(true);
     points = time = 0;
     InvokeRepeating("Time", 1f, 1f);
 }
Exemplo n.º 14
0
 public void Pause(bool state)
 {
     GamePanel.SetActive(!state);
     PausePanel.SetActive(state);
     Loco.Pause(state);
     if (Paused != null)
     {
         Paused(state);
     }
 }
Exemplo n.º 15
0
 public static PausePanel Instance()
 {
     if (!_modalPanel)
     {
         _modalPanel = FindObjectOfType(typeof (PausePanel)) as PausePanel;
         if (!_modalPanel)
             Debug.LogError ("There needs to be one active ModalPanel script on a GameObject in your scene.");
     }
     return _modalPanel;
 }
Exemplo n.º 16
0
 public void StartGame()
 {
     gameObject.SetActive(true);
     MainMenuPanel.SetActive(false);
     PausePanel.SetActive(false);
     GameSettingsPanel1.SetActive(false);
     GameSettingsPanel2.SetActive(false);
     GameController.Instance.state = eState.GAME;
     Console.WriteLine("Start Game menu controller");
 }
Exemplo n.º 17
0
 public void BackToMainMenu()
 {
     ScorePanel.SetActive(false);
     InfoPanel.SetActive(false);
     WinnerPanel.SetActive(false);
     PausePanel.SetActive(false);
     MenuCam.CameraMode = 1;
     OpenMainMenu();
     Main.PrepareBackground();
 }
Exemplo n.º 18
0
 public void PausePanelCtrl(bool Paused)
 {
     if (Paused)
     {
         PausePanel.SetActive(true);
     }
     else
     {
         PausePanel.SetActive(false);
     }
 }
Exemplo n.º 19
0
 public void UnPause()
 {
     pause = false;
     PausePanel.SetActive(false);
     Objects.Player.enabled = true;
     for (int i = 0; i < Objects.Spawner.Length; i++)
     {
         Objects.Spawner[i].enabled = true;
     }
     enemy.WakeUpAll();
 }
Exemplo n.º 20
0
    IEnumerator GameOver()
    {
        PausePanel.SetActive(false);
        DeathPanel.SetActive(true);
        IsGameOver = true;
        Player.GetComponent <Rigidbody>().constraints = RigidbodyConstraints.None;
        speed = 0;


        yield break;
    }
Exemplo n.º 21
0
 public void ExitToMenuClick()
 {
     Time.timeScale = 1;
     DestroyObjects();
     PausePanel.SetActive(false);
     MenuCanvas.SetActive(true);
     HUDCanvas.SetActive(false);
     LostPanel.SetActive(false);
     Player.SetActive(false);
     Generator.SetActive(false);
 }
Exemplo n.º 22
0
 public void MainMenu()
 {
     SpeedUp = true;
     GameSpeed();
     PausePanel.SetActive(false);
     Canvas.SetActive(false);
     PauseButton.GetComponent <Image>().sprite = Pause1;
     Paused = false;
     GameOverPanel.SetActive(false);
     UnityEngine.SceneManagement.SceneManager.LoadScene("MainMenu");
 }
Exemplo n.º 23
0
 //Back to main menu
 public void BackToMenu()
 {
     //gameObject.SetActive(false);
     MainMenuPanel.SetActive(true);
     PausePanel.SetActive(false);
     OptionsPanel.SetActive(false);
     CreditsPanel.SetActive(false);
     InstructionsPanel.SetActive(false);
     GameOverPanel.SetActive(false);
     GameController.Instance.state = eState.TITLE;
     Console.WriteLine("BacktoMenu menu controller");
 }
Exemplo n.º 24
0
 void Awake()
 {
     titlePanel          = GetComponentInChildren <TitlePanel> (true);
     selectMapPanel      = GetComponentInChildren <SelectMapPanel> (true);
     settingPanel        = GetComponentInChildren <SettingPanel> (true);
     addMapPanel         = GetComponentInChildren <AddMapPanel> (true);
     loadingMapPanel     = GetComponentInChildren <LoadingMapPanel> (true);
     pausePanel          = GetComponentInChildren <PausePanel> (true);
     titleBackPanel      = GetComponentInChildren <TitleBackPanel> (true);
     unsupportedMapPanel = GetComponentInChildren <UnsupportedMapPanel> (true);
     deleteMapPanel      = GetComponentInChildren <DeleteMapPanel> (true);
 }
Exemplo n.º 25
0
    public static PausePanel Instance()
    {
        if (!pausePanel)
        {
            pausePanel = FindObjectOfType(typeof(PausePanel)) as PausePanel;
            if (!pausePanel)
            {
                Debug.LogError("There needs to be one active gameOverPanel script on a GameObject in your scene.");
            }
        }

        return(pausePanel);
    }
Exemplo n.º 26
0
 public void ShowPausePanel(bool y)
 {
     if (y)
     {
         PausePanel.SetActive(true);
         StopAndPlay();
     }
     else
     {
         PausePanel.SetActive(false);
         StopAndPlay();
     }
 }
Exemplo n.º 27
0
    // Start is called before the first frame update
    void Start()
    {
        gameState  = GameState.instance;
        controller = GameState.instance.controller;

        SelectedEnemyPanel.SetActive(false);
        SelectedWorkerPanel.SetActive(false);
        SelectedBuildingPanel.SetActive(false);
        PausePanel.SetActive(false);
        BuildDescriptionPanel.SetActive(false);
        BuildPanel.SetActive(true);
        RessourcePanel.SetActive(true);
    }
Exemplo n.º 28
0
 public void Pause()
 {
     if (GameController.Instance.state == eState.GAME)
     {
         PausePanel.SetActive(true);
         MainMenuPanel.SetActive(false);
         OptionsPanel.SetActive(false);
         CreditsPanel.SetActive(false);
         InstructionsPanel.SetActive(false);
         GameOverPanel.SetActive(false);
         GameController.Instance.state = eState.PAUSE;
     }
 }
Exemplo n.º 29
0
	void Init(){
		mainPanel =  GameObjectTools.GetComponentInChildren <MainPanel> (gameObject);
		playPanel = GameObjectTools.GetComponentInChildren<PlayPanel> (gameObject);
		pausePanel = GameObjectTools.GetComponentInChildren<PausePanel> (gameObject);
		gameOverPanel = GameObjectTools.GetComponentInChildren<GameOverPanel> (gameObject);

		mainPanel.gameObject.SetActive (true);
		playPanel.gameObject.SetActive (false);
		pausePanel.gameObject.SetActive (false);
		gameOverPanel.gameObject.SetActive (false);

		mainPanel.Init ();
		playPanel.Init ();
		pausePanel.Init ();
		gameOverPanel.Init ();
	}
Exemplo n.º 30
0
    public void GameOverSettings()
    {
        state = GameState.GameOver;
        GameOverPanel.SetActive(true);
        GamePlayPanel.SetActive(false);
        PausePanel.SetActive(false);
        CancelInvoke("Time");
        finalTimeText.text = "" + time;
        MeteorsManager.Instance.CancelMeteorsInvoke();
        if (time > PlayerPrefs.GetInt("RecordTime"))
        {
            SaveRecord(time);
        }

        recordText.text = "" + PlayerPrefs.GetInt("RecordTime");
    }
Exemplo n.º 31
0
    void Init()
    {
        mainPanel     = GameObjectTools.GetComponentInChildren <MainPanel> (gameObject);
        playPanel     = GameObjectTools.GetComponentInChildren <PlayPanel> (gameObject);
        pausePanel    = GameObjectTools.GetComponentInChildren <PausePanel> (gameObject);
        gameOverPanel = GameObjectTools.GetComponentInChildren <GameOverPanel> (gameObject);

        mainPanel.gameObject.SetActive(true);
        playPanel.gameObject.SetActive(false);
        pausePanel.gameObject.SetActive(false);
        gameOverPanel.gameObject.SetActive(false);

        mainPanel.Init();
        playPanel.Init();
        pausePanel.Init();
        gameOverPanel.Init();
    }
Exemplo n.º 32
0
 public void PauseGame()
 {
     if (!Paused)
     {
         Time.timeScale = 0;
         PauseButton.GetComponent <Image>().sprite = Pause2;
         PausePanel.SetActive(true);
         Paused = true;
     }
     else if (Paused)
     {
         SpeedUp = true;
         GameSpeed();
         PauseButton.GetComponent <Image>().sprite = Pause1;
         PausePanel.SetActive(false);
         Paused = false;
     }
 }
Exemplo n.º 33
0
    public void GameOver()
    {
        GamePanel.SetActive(false);
        PausePanel.SetActive(false);
        GameOverPanel.SetActive(true);
        TimeScaleChange(0);
        PlayerPrefs.SetInt("kacKereOynandi", (PlayerPrefs.GetInt("kacKereOynandi", 0) + 1));
        PlayerPrefs.SetInt("energyValue", (PlayerPrefs.GetInt("energyValue") - 1));
        energyGameOverText.text = PlayerPrefs.GetInt("energyValue").ToString();
        TryAgainButtonInteractable();
        PlayerPrefs.SetInt("money", player.GetComponent <Player> ().money);
        int kayitliScore = PlayerPrefs.GetInt("bestScore", 0);

        if (player.GetComponent <Player> ().score > kayitliScore)
        {
            PlayerPrefs.SetInt("bestScore", player.GetComponent <Player> ().score);
        }
        if (PlayerPrefs.GetInt("kacKereOynandi") % 3 == 1)
        {
            ShowAd();
        }
    }
Exemplo n.º 34
0
    void Start()
    {
        Time.timeScale = 1;
        //1. Loading should appear
        //2. Get value from StatisticsManager
        //3. Set the values for Path
        //4. Give the  values to PathGenerator Class
        //5. Activate the interface before battle
        //5. End

        //Instantiate MyMap
        myGeneratedMap = Instantiate(myMap, Vector3.zero, Quaternion.identity) as Transform;
        myGeneratedMap.gameObject.name = "MyMap";

        //Create OffenseHeadquaters
        Transform OHQ = Instantiate(OffenseHQ, transform.position, Quaternion.identity) as Transform;
        OHQ.name = "OffenseHeadQuaters";

        BeforeBattle(false);
        InBattle(false);
        rank = StatisticsManager.SM.GetDetails("Player_Rank");
        currentRankProps = rankProps[rank - 1];
        generator = myGeneratedMap.gameObject.GetComponent<PathGenerator>();
        generator.OnPercentChange += UpdatePercentValue;
        generator.SetValuesAndGenerate(currentRankProps);
        spawnPosition = generator.spawnPointPosition;
        gateBroken = false;

        //Get referece to all Windows
        resultPanel = GameResultPanel.Instance();
        pausePanel = PausePanel.Instance();

        //Set Up all Actions
        SetAllActions();
    }
Exemplo n.º 35
0
 private void Awake()
 {
     Instance = this;
 }
Exemplo n.º 36
0
    // Load the scene and activate the appropriate interface
    public override void OnSceneLoaded()
    {
        Debug.Log("OnSceneLoaded");

        base.OnSceneLoaded ();

        _lettersColorPause = MainActivity.Instance.lettersColorPause;
        _buttonPause = MainActivity.Instance.buttonPause;
        _triggerPause  = MainActivity.Instance.triggerPause;
        _buttonPause.SetActive(true);
        _triggerPause.SetActive(true);

        _digitTopScore = MainActivity.Instance.digitTopScore;
        _digitTopScoreShadow = MainActivity.Instance.digitTopScoreShadow;
        _digitTopScore.SetActive(true);
        _digitTopScoreShadow.SetActive(true);

        _digitScore = MainActivity.Instance.digitScore;
        _digitScoreShadow = MainActivity.Instance.digitScoreShadow;
        _digitScore.SetActive(true);
        _digitScoreShadow.SetActive(true);

        _digitLevel = MainActivity.Instance.digitLevel;
        _digitLevelShadow = MainActivity.Instance.digitLevelShadow;
        _digitLevel.SetActive(true);
        _digitLevelShadow.SetActive(true);

        _digitLines = MainActivity.Instance.digitLines;
        _digitLinesShadow = MainActivity.Instance.digitLinesShadow;
        _digitLines.SetActive(true);
        _digitLinesShadow.SetActive(true);

        _spawn = MainActivity.Instance.spawn;
        _spawn.SetActive(true);

        _pauseManager = MainActivity.Instance.pauseManager;
        _pauseManager.SetActive(true);
        _pausePanel = PausePanel.Instance();

        _gameOverManager = MainActivity.Instance.gameOverManager;
        _gameOverManager.SetActive(true);
        _gameOverPanel = GameOverPanel.Instance();

        _topScoreManager = MainActivity.Instance.topScoreManager;
        _topScoreManager.SetActive(true);
        _topScorePanel = TopScorePanel.Instance();// Top Score Panel

        _cube = MainActivity.Instance.cube;

        /** Audio variable*/
        _boom = MainActivity.Instance.boom;
        _disappearance = MainActivity.Instance.disappearance;
        /** end */

        Start ();
    }