Beispiel #1
0
    private void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
        }
        else
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }

#if UNITY_EDITOR
        if (resetPrefs)
        {
            PlayerPrefs.DeleteAll();
        }
#endif
        Instantiate(saveManager);
        Instantiate(levelManager);
        Instantiate(menu);

        lm  = FindObjectOfType <LevelManager>();
        sm  = FindObjectOfType <SaveManager>();
        gmc = FindObjectOfType <GameMenuController>();
    }
 // Use this for initialization
 void Start()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
    bool winMenuOpened = false; // Quick and dirty solution.

    void Awake()
    {
        gameTime           = GameObject.Find("Sun and Moon").GetComponent <DayNightCycle>();
        gameMenu           = GameObject.Find("Canvas").GetComponent <GameMenuController>();
        mapGenerator       = GetComponent <MapGenerator>();
        playerBuilder      = GetComponent <PlayerBuilder>();
        environmentBuilder = GetComponent <EnvironmentBuilder>();
    }
 public void PutButton()
 {
     if (pictures.Count > 0)
     {
         GameMenuController.SetPic(pictures[currentPic]);
     }
     InterfaceController.OpenMenu("GameMenu");
 }
Beispiel #5
0
 void Start()
 {
     NetworkServer.Listen(7000);
     NetworkServer.RegisterHandler(888, ServerReceiveMessage);
     gameController     = GetComponent <GameController>();
     gameMenuController = GetComponent <GameMenuController>();
     GetPlayerHexIP(1);
 }
Beispiel #6
0
    // Use this for initialization
    public override void Start()
    {
        base.Start();
        myRigidbody = GetComponent <Rigidbody2D> ();                    //arxikopoihsh

        respawnPoint       = transform.position;                        //pare thn arxikh thesh tou player
        gameLevelManager   = FindObjectOfType <LevelManager>();         //init to antikeimeno ths klashs gamelevelmanager
        gameMenuController = FindObjectOfType <GameMenuController>();   //init to antikeimeno ths klashs gameMenuController
    }
Beispiel #7
0
 private void Awake()
 {
     SoundManager.instance.StopMusic();
     gold     = 0;
     instance = this;
     SplashScript.splashShown = true;
     if (PlayerPrefsManager.GetHiddenMenu())
     {
         finishGameButton.gameObject.SetActive(value: true);
         finishGameButton.transform.localScale = Vector3.one;
     }
 }
Beispiel #8
0
        private void Start()
        {
            _pool    = new Pool(_gameSettings);
            _spawner = new Spawner(_spawnPoints);
            PoolManager.SetPool(_pool);

            _gameMenuController = GetComponent <GameMenuController>();
            _barHolder          = GetComponent <HealthBarHolder>();
            _player             = GameObject.FindWithTag("Player");
            _player.GetComponent <PlayerDamageController>().SetGameController(this);

            StartCoroutine(_spawner.SpawnWorker());
        }
Beispiel #9
0
    private void InitializeGame()
    {
        gameMenuController    = GameObject.Find("UI").GetComponent <GameMenuController>();
        currentLevel          = lastComplitedLevel = PlayerPrefs.GetInt("Geometry_LastLevel", 1);
        currentLevelText.text = "Level " + currentLevel.ToString();

        if (instance == null)
        {
            instance = this;
        }
        levelTaskSpritesList = gameController.CreateSpritesList(currentLevel);
        StartCoroutine(StartLevel());
    }
Beispiel #10
0
    private void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
        }
        else
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }

        lm = FindObjectOfType <LevelManager>();
        sm = FindObjectOfType <SaveManager>();
    }
        public Presenter(GameMenuController menu, IFighting _process)
        {
            this._process = _process;
            this._menu    = menu;

            _players.Add(new PlayerController(_process.Player1, Resources.Fighter1));
            _players.Add(new PlayerController(_process.Player2, Resources.Fighter2));

            _players[0].SetViewPosition(-168);
            _players[1].SetViewPosition(168);

            SuscribeMenu();
            SuscribePlayers();

            _process.StartGame();
        }
Beispiel #12
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Cоздаем все главные елементы в одном месте и соединяем их
            StartForm start = new StartForm();

            start.ShowDialog();

            // Управляющий класс для окна с логом, оно же будет
            // выступать как основа приложения
            GameMenuController menu = new GameMenuController();
            Logic game = new Logic(new Player(Settings.Default.Name), new CPUPlayer());

            // Управляющий класс для всего приложения
            Presenter presenter = new Presenter(menu, game);

            Application.Run(menu.MenuForm);
        }
Beispiel #13
0
        void Awake()
        {
            instance      = this;
            this._gridMap = GameObject.FindGameObjectWithTag("GridMap").gameObject;
            GameController.FindOrCreate();
            GameMenuController.FindOrCreate();
            GameController.instance.PrepareNextLevel();
            GameMenuController.instance.fade.PlayFadeToMin();
            this._explosionPosition = new Vector3(GridMap.instance.columns * 0.5f, 0.5f, GridMap.instance.rows * 0.5f);
            this._explosionRadius   = (GridMap.instance.rows * GridMap.instance.columns);

            this._warningTexture            = ((GameObject)Instantiate(ResourceManager.instance.warningTexture) as GameObject).GetComponent <GUITexture>();
            this._warningTexture.pixelInset = new Rect(0.0f, 0.0f, GlobalInfo.ScreenWidth, GlobalInfo.ScreenHeight);
            this.warningColor          = new Color(0.8f, 0.1f, 0.1f, 0.0f);
            this._warningTexture.color = this.warningColor;

            this.gameObject.AddComponent <GridAudio>();

#if UNITY_IPHONE || UNITY_ANDROID
            this.transform.gameObject.AddComponent <SwipeInput>();
            this._swipeController = this.transform.GetComponent <SwipeInput>() as SwipeInput;
#endif
        }
Beispiel #14
0
 private void Start()
 {
     GameMenuCtrl = FindObjectOfType <GameMenuController>();
     SetActiveChara(JobIndex);
 }
Beispiel #15
0
 private void Awake()
 {
     Instance = this;
 }
 void Awake()
 {
     instance = this;
 }
Beispiel #17
0
 private void Start()
 {
     GameMenuController = FindObjectOfType <GameMenuController>();
 }
 private void Awake()
 {
     _menuController = GameObject.Find("GlobalScriptsText").GetComponent <GameMenuController>();
 }