Inheritance: MonoBehaviour
Beispiel #1
0
        public override void Initialize()
        {
            base.Initialize();

            int floor_pos_y = this.GetWindowHeight() - 128;

            IceBackground background = new IceBackground(new Vector2(0, -800));

            this.AddEntity(background);

            IcePlatform platform = new IcePlatform(new Vector2(0, floor_pos_y));

            this.AddEntity(platform);

            MenuPenguin penguin = new MenuPenguin(new Vector2(1000, floor_pos_y - 128));

            this.AddEntity(penguin);

            MainMenuGUI mainMenuGUI = new MainMenuGUI();

            AddEntity(mainMenuGUI);

            GameState.Instance.SetVar <int>("floor_pos_y", floor_pos_y);

            this.Camera.SetScreenOffset(0.49, 0.83);
            this.Camera.FollowOnlyXAxis();
            this.Camera.FollowEntity(penguin);
        }
Beispiel #2
0
    public void Start()
    {
        menu = this.GetComponent <MainMenuGUI>();

        if (MainMenuGUI.connectMultiplayer)
        {
            // this makes sure we can use PhotonNetwork.LoadLevel() on the master client and all clients in the same room sync their level automatically
            PhotonNetwork.automaticallySyncScene = true;

            // the following line checks if this client was just created (and not yet online). if so, we connect
            if (PhotonNetwork.connectionStateDetailed == PeerState.PeerCreated)
            {
                // Connect to the photon master-server. We use the settings saved in PhotonServerSettings (a .asset file in this project)
                PhotonNetwork.ConnectUsingSettings("1.0");
            }

            // generate a name for this player, if none is assigned yet
            if (String.IsNullOrEmpty(PhotonNetwork.playerName))
            {
                PhotonNetwork.playerName = "Guest" + Random.Range(1, 9999);
            }

            // if you wanted more debug out, turn this on:
            // PhotonNetwork.logLevel = NetworkLogLevel.Full;
        }
    }
Beispiel #3
0
 void Awake()
 {
     instance = this;
     //  originalHighScoreText = highscoreText.text;
     //  originalGamesPlayedText = gamesPlayedText.text;
     //   playerNameField.text = PlayerPrefs.GetString("PlayerName");
 }
	// LOAD ALL THE RESOURCE TO START
	void Start () {

		this.gui = new MainMenuGUI ();
		this.gui.setAudioClick (this.audio);
		this.gui.initResources ();
	
	}
Beispiel #5
0
        private async void BtnLogin_ClickAsync(object sender, EventArgs e)
        {
            SessionsController sCtrl = SessionsController.Instance;

            string   email    = tbEmail.Text;
            string   password = tbPassword.Text;
            Employee res      = new Employee();

            res.Email    = email;
            res.Password = password;
            try {
                if (!tbEmail.Text.Equals("") && !tbPassword.Text.Equals("") && await sCtrl.Login(res))
                {
                    MessageBox.Show("Succesfully logged in");
                    MainMenuGUI mmGUI = MainMenuGUI.Instance;
                    this.Visible = false;
                    mmGUI.SetStartupView();
                    mmGUI.Show();
                }
                else
                {
                    MessageBox.Show("Email or password invalid");
                    tbEmail.Text    = "";
                    tbPassword.Text = "";
                }
            }
            catch (Exception) {
                MessageBox.Show("No connection to service");
            }
        }
Beispiel #6
0
        public async Task CurrentlyLoggedInAsync(int EmployeeId)
        {
            MainMenuGUI         mmGUI    = MainMenuGUI.Instance;
            EmployeesController eCtrl    = new EmployeesController();
            Employee            employee = await eCtrl.Get(EmployeeId);

            mmGUI.setCurrentlyLoggedIn(employee);
        }
Beispiel #7
0
        public void LogOut()
        {
            MainMenuGUI mmGUI = MainMenuGUI.Instance;
            LoginGUI    lGUI  = new LoginGUI();

            mmGUI.Hide();
            lGUI.Show();
            mmGUI = null;
            CleanSession();
        }
Beispiel #8
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            _gameModel = new GameModel()
            {
                ContentManger         = Content,
                GraphicsDeviceManager = graphics,
                SpriteBatch           = spriteBatch,
            };

            var actors = new List <ActorModel>()
            {
                new ActorModel()
                {
                    Name      = "{TestA}",
                    Abilities = new AbilitiesModel()
                    {
                        Ability1 = new AbilityModel("Ability 1", "Battle/AbilityIcon", AbilityModel.TargetTypes.Single),
                        Ability2 = new AbilityModel("Ability 2", "Battle/AbilityIcon", AbilityModel.TargetTypes.Single),
                        Ability3 = new AbilityModel("Ability 3", "Battle/AbilityIcon", AbilityModel.TargetTypes.Single),
                        Ability4 = new AbilityModel("Ability 4", "Battle/AbilityIcon", AbilityModel.TargetTypes.All),
                    }
                },
                new ActorModel()
                {
                    Name      = "{TestB}",
                    Abilities = new AbilitiesModel()
                    {
                        Ability1 = new AbilityModel("Ability 1", "Battle/AbilityIcon", AbilityModel.TargetTypes.Single),
                        Ability2 = new AbilityModel("Ability 2", "Battle/AbilityIcon", AbilityModel.TargetTypes.Single),
                        Ability3 = new AbilityModel("Ability 3", "Battle/AbilityIcon", AbilityModel.TargetTypes.Single),
                        Ability4 = new AbilityModel("Ability 4", "Battle/AbilityIcon", AbilityModel.TargetTypes.All),
                    }
                },
            };

            UpdateWindowValues();

            _homeStateGUI = new HomeStateGUI(_gameModel, actors);

            _mainMenu = new MainMenuGUI(_gameModel);

            _battleGUI = new BattleStateGUI(_gameModel);

            _battleGUI.SetAbilities(actors.First());
        }
Beispiel #9
0
    void Start()
    {
        tempX          = 203;
        tempY          = 262;
        pageNumber     = GameObject.Find("PageInfo").GetComponent <PageNumberScript>();
        pageNameScript = GameObject.Find("PageInfo").GetComponent <PageNameScript>();
        mmg            = GameObject.Find("MainMenuGUI").GetComponent <MainMenuGUI> ();
        // Make some content for the popup list
        list     = new GUIContent[5];
        list [0] = new GUIContent("1");
        list [1] = new GUIContent("2");
        list [2] = new GUIContent("3");
        list [3] = new GUIContent("4");
        list [4] = new GUIContent("5");

        // Make a GUIStyle that has a solid white hover/onHover background to indicate highlighted items
        listStyle = new GUIStyle();
        listStyle.normal.textColor = Color.black;

        Texture2D bg = new Texture2D(2, 2);

        Color[] colors = new Color[4];
        //Color color;
        for (int i = 0; i < colors.Length; i++)
        {
            colors[i] = new Color((210f / 255f), (159f / 255f), (104f / 255f));
        }
        bg.SetPixels(colors);
        bg.Apply();
        listStyle.normal.background = bg;


        Texture2D tex = new Texture2D(2, 2);

        colors = new Color[4];
        for (int i = 0; i < colors.Length; i++)
        {
            colors[i] = new Color((232f / 255f), (200f / 255f), (152f / 255f));
        }
        tex.SetPixels(colors);
        tex.Apply();
        listStyle.hover.background   = tex;
        listStyle.onHover.background = tex;
        listStyle.padding.left       = listStyle.padding.right = listStyle.padding.top = listStyle.padding.bottom = 4;
    }
Beispiel #10
0
    // Use this for initialization
    void OnEnable()
    {
        gamestatsg = GameObject.FindGameObjectWithTag("gamestats");
        if (gamestatsg != null)
        {
            saveload = gamestatsg.GetComponent <SaveLoad>();
            maingui  = gamestatsg.GetComponent <MainMenuGUI>();

            maingui.enabled = false;
        }
        else
        {
            game_started    = true;
            movement.paused = false;
        }
        if (gamestats != null)
        {
            saveload.LoadLevel(gamestats.profile_name, Application.loadedLevel);
        }
    }
    void Start()
    {
        Instance       = this;
        CreditsHandler = GetComponent <CreditsHandler>();
        SaveSection.SetActive(false);
        creditsYPos      = Screen.height / 2.0f;
        GameTitle.text   = Rm_RPGHandler.Instance.GameInfo.GameTitle;
        GameCompany.text = Rm_RPGHandler.Instance.GameInfo.GameCompany;
        RecentSave       = PlayerSaveLoadManager.Instance.RecentSave();
        ContinueButton.gameObject.SetActive(RecentSave != null);

#if (!UNITY_STANDALONE)
        Destroy(LoadButton.gameObject);
#endif

        var themeObj = GameObject.Find("MainMenuTheme");
        if (themeObj != null)
        {
            themeObj.AddComponent <Audio_BgMusic>();
        }
    }
Beispiel #12
0
 void FixedUpdate()
 {
     instance = this;
 }
Beispiel #13
0
 // Use this for initialization
 void Start()
 {
     instance = this;
     currentMenu = "MainMenu";
     matchName = "Welcome" + Random.Range(0,5000);
 }
Beispiel #14
0
 // Use this for initialization
 void Start()
 {
     instance    = this;
     currentMenu = "MainMenu";
     matchName   = "Welcome" + Random.Range(0, 5000);
 }
Beispiel #15
0
    public void Start()
    {
        menu = this.GetComponent<MainMenuGUI>();

            if(MainMenuGUI.connectMultiplayer){
                // this makes sure we can use PhotonNetwork.LoadLevel() on the master client and all clients in the same room sync their level automatically
                PhotonNetwork.automaticallySyncScene = true;

                // the following line checks if this client was just created (and not yet online). if so, we connect
                if (PhotonNetwork.connectionStateDetailed == PeerState.PeerCreated)
                {
                    // Connect to the photon master-server. We use the settings saved in PhotonServerSettings (a .asset file in this project)
                    PhotonNetwork.ConnectUsingSettings("1.0");
                }

                // generate a name for this player, if none is assigned yet
                if (String.IsNullOrEmpty(PhotonNetwork.playerName))
                {
                    PhotonNetwork.playerName = "Guest" + Random.Range(1, 9999);
                }

                // if you wanted more debug out, turn this on:
                // PhotonNetwork.logLevel = NetworkLogLevel.Full;
            }
    }
Beispiel #16
0
 void Awake()
 {
     instance = this;
     originalHighScoreText   = highscoreText.text;
     originalGamesPlayedText = gamesPlayedText.text;
 }
Beispiel #17
0
 void FixedUpdate()
 {
     instance = this;
 }