Inheritance: MonoBehaviour
Esempio n. 1
0
 public static void Load(ScreenManager screenManager, bool loadingIsSlow, params GameScreen[] screensToLoad)
 {
     foreach (GameScreen screen in screenManager.GetScreens())
         screen.ExitScreen();
     LoadingScreen loadingScreen = new LoadingScreen(screenManager, loadingIsSlow, screensToLoad);
     screenManager.AddScreen(loadingScreen);
 }
Esempio n. 2
0
        //public GameplayHelper helper, temp;
        public attackGame()
        {
            hel = hel as GameplayHelper;
            _To = "ovo jebeno izgleda da radi";
            graphics = new GraphicsDeviceManager(this);
            PhoneApplicationService phoneAppService = PhoneApplicationService.Current;
            phoneAppService.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            graphics.IsFullScreen = true;
            //Set the Windows Phone screen resolution
            graphics.PreferredBackBufferWidth = 480;
            graphics.PreferredBackBufferHeight = 800;
            //
            Content.RootDirectory = "Content";
            backScreen = new SplashScreen();
            loadingScreen = new LoadingScreen(1,2);
            //helper = helper as GameplayHelper;
            //temp = temp as GameplayHelper;
            // Hook up lifecycle events

            PhoneApplicationService.Current.Launching += new EventHandler<LaunchingEventArgs>(Current_Launching);
            PhoneApplicationService.Current.Activated += new EventHandler<ActivatedEventArgs>(Current_Activated);
            //PhoneApplicationService.Current.Closing += new EventHandler<ClosingEventArgs>(Current_Closing);
            PhoneApplicationService.Current.Deactivated += new EventHandler<DeactivatedEventArgs>(Current_Deactivated);

            // Frame rate is 30 fps by default for Windows Phone.
            TargetElapsedTime = TimeSpan.FromSeconds(1 / 30.0);

            //Create a new instance of the Screen Manager
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);
            //Debug.WriteLine("konstruktor");
        }
 private CanvasManager InitializeLoadingScreen()
 {
     GameObject loadingScreen = SRResources.Core.UI.LoadingScreen.Instantiate();
     loadingScreen.transform.SetParent(gameObject.transform, false);
     _loadingScreen = loadingScreen.GetComponent<LoadingScreen>();
     _loadingScreen.Initialize();
     return this;
 }
Esempio n. 4
0
 void Awake() {
     if (instance == null) {
         DontDestroyOnLoad(gameObject);
         instance = this;
     }
     else
         if (instance != this)
         Destroy(gameObject);
 }
Esempio n. 5
0
 // Use this for initialization
 protected override void Start()
 {
     base.Start();
     m_Fader = FindObjectOfType<LoadingScreen>();
     m_Fader.LoadingAnimDone += M_Fader_FadeDone;
     m_Fader.LoadDone += M_Fader_LoadDone;
     GameManager.instance.SetGameState(GameState.Loading);
     ResetSponsors();
 }
Esempio n. 6
0
 void Start()
 {
     if(current == null) {
         current = this;
         DontDestroyOnLoad(gameObject);
     } else {
         DestroyImmediate(gameObject);
     }
 }
Esempio n. 7
0
    void Start()
    {
        loadingScreenScript = loadingScreen.GetComponent<LoadingScreen>();
        loadingScreen.SetActive(false); //Hide the loading screen at start

        #if UNITY_EDITOR
        if (nameToPrint == "")
        {
            Debug.LogWarning("Name to print is not defined in the object "+gameObject.name+". No name will be display in the loading screen.");
        }
        #endif
    }
Esempio n. 8
0
 private void Awake()
 {
     LoadingScreen.singleton = this;
     if (!LoadingScreen.showing)
     {
         LoadingScreen.Hide();
     }
     else
     {
         LoadingScreen.Show();
     }
 }
Esempio n. 9
0
        /// <summary>
        /// Activates the loading screen.
        /// </summary>
        public static void Load(ScreenManager screenManager, bool loadingIsSlow,
                                PlayerIndex? controllingPlayer,
                                params GameScreen[] screensToLoad)
        {
            // Tell all the current screens to transition off.
            foreach (GameScreen screen in screenManager.GetScreens())
                screen.ExitScreen();

            // Create and activate the loading screen.
            LoadingScreen loadingScreen = new LoadingScreen(screenManager, loadingIsSlow, screensToLoad);

            screenManager.AddScreen(loadingScreen, controllingPlayer);
        }
Esempio n. 10
0
 //initialize instance of loadingscreen and make sure it persists throughout other scenes (DontDestroyOnLoad(this))
 void Awake()
 {
     if (instance)
     {
         Destroy(gameObject);
         Hide();
         return;
     }
     instance = this;
     transform.position = new Vector3(0.5f, 0.5f, 1f);
     DontDestroyOnLoad(this);
     _loadingScreen.enabled = false;
 }
Esempio n. 11
0
 /// <summary>
 /// Insert our list of tips into the specified loading screen state.
 /// </summary>
 /// <param name="state"></param>
 private static void InsertTips(LoadingScreen.LoadingScreenState state)
 {
     string[] newTips = new string[state.tips.Length + NEW_TIPS.Length];
     for (int i = 0; i < state.tips.Length; ++i)
     {
         newTips[i] = state.tips[i];
     }
     for (int i = 0; i < NEW_TIPS.Length; ++i)
     {
         newTips[state.tips.Length + i] = NEW_TIPS[i];
     }
     state.tips = newTips;
 }
Esempio n. 12
0
 void Awake()
 {
     if (instance)
     {
         Destroy(gameObject);
         return;
     }
     instance = this;
     gameObject.AddComponent<GUITexture>().enabled = false;
     guiTexture.texture = texture;
     transform.position = new Vector3(0.5f, 0.5f, 0.0f);
     DontDestroyOnLoad(this);
 }
Esempio n. 13
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
    void Start()
    {
        TheInventory = gameObject.GetComponent<InventoryGUI>();
        TheTextures = gameObject.GetComponent<PlayerInventory>();
        loadingScript = gameObject.GetComponent<LoadingScreen>();
        for(int i= 0; i <PlayerInventory.itemPlayersAmount.Length; i++) // for loop die checkt hoeveel items er in playersAmount zit.
        {
            if (PlayerInventory.itemPlayersAmount[i] > 0) // kijken of een item uberhaupt een aantal heeft
            {
                TheInventory.Grids[i].image = TheTextures.itemTexture[i];  // zorgt ervoor dat de juiste image bij de correcte ID komt.
            }

        }
    }
Esempio n. 15
0
 void Awake()
 {
     if (instance)
      {
          Destroy(gameObject);
          hide();
          return;
      }
      button = GameObject.FindGameObjectWithTag("Button");
      instance = this;
      gameObject.AddComponent<GUITexture>().enabled = false;
      GetComponent<GUITexture>().texture = texture;
      transform.position = new Vector3(0.5f, 0.5f, 1f);
      //DontDestroyOnLoad(this);
 }
Esempio n. 16
0
    //When the object awakens, we assign the static variable if its a new instance and
    void Awake()
    {
        //destroy the already existing instance, if any
        if (instance)
        {
            Destroy(gameObject);
            hide();                                         //call hide function to hide the 'loading texture'
            return;
        }

        instance = this;
        gameObject.AddComponent<GUITexture>().enabled = false;  //disable the texture on start of the scene
        GetComponent<GUITexture>().texture = texture;                           //assign the texture
        transform.position = new Vector3(0.5f, 0.5f, 1f);       //position the texture to the center of the screen
        DontDestroyOnLoad(this);                                //make this object persistent between scenes
    }
Esempio n. 17
0
 //Functions
 void Awake()
 {
     Active = false;
     if(!GameObject.Find("LoadingScreen"))
     {
         Vector3 lspos = new Vector3(0,0, 1000);
         var  l = Instantiate(Load, lspos , Quaternion.identity);
         l.name = "LoadingScreen";
     }
     LoadS = GameObject.Find("LoadingScreen");
     if(LoadS !=null)
         Debug.Log("LoadingScreen Found");
     LS = LoadS.GetComponent<LoadingScreen>();
     if(LS !=null)
         DebugConsole.Log("LoadingScreen Component Got");
     if(!Main)
     {
         s = PauseCam.GetComponent<SmoothCam>();
     }
 }
Esempio n. 18
0
 void Start()
 {
     loading =  GetComponent<LoadingScreen>();
 }
Esempio n. 19
0
 // Use this for initialization
 void Start()
 {
     _loader = FindObjectOfType<LoadingScreen>();
     if (_loader != null) _loader.LoadDone += LoadDone;
     else
     {
         m_ListofPlayers = Utilities.GetAllPlayerData();
         SetInputs();
     }
 }
Esempio n. 20
0
        /// <summary>
        ///     Starts the timer to update map objects and the handler to update position
        /// </summary>
        public static async Task InitializeDataUpdate()
        {
            LoadingScreen.SetBusy(true);
            #region Compass management
            SettingsService.Instance.PropertyChanged += (object sender, PropertyChangedEventArgs e) =>
            {
                if (e.PropertyName == nameof(SettingsService.Instance.MapAutomaticOrientationMode))
                {
                    switch (SettingsService.Instance.MapAutomaticOrientationMode)
                    {
                    case MapAutomaticOrientationModes.Compass:
                        _compass = Compass.GetDefault();
                        _compass.ReportInterval  = Math.Max(_compass.MinimumReportInterval, 50);
                        _compass.ReadingChanged += compass_ReadingChanged;
                        break;

                    case MapAutomaticOrientationModes.None:
                    case MapAutomaticOrientationModes.GPS:
                    default:
                        if (_compass != null)
                        {
                            _compass.ReadingChanged -= compass_ReadingChanged;
                            _compass = null;
                        }
                        break;
                    }
                }
            };
            //Trick to trigger the PropertyChanged for MapAutomaticOrientationMode ;)
            SettingsService.Instance.MapAutomaticOrientationMode = SettingsService.Instance.MapAutomaticOrientationMode;
            #endregion
            _geolocator = new Geolocator
            {
                DesiredAccuracy         = PositionAccuracy.High,
                DesiredAccuracyInMeters = 5,
                ReportInterval          = 1000,
                MovementThreshold       = 5
            };

            LoadingScreen.SetBusy(true, Resources.CodeResources.GetString("GettingGpsSignalText"));
            Geoposition = Geoposition ?? await _geolocator.GetGeopositionAsync();

            GeopositionUpdated?.Invoke(null, Geoposition);
            _geolocator.PositionChanged += GeolocatorOnPositionChanged;
            // Before starting we need game settings
            GameSetting =
                await
                DataCache.GetAsync(nameof(GameSetting), async() => (await _client.Download.GetSettings()).Settings,
                                   DateTime.Now.AddMonths(1));

            // Update geolocator settings based on server
            _geolocator.MovementThreshold = GameSetting.MapSettings.GetMapObjectsMinDistanceMeters;
            if (_heartbeat == null)
            {
                _heartbeat = new Heartbeat();
            }
            await _heartbeat.StartDispatcher();

            // Update before starting timer
            LoadingScreen.SetBusy(true, Resources.CodeResources.GetString("GettingUserDataText"));
            //await UpdateMapObjects();
            await UpdateInventory();
            await UpdateItemTemplates();

            LoadingScreen.SetBusy(false);
        }
Esempio n. 21
0
        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            try
            {
                if (paused == false)
                {
                    #region Game

                    base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
                    KeyboardState keyb = Keyboard.GetState();

                    DetectCollisions();

                    #region Asteroids are Defeated
                    if (asteroidsonscreen == 0 || (keyb.IsKeyDown(Keys.N)))
                    {
                        this.Content.Unload();
                        this.ExitScreen();
                        LoadingScreen.Load(ScreenManager, true, null, new textScreen(2, Score));
                    }
                    #endregion

                    #region Player Dead
                    if (dead == true)
                    {
                        this.Content.Unload();
                        this.ExitScreen();
                        LoadingScreen.Load(ScreenManager, false, null, new GameOverBackgroundScreen(), new GameOverScreen());
                    }

                    #endregion

                    timer = Input(gameTime, timer);

                    #region Bullet Timeout
                    for (int j = 0; j <= noBullets - 1; j++)
                    {
                        BulletList[j].AmmoModelPosition += BulletList[j].AmmoVelocity;
                        BulletList[j].timer             += (float)gameTime.ElapsedGameTime.TotalMilliseconds;
                        if (BulletList[j].timer > interval)
                        {
                            BulletList[j].timer      = 0.0f;
                            BulletList[j].AmmoFlying = false;
                        }
                    }
                    #endregion

                    #region asteroidroll
                    #region Asteroid1
                    for (int j = 0; j <= NumAsteroid1 - 1; j++)
                    {
                        if (asteroid1List[j].isAlive)
                        {
                            asteroid1List[j].rotation += 0.005f;
                            asteroid1List[j].position += new Vector3(3.75f, 3.75f, 0);
                        }
                    }
                    #endregion

                    #region Asteroid2
                    for (int i = 0; i <= NumAsteroid2 - 1; i++)
                    {
                        Vector3 roll = Vector3.Zero;
                        if (i == 1 || i == 3 || i == 5 || i == 7 || i == 9 || i == 11 || i == 13 || i == 15)
                        {
                            roll = new Vector3(-4.75f, 6.75f, 0.0f);
                        }
                        if (i == 0 || i == 2 || i == 4 || i == 6 || i == 8 || i == 10 || i == 12 || i == 14)
                        {
                            roll = new Vector3(6.75f, -4.75f, 0.0f);
                        }

                        if (asteroid2List[i].isAlive)
                        {
                            asteroid2List[i].position += roll;
                            asteroid2List[i].rotation += 0.01f;
                        }
                    }
                    #endregion

                    #region Asteroid3
                    for (int i = 0; i <= NumAsteroid3 - 1; i++)
                    {
                        Vector3 roll = Vector3.Zero;
                        if (i == 1 || i == 3 || i == 5 || i == 7 || i == 9 || i == 11 || i == 13 || i == 15)
                        {
                            roll = new Vector3(-8.75f, 6.75f, 0.0f);
                        }
                        if (i == 0 || i == 2 || i == 4 || i == 6 || i == 8 || i == 10 || i == 12 || i == 14)
                        {
                            roll = new Vector3(9.75f, -6.75f, 0.0f);
                        }

                        if (asteroid3List[i].isAlive)
                        {
                            asteroid3List[i].position += roll;
                            asteroid3List[i].rotation += 0.015f;
                        }
                    }
                    #endregion
                    #endregion

                    globeRotation -= 0.0002f;
                    spawntimer    += (float)gameTime.ElapsedGameTime.Milliseconds;


                    #endregion
                }
                if (paused == true)
                {
                    PausedInput();
                }
            }
            catch (Exception ex)
            {
            }
        }
        //------------------------------------------------------------------------------
        // Function: LoadNewStates
        // Author: Neil Holmes & Andrew Green
        // Summary: helper function for transitioning from one section of the game to
        //          another (such as the frontend to in game) where lots of loading is
        //          likely to be required. Ditches all the currently loaded states then
        //          creates the loading screen state and starts loading the list of new
        //          states
        //------------------------------------------------------------------------------
        public void LoadNewStates(Game game, Texture2D loadingImage, PlayerIndex? controllingPlayer, params GameState[] statesToLoad)
        {
            // loop through all currently active game states
            foreach (GameState screen in gameStates)
            {
                // tell this state to transition off and close itself
                screen.CloseState();
            }

            // create and activate the loading screen state
            LoadingScreen loadingScreen = new LoadingScreen(game, loadingImage, statesToLoad, controllingPlayer);

            // add the loading screen the game state manager so that it updates and displays
            AddGameState(loadingScreen);
        }
Esempio n. 23
0
        protected override void Initialize()
        {
            Logger.Log("Initializing GameClass.");

            string windowTitle = ClientConfiguration.Instance.WindowTitle;

            Window.Title = string.IsNullOrEmpty(windowTitle) ?
                           string.Format("{0} Client", MainClientConstants.GAME_NAME_SHORT) : windowTitle;

            base.Initialize();

            string primaryNativeCursorPath     = ProgramConstants.GetResourcePath() + "cursor.cur";
            string alternativeNativeCursorPath = ProgramConstants.GetBaseResourcePath() + "cursor.cur";

            AssetLoader.Initialize(GraphicsDevice, content);
            AssetLoader.AssetSearchPaths.Add(ProgramConstants.GetResourcePath());
            AssetLoader.AssetSearchPaths.Add(ProgramConstants.GetBaseResourcePath());
            AssetLoader.AssetSearchPaths.Add(ProgramConstants.GamePath);

#if !XNA && !WINDOWSGL
            // Try to create and load a texture to check for MonoGame 3.7.1 compatibility
            try
            {
                Texture2D texture    = new Texture2D(GraphicsDevice, 100, 100, false, SurfaceFormat.Color);
                Color[]   colorArray = new Color[100 * 100];
                texture.SetData(colorArray);

                UISettings.ActiveSettings.CheckBoxClearTexture = AssetLoader.LoadTextureUncached("checkBoxClear.png");
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("DeviceRemoved"))
                {
                    Logger.Log("Creating texture on startup failed! Creating .dxfail file and re-launching client launcher.");

                    if (!Directory.Exists(ProgramConstants.GamePath + "Client"))
                    {
                        Directory.CreateDirectory(ProgramConstants.GamePath + "Client");
                    }

                    // Create .dxfail file that the launcher can check for this error
                    // and handle it by redirecting the user to the XNA version instead

                    File.WriteAllBytes(ProgramConstants.GamePath + "Client" + Path.DirectorySeparatorChar + ".dxfail",
                                       new byte[] { 1 });

                    string launcherExe = ClientConfiguration.Instance.LauncherExe;
                    if (string.IsNullOrEmpty(launcherExe))
                    {
                        // LauncherExe is unspecified, just throw the exception forward
                        // because we can't handle it

                        Logger.Log("No LauncherExe= specified in ClientDefinitions.ini! " +
                                   "Forwarding exception to regular exception handler.");

                        throw ex;
                    }
                    else
                    {
                        Logger.Log("Starting " + launcherExe + " and exiting.");

                        Process.Start(ProgramConstants.GamePath + launcherExe);
                        Environment.Exit(0);
                    }
                }
            }
#endif

            InitializeUISettings();

            WindowManager wm = new WindowManager(this, graphics);
            wm.Initialize(content, ProgramConstants.GetBaseResourcePath());

            SetGraphicsMode(wm);

            wm.SetIcon(ProgramConstants.GetBaseResourcePath() + "clienticon.ico");

            wm.SetControlBox(true);

            wm.Cursor.Textures = new Texture2D[]
            {
                AssetLoader.LoadTexture("cursor.png"),
                AssetLoader.LoadTexture("waitCursor.png")
            };

            if (File.Exists(primaryNativeCursorPath))
            {
                wm.Cursor.LoadNativeCursor(primaryNativeCursorPath);
            }
            else if (File.Exists(alternativeNativeCursorPath))
            {
                wm.Cursor.LoadNativeCursor(alternativeNativeCursorPath);
            }

            Components.Add(wm);

            string playerName = UserINISettings.Instance.PlayerName.Value.Trim();

            if (UserINISettings.Instance.AutoRemoveUnderscoresFromName)
            {
                while (playerName.EndsWith("_"))
                {
                    playerName = playerName.Substring(0, playerName.Length - 1);
                }
            }

            if (string.IsNullOrEmpty(playerName))
            {
                playerName = WindowsIdentity.GetCurrent().Name;

                playerName = playerName.Substring(playerName.IndexOf("\\") + 1);
            }

            playerName = Renderer.GetSafeString(NameValidator.GetValidOfflineName(playerName), 0);

            ProgramConstants.PLAYERNAME = playerName;
            UserINISettings.Instance.PlayerName.Value = playerName;

            LoadingScreen ls = new LoadingScreen(wm);
            wm.AddAndInitializeControl(ls);
            ls.ClientRectangle = new Rectangle((wm.RenderResolutionX - ls.Width) / 2,
                                               (wm.RenderResolutionY - ls.Height) / 2, ls.Width, ls.Height);
        }
Esempio n. 24
0
 private void Start()
 {
     loadingScreen = CreateLoadingScreen();
     loadingScreen.gameObject.SetActive(false);
 }
Esempio n. 25
0
    public void LoadScene(string levelName)
    {
        int levelIndex = SceneManager.GetSceneByName(levelName).buildIndex;

        LoadingScreen.LoadScene(levelIndex);
    }
Esempio n. 26
0
 // Use this for initialization
 void Awake()
 {
     instance = this;
 }
Esempio n. 27
0
    public Menu()
    {
        LoadingScreen ls = GetNode(LOADING_SCREEN_PATH) as LoadingScreen;

        ls.Visible = false;
    }
Esempio n. 28
0
 public static void SwitchToBattleScene()
 {
     LoadingScreen.Show();
     LoadBattleScene();
 }
Esempio n. 29
0
	internal void RegisterLoadingScreen(LoadingScreen a_loading)
	{
		_loadingScreen = a_loading;
	}
Esempio n. 30
0
 public void Play()
 {
     LoadingScreen.Load(Scenes.GAME_PLAY);
 }
Esempio n. 31
0
        public static bool GuardarDocCarrito()
        {
            string fecha  = "'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "'";
            string strSQL = "";

            try
            {
                DataTable dt = new DataTable();

                strSQL  = "SELECT TC.ID_INVENTARIO_GENERAL_FK AS ID, '0' AS NRO, DESCRIPCION_1, DESCRIPCION_2, DESCRIPCION_3, DESCRIPCION_4, DESCRIPCION_5 FROM TMP_CARRITO TC";
                strSQL += " LEFT JOIN INVENTARIO_GENERAL IG ON TC.ID_INVENTARIO_GENERAL_FK = IG.ID_INVENTARIO_GENERAL";
                strSQL += " WHERE TIPO = '" + Globals.strBovedaGuardarDOC + "' AND TC.ID_USUARIO_FK = " + Globals.IdUsername;

                if (!Conexion.conectar())
                {
                    return(false);
                }
                if (!Conexion.iniciaCommand(strSQL))
                {
                    return(false);
                }
                if (!Conexion.ejecutarQuery())
                {
                    return(false);
                }

                dt = Conexion.llenarDataTable();
                if (dt is null)
                {
                    return(false);
                }

                foreach (DataRow row in dt.Rows)
                {
                    strSQL = "INSERT INTO INVENTARIO_HISTORICO (ID_USUARIO_ENTREGA_FK, ID_USUARIO_RECIBE_FK, ID_INVENTARIO_GENERAL_FK, FECHA_INICIO, FECHA_FIN, RECIBIDO, ANULADO) VALUES (" + Globals.IdUsername + ", " + Globals.IdUsernameSelect + ", " + row["ID"].ToString() + ", " + fecha + ", " + fecha + ", 1, 0)";
                    if (!Conexion.iniciaCommand(strSQL))
                    {
                        return(false);
                    }
                    if (!Conexion.ejecutarQuery())
                    {
                        return(false);
                    }

                    strSQL = "UPDATE INVENTARIO_GENERAL SET [ID_USUARIO_POSEE] = " + Globals.IdUsernameSelect + ", [FECHA_POSEE] = " + fecha + " WHERE ID_INVENTARIO_GENERAL = " + row["ID"].ToString();
                    if (!Conexion.iniciaCommand(strSQL))
                    {
                        return(false);
                    }
                    if (!Conexion.ejecutarQuery())
                    {
                        return(false);
                    }
                }

                strSQL = "DELETE FROM TMP_CARRITO WHERE ID_USUARIO_FK = " + Globals.IdUsername + " AND TIPO = '" + Globals.strBovedaGuardarDOC + "'";
                if (!Conexion.iniciaCommand(strSQL))
                {
                    return(false);
                }
                if (!Conexion.ejecutarQuery())
                {
                    return(false);
                }

                Conexion.cerrar();
                LoadingScreen.cerrarLoading();

                MessageBox.Show("Proceso Finalizado");
                return(true);
            }
            catch (Exception ex)
            {
                GlobalFunctions.casoError(ex, strSQL);
                return(false);
            }
        }
 /// <summary>
 /// Event handler for when the user selects ok on the "are you sure
 /// you want to quit" message box. This uses the loading screen to
 /// transition from the game back to the main menu screen.
 /// </summary>
 void ConfirmQuitMessageBoxAccepted(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(Engine, false, null, new BackgroundScreen(),
                        new MainMenuScreen());
 }
Esempio n. 33
0
    public static LoadingScreen Instance()
    {
        if (!instance)
        {
            instance = FindObjectOfType(typeof(LoadingScreen)) as LoadingScreen;
            if (!instance)
                Debug.LogError("There needs to be one active LoadingScreen script on a GameObject in your scene.");

            instance.gameObject.SetActive(false);
        }

        return instance;
    }
Esempio n. 34
0
    public override void _Ready()
    {
        organelleSelectionElements = GetTree().GetNodesInGroup("OrganelleSelectionElement");
        membraneSelectionElements  = GetTree().GetNodesInGroup("MembraneSelectionElement");
        itemTooltipElements        = GetTree().GetNodesInGroup("ItemTooltip");

        loadingScreen = GetNode <LoadingScreen>("LoadingScreen");

        menu                          = GetNode <Control>(MenuPath);
        sizeLabel                     = GetNode <Label>(SizeLabelPath);
        speedLabel                    = GetNode <Label>(SpeedLabelPath);
        generationLabel               = GetNode <Label>(GenerationLabelPath);
        mutationPointsLabel           = GetNode <Label>(MutationPointsLabelPath);
        mutationPointsBar             = GetNode <TextureProgress>(MutationPointsBarPath);
        speciesNameEdit               = GetNode <LineEdit>(SpeciesNameEditPath);
        membraneColorPicker           = GetNode <ColorPicker>(MembraneColorPickerPath);
        newCellButton                 = GetNode <TextureButton>(NewCellButtonPath);
        undoButton                    = GetNode <TextureButton>(UndoButtonPath);
        redoButton                    = GetNode <TextureButton>(RedoButtonPath);
        symmetryButton                = GetNode <TextureButton>(SymmetryButtonPath);
        finishButton                  = GetNode <Button>(FinishButtonPath);
        atpBalanceLabel               = GetNode <Label>(ATPBalanceLabelPath);
        atpProductionBar              = GetNode <ProgressBar>(ATPProductionBarPath);
        atpConsumptionBar             = GetNode <ProgressBar>(ATPConsumptionBarPath);
        atpProductionLabel            = GetNode <Label>(ATPProductionLabelPath);
        atpConsumptionLabel           = GetNode <Label>(ATPConsumptionLabelPath);
        glucoseReductionLabel         = GetNode <Label>(GlucoseReductionLabelPath);
        autoEvoLabel                  = GetNode <Label>(AutoEvoLabelPath);
        externalEffectsLabel          = GetNode <Label>(ExternalEffectsLabelPath);
        mapDrawer                     = GetNode <PatchMapDrawer>(MapDrawerPath);
        patchNothingSelected          = GetNode <Control>(PatchNothingSelectedPath);
        patchDetails                  = GetNode <Control>(PatchDetailsPath);
        patchName                     = GetNode <Label>(PatchNamePath);
        patchPlayerHere               = GetNode <Control>(PatchPlayerHerePath);
        patchBiome                    = GetNode <Label>(PatchBiomePath);
        patchTemperature              = GetNode <Label>(PatchTemperaturePath);
        patchPressure                 = GetNode <Label>(PatchPressurePath);
        patchLight                    = GetNode <Label>(PatchLightPath);
        patchOxygen                   = GetNode <Label>(PatchOxygenPath);
        patchNitrogen                 = GetNode <Label>(PatchNitrogenPath);
        patchCO2                      = GetNode <Label>(PatchCO2Path);
        patchHydrogenSulfide          = GetNode <Label>(PatchHydrogenSulfidePath);
        patchAmmonia                  = GetNode <Label>(PatchAmmoniaPath);
        patchGlucose                  = GetNode <Label>(PatchGlucosePath);
        patchPhosphate                = GetNode <Label>(PatchPhosphatePath);
        patchIron                     = GetNode <Label>(PatchIronPath);
        speciesList                   = GetNode <VBoxContainer>(SpeciesListPath);
        physicalConditionsBox         = GetNode <Control>(PhysicalConditionsBoxPath);
        atmosphericConditionsBox      = GetNode <Control>(AtmosphericConditionsBoxPath);
        compoundsBox                  = GetNode <Control>(CompoundsBoxPath);
        moveToPatchButton             = GetNode <Button>(MoveToPatchButtonPath);
        physicalConditionsButton      = GetNode <Control>(PhysicalConditionsButtonPath);
        atmosphericConditionsButton   = GetNode <Control>(AtmosphericConditionsButtonPath);
        compoundsButton               = GetNode <Control>(CompoundsBoxButtonPath);
        speciesListButton             = GetNode <Control>(SpeciesListButtonPath);
        symmetryIcon                  = GetNode <TextureRect>(SymmetryIconPath);
        patchTemperatureSituation     = GetNode <TextureRect>(PatchTemperatureSituationPath);
        patchLightSituation           = GetNode <TextureRect>(PatchLightSituationPath);
        patchHydrogenSulfideSituation = GetNode <TextureRect>(PatchHydrogenSulfideSituationPath);
        patchGlucoseSituation         = GetNode <TextureRect>(PatchGlucoseSituationPath);
        patchIronSituation            = GetNode <TextureRect>(PatchIronSituationPath);
        patchAmmoniaSituation         = GetNode <TextureRect>(PatchAmmoniaSituationPath);
        patchPhosphateSituation       = GetNode <TextureRect>(PatchPhosphateSituationPath);
        rigiditySlider                = GetNode <Slider>(RigiditySliderPath);
        helpScreen                    = GetNode <HelpScreen>(HelpScreenPath);

        mapDrawer.OnSelectedPatchChanged = (drawer) => { UpdateShownPatchDetails(); };

        // Fade out for that smooth satisfying transition
        TransitionManager.Instance.AddScreenFade(Fade.FadeType.FadeOut, 0.5f);
        TransitionManager.Instance.StartTransitions(null, string.Empty);
    }
Esempio n. 35
0
    void Awake()
    {
        if (instance != null){
            Debug.LogWarning("There are 2 gui managers");
        }
        instance = this;
        activeControls = new List<GUIControl>();
        controlsToRemove = new List<GUIControl>();
        controlsToAdd = new List<GUIControl>();

        chatMenu = GetComponent<ChatMenu>();
        inGameMenu = GetComponent<InGameMenu>();
        interactionMenu = GetComponent<InteractionMenu>();
        pauseMenu = GetComponent<PauseMenu>();
        loadingScreen = GetComponent<LoadingScreen>();
    }
Esempio n. 36
0
 public void LaunchGameNow()
 {
     LoadingScreen.LoadScene(1);
 }
Esempio n. 37
0
 // Use this for initialization
 void Start()
 {
     if (m_fader == null) m_fader = FindObjectOfType<LoadingScreen>();
     if(m_fader != null) m_fader.LoadingAnimDone += EnterTimer;
     m_TimerText.text = Database.instance.GameTexts[16];
     GameManager.instance.InjectRoundStartTimer(this);
 }
 private void btnScan_Click(object sender, RoutedEventArgs e)
 {
     LoadingScreen ls = new LoadingScreen();
     if (chkAuditSoftware.IsChecked == true)
     {
         ls.auditsoftware = true;
         dgSoftware.Items.Clear();
         lbPrinters.Items.Clear();
         lbPeripherals.Items.Clear();
         rtxtComments.Document.Blocks.Clear();
         txtAddPrinter.Text = "";
         cbIPAddress.Items.Clear();
         cbMacAddress.Items.Clear();
     }
     else
     {
         dgSoftware.Items.Clear();
         lbPrinters.Items.Clear();
         lbPeripherals.Items.Clear();
         rtxtComments.Document.Blocks.Clear();
         txtAddPrinter.Text = "";
         cbIPAddress.Items.Clear();
         cbMacAddress.Items.Clear();
         ls.auditsoftware = false;
     }
     ls.Show();
     
 }
Esempio n. 39
0
 /// <summary>
 /// If MasterClient left the room , leave room.
 /// </summary>
 /// <param name="newMasterClient"></param>
 public override void OnMasterClientSwitched(Player newMasterClient)
 {
     PhotonNetwork.LeaveRoom();
     LoadingScreen.LoadScene(LobbyContainer.SceneIndex);
 }
Esempio n. 40
0
 void Start()
 {
     m_Fader = FindObjectOfType<LoadingScreen>();
     if (m_Fader == null && _activator != null) m_Fader = _activator.Loader;
     SubscribeToEvents(m_Fader);
 }
Esempio n. 41
0
 void Start()
 {
     loadingScreen = GameObject.Find("LoadingScreenCanvas").GetComponent <LoadingScreen>();
     canvas        = GetComponent <Canvas>();
 }
Esempio n. 42
0
 public void SubscribeToEvents(LoadingScreen toUse)
 {
     if (!_subscribed)
     {
         m_Fader = toUse;
         m_Fader.LoadingAnimDone += M_Fader_FadeDone;
         m_Fader.LoadDone += M_Fader_LoadDone;
         _subscribed = true;
     }
 }
Esempio n. 43
0
 private void OnPreviousSceneDestroyed(object userData)
 {
     LoadingScreen.Get().UnregisterPreviousSceneDestroyedListener(new LoadingScreen.PreviousSceneDestroyedCallback(this.OnPreviousSceneDestroyed));
     this.HideDialog();
 }
Esempio n. 44
0
 public void LoadMenu()
 {
     LoadingScreen.LoadScene(0);
 }
Esempio n. 45
0
 private LoadingScreen()
 {
     instance = this;
 }
        public async Task ShowAsync(PhotoData photo)
        {
            if (photo == null || photo.Uri == null)
            {
                return;
            }

            Root.Opacity    = 0;
            Root.Visibility = Visibility.Visible;

            LoadingScreen.Opacity          = 1;
            LoadingScreen.IsHitTestVisible = true;
            ProgressRing.IsActive          = true;

            await Root.Scale(1.2f, 1.2f, (float)ActualWidth / 2, (float)ActualHeight / 2, 0).Then()
            .Fade(1).Scale(1, 1, (float)ActualWidth / 2, (float)ActualHeight / 2).StartAsync();

            _photo = photo;
            var uri = new Uri(photo.Uri);

            if (uri.IsFile)
            {
                _file = await StorageFile.GetFileFromPathAsync(photo.Uri);
            }
            else
            {
                _file = await StorageFile.CreateStreamedFileFromUriAsync("photo.jpg", uri, null);
            }

            if (_file == null)
            {
                Hide();
                return;
            }

            var stream = await _file.OpenReadAsync();

            _canvasImage = await CanvasBitmap.LoadAsync(ImageCanvas, stream);

            var imgBounds = _canvasImage.GetBounds(ImageCanvas);

            //var size = Math.Min(imgBounds.Height, imgBounds.Width);

            ImageCanvas.Height = 1200;
            ImageCanvas.Width  = 950;

            _selectedEffectType = EffectType.none;
            ImageCanvas.Invalidate();

            if (_photo.InkUri != null)
            {
                Inker.LoadInkFromFile(_photo.InkUri);
            }

            if (App.IsXbox())
            {
                DetailsButton.Focus(FocusState.Keyboard);
            }

            SetCanvasSize();

            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
            ((App)(App.Current)).BackRequested += PhotoPreviewView_BackRequested;

            SizeChanged           += PhotoPreviewView_SizeChanged;
            ImageRoot.SizeChanged += ImageRoot_SizeChanged;
            SetCanvasSize();

            LoadingScreen.Fade(0, 300).Start();
            ProgressRing.IsActive          = false;
            LoadingScreen.IsHitTestVisible = false;

            FinishedShowing?.Invoke(this, null);

            IsVisible = true;

            AnalyzeFaces();
        }
Esempio n. 47
0
        private void OpenCasc()
        {
            LoadingScreen.SetActive(true);

            CASC.Initialize(SettingsManager <ModelViewerConfig> .Config, LoadingScreen);
        }
Esempio n. 48
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            btnBack.TouchUpInside += (sender, e) =>
            {
                NavigationController.PopViewController(true);
            };

            source            = new CustomListSource <Profile>(new List <Profile>(), GetCell, (arg1, arg2) => 70);
            source.ItemClick += (sender, e) =>
            {
                if (result.TeamProfiles.Any(m => m.Id == e.Id))
                {
                    if (Post.Teams.Contains((e.Id)))
                    {
                        Post.Teams.Remove(e.Id);
                    }
                    else
                    {
                        Post.Teams.Add(e.Id);
                    }
                }
                else if (result.SchoolProfiles.Any(m => m.Id == e.Id))
                {
                    if (Post.Schools.Contains((e.Id)))
                    {
                        Post.Schools.Remove(e.Id);
                    }
                    else
                    {
                        Post.Schools.Add(e.Id);
                    }
                }
                else if (result.SportProfile.Any(m => m.Id == e.Id))
                {
                    if (Post.Sports.Contains((e.Id)))
                    {
                        Post.Sports.Remove(e.Id);
                    }
                    else
                    {
                        Post.Sports.Add(e.Id);
                    }
                }
                tvProfiles.ReloadData();
            };

            tvProfiles.Source = source;

            txtSearch.EditingChanged += (sender, e) =>
            {
                GetData();
            };

            btnNext.TouchUpInside += (sender, e) =>
            {
                var controller = Storyboard.InstantiateViewController <TagEventsViewController>();
                controller.Post = Post;
                NavigationController.PushViewController(controller, true);
            };
            LoadingScreen.Show();
            GetData();
        }
Esempio n. 49
0
    void Awake()
    {
        if (!Application.isEditor)
        {
            Cursor.visible   = false;
            Cursor.lockState = CursorLockMode.Locked;
        }

        _loadingScreen = GameObject.Instantiate(loadingScreenPrefab, new Vector3(8000, 8000, 8000), Quaternion.identity);
        _loadingScreen.gameObject.SetActive(false);

        _winPopup = GameObject.Instantiate(winPopupPrefab, Vector3.zero, Quaternion.identity);
        _winPopup.gameObject.SetActive(false);

        spawns = StageManager.instance.transform.Find("SpawnPoints").GetComponentsInChildren <Transform>().Where(x => x.name != "SpawnPoints").ToArray();

        playerInfo             = Serializacion.LoadJsonFromDisk <RegisteredPlayers>("Registered Players");
        playerInfo.playerStats = new PlayerStats[playerInfo.playerControllers.Length];
        playerCameras[playerInfo.playerControllers.Length - 2].SetActive(true);
        if (playerInfo.playerControllers.Length == 2)
        {
            for (int i = 0; i < 2; i++)
            {
                Camera c = GameObject.Find("Camera_P" + (i + 1)).GetComponent <Camera>();
                cameraTexturesForTwoPlayers[i].width = 1280;
                c.rect = new Rect(0, 0, 2, 1);
            }
        }
        else
        {
            for (int i = 0; i < 2; i++)
            {
                Camera c = GameObject.Find("Camera_P" + (i + 1)).GetComponent <Camera>();
                cameraTexturesForTwoPlayers[i].width = 640;
                c.rect = new Rect(0, 0, 1, 1);
            }
        }

        //Setting the mode!
        gameRules = Resources.Load("Scriptable Objects/GameMode_" + playerInfo.gameMode) as SO_GameRules;

        //get all the cameras
        var allCams = GameObject.FindObjectsOfType <CamFollow>().ToList();

        Utility.KnuthShuffle(spawns);

        for (int i = 0; i < playerInfo.playerControllers.Length; i++)
        {
            var URLs = Serializacion.LoadJsonFromDisk <CharacterURLs>("Player " + (playerInfo.playerControllers[i] + 1));

            //Dejo los objetos ccomo children del body por cuestiones de carga de los scripts. Assembler no debería generar problemas, ya que su parent objetivo sería el mismo.
            var player = Instantiate(Resources.Load <GameObject>("Prefabs/Bodies/" + URLs.bodyURL), spawns[i].transform.position, Quaternion.identity).GetComponent <Player>();
            var weapon = Instantiate(Resources.Load <GameObject>("Prefabs/Weapons/" + URLs.weaponURL), player.transform.position, Quaternion.identity, player.transform);
            var comp1  = Instantiate(Resources.Load <GameObject>("Prefabs/Skills/Complementary/" + URLs.complementaryURL[0]), player.transform.position, Quaternion.identity, player.transform);
            var comp2  = Instantiate(Resources.Load <GameObject>("Prefabs/Skills/Complementary/" + URLs.complementaryURL[1]), player.transform.position, Quaternion.identity, player.transform);
            var def    = Instantiate(Resources.Load <GameObject>("Prefabs/Skills/Defensive/" + URLs.defensiveURL), player.transform.position, Quaternion.identity, player.transform);

            CharacterAssembler.Assemble(player.gameObject, def, comp1, comp2, weapon);
            player.transform.forward = spawns[i].forward;

            comp1.GetComponent <ComplementarySkillBase>().RegisterInput(0);
            comp2.GetComponent <ComplementarySkillBase>().RegisterInput(1);

            player.gameObject.layer = LayerMask.NameToLayer("Player" + (playerInfo.playerControllers[i] + 1));
            player.gameObject.tag   = "Player " + (playerInfo.playerControllers[i] + 1);
            foreach (Transform t in player.transform)
            {
                t.gameObject.layer = LayerMask.NameToLayer("Player" + (playerInfo.playerControllers[i] + 1));
                t.gameObject.tag   = "Player " + (playerInfo.playerControllers[i] + 1);
            }

            player.Stats.Score  = 0;
            player.lockedByGame = true;

            player.LightsModule.SetPlayerColor(playerColors[playerInfo.playerControllers[i]]);

            CamFollow cam = allCams.Where(x => x.name == "Camera_P" + (i + 1)).First();
            allCams.Remove(cam);

            if (player.ControlModule.playerType == PlayerControlModule.PlayerType.DRONE)
            {
                cam.AssignTarget(player, player.GetCameraOffset());
            }
            else
            {
                var castedControlModule = player.ControlModule as QuadrupedControlModule;
                cam.AssignTarget(player, player.GetCameraOffset(), castedControlModule.HardcodeForCameraForward);
            }
        }

        //disable cams that are not being used
        foreach (var item in allCams)
        {
            item.gameObject.SetActive(false);
        }

        AddEvents();
        UIManager.Instance.Initialize(Players, StartFirstRound, gameRules.pointsToWin[playerInfo.playerControllers.Length - 2]);
    }
Esempio n. 50
0
    public IEnumerator InitCoroutine()
    {
        WorldSetup worldSetup = null;

        if (!World.CanLoadFromUrl())
        {
            object[] size = new object[] { "Generating procedural map of size ", World.Size, " with seed ", World.Seed };
            UnityEngine.Debug.Log(string.Concat(size));
        }
        else
        {
            UnityEngine.Debug.Log(string.Concat("Loading custom map from ", World.Url));
        }
        ProceduralComponent[] componentsInChildren = worldSetup.GetComponentsInChildren <ProceduralComponent>(true);
        Timing timing = Timing.Start("Downloading World");

        if (World.Procedural && !World.CanLoadFromDisk() && World.CanLoadFromUrl())
        {
            LoadingScreen.Update("DOWNLOADING WORLD");
            yield return(CoroutineEx.waitForEndOfFrame);

            yield return(CoroutineEx.waitForEndOfFrame);

            yield return(CoroutineEx.waitForEndOfFrame);

            UnityWebRequest downloadHandlerBuffer = UnityWebRequest.Get(World.Url);
            downloadHandlerBuffer.downloadHandler = new DownloadHandlerBuffer();
            downloadHandlerBuffer.Send();
            while (!downloadHandlerBuffer.isDone)
            {
                float single = downloadHandlerBuffer.downloadProgress * 100f;
                LoadingScreen.Update(string.Concat("DOWNLOADING WORLD ", single.ToString("0.0"), "%"));
                yield return(CoroutineEx.waitForEndOfFrame);
            }
            if (downloadHandlerBuffer.isHttpError || downloadHandlerBuffer.isNetworkError)
            {
                string[] name = new string[] { "Couldn't Download Level: ", World.Name, " (", downloadHandlerBuffer.error, ")" };
                worldSetup.CancelSetup(string.Concat(name));
            }
            else
            {
                File.WriteAllBytes(string.Concat(World.MapFolderName, "/", World.MapFileName), downloadHandlerBuffer.downloadHandler.data);
            }
            downloadHandlerBuffer = null;
        }
        timing.End();
        Timing timing1 = Timing.Start("Loading World");

        if (World.Procedural && World.CanLoadFromDisk())
        {
            LoadingScreen.Update("LOADING WORLD");
            yield return(CoroutineEx.waitForEndOfFrame);

            yield return(CoroutineEx.waitForEndOfFrame);

            yield return(CoroutineEx.waitForEndOfFrame);

            World.Serialization.Load(string.Concat(World.MapFolderName, "/", World.MapFileName));
            World.Cached = true;
        }
        timing1.End();
        if (World.Cached && 9 != World.Serialization.Version)
        {
            object[] version = new object[] { "World cache version mismatch: ", (uint)9, " != ", World.Serialization.Version };
            UnityEngine.Debug.LogWarning(string.Concat(version));
            World.Serialization.Clear();
            World.Cached = false;
            if (World.CanLoadFromUrl())
            {
                worldSetup.CancelSetup(string.Concat("World File Outdated: ", World.Name));
            }
        }
        if (World.Cached && string.IsNullOrEmpty(World.Checksum))
        {
            World.Checksum = World.Serialization.Checksum;
        }
        if (World.Cached)
        {
            World.InitSize(World.Serialization.world.size);
        }
        if (worldSetup.terrain)
        {
            TerrainGenerator terrainGenerator = worldSetup.terrain.GetComponent <TerrainGenerator>();
            if (terrainGenerator)
            {
                worldSetup.terrain     = terrainGenerator.CreateTerrain();
                worldSetup.terrainMeta = worldSetup.terrain.GetComponent <TerrainMeta>();
                worldSetup.terrainMeta.Init(null, null);
                worldSetup.terrainMeta.SetupComponents();
                worldSetup.CreateObject(worldSetup.decorPrefab);
                worldSetup.CreateObject(worldSetup.grassPrefab);
                worldSetup.CreateObject(worldSetup.spawnPrefab);
            }
        }
        Timing timing2 = Timing.Start("Spawning World");

        if (World.Cached)
        {
            LoadingScreen.Update("SPAWNING WORLD");
            yield return(CoroutineEx.waitForEndOfFrame);

            yield return(CoroutineEx.waitForEndOfFrame);

            yield return(CoroutineEx.waitForEndOfFrame);

            TerrainMeta.HeightMap.FromByteArray(World.GetMap("terrain"));
            TerrainMeta.SplatMap.FromByteArray(World.GetMap("splat"));
            TerrainMeta.BiomeMap.FromByteArray(World.GetMap("biome"));
            TerrainMeta.TopologyMap.FromByteArray(World.GetMap("topology"));
            TerrainMeta.AlphaMap.FromByteArray(World.GetMap("alpha"));
            TerrainMeta.WaterMap.FromByteArray(World.GetMap("water"));
            IEnumerator enumerator = World.Spawn(0.2f, (string str) => LoadingScreen.Update(str));
            while (enumerator.MoveNext())
            {
                yield return(enumerator.Current);
            }
            TerrainMeta.Path.Clear();
            TerrainMeta.Path.Roads.AddRange(World.GetPaths("Road"));
            TerrainMeta.Path.Rivers.AddRange(World.GetPaths("River"));
            TerrainMeta.Path.Powerlines.AddRange(World.GetPaths("Powerline"));
            enumerator = null;
        }
        timing2.End();
        Timing timing3 = Timing.Start("Processing World");

        if (componentsInChildren.Length != 0)
        {
            for (int i = 0; i < (int)componentsInChildren.Length; i++)
            {
                ProceduralComponent proceduralComponent = componentsInChildren[i];
                if (proceduralComponent && proceduralComponent.ShouldRun())
                {
                    uint num = (uint)((ulong)World.Seed + (long)i);
                    LoadingScreen.Update(proceduralComponent.Description.ToUpper());
                    yield return(CoroutineEx.waitForEndOfFrame);

                    yield return(CoroutineEx.waitForEndOfFrame);

                    yield return(CoroutineEx.waitForEndOfFrame);

                    Timing timing4 = Timing.Start(proceduralComponent.Description);
                    if (proceduralComponent)
                    {
                        proceduralComponent.Process(num);
                    }
                    timing4.End();
                    proceduralComponent = null;
                }
            }
        }
        timing3.End();
        Timing timing5 = Timing.Start("Saving World");

        if (ConVar.World.cache && World.Procedural && !World.Cached)
        {
            LoadingScreen.Update("SAVING WORLD");
            yield return(CoroutineEx.waitForEndOfFrame);

            yield return(CoroutineEx.waitForEndOfFrame);

            yield return(CoroutineEx.waitForEndOfFrame);

            World.Serialization.world.size = World.Size;
            World.AddPaths(TerrainMeta.Path.Roads);
            World.AddPaths(TerrainMeta.Path.Rivers);
            World.AddPaths(TerrainMeta.Path.Powerlines);
            World.Serialization.Save(string.Concat(World.MapFolderName, "/", World.MapFileName));
        }
        timing5.End();
        Timing timing6 = Timing.Start("Calculating Checksum");

        if (string.IsNullOrEmpty(World.Serialization.Checksum))
        {
            LoadingScreen.Update("CALCULATING CHECKSUM");
            yield return(CoroutineEx.waitForEndOfFrame);

            yield return(CoroutineEx.waitForEndOfFrame);

            yield return(CoroutineEx.waitForEndOfFrame);

            World.Serialization.CalculateChecksum();
        }
        timing6.End();
        if (string.IsNullOrEmpty(World.Checksum))
        {
            World.Checksum = World.Serialization.Checksum;
        }
        Timing timing7 = Timing.Start("Ocean Patrol Paths");

        LoadingScreen.Update("OCEAN PATROL PATHS");
        yield return(CoroutineEx.waitForEndOfFrame);

        yield return(CoroutineEx.waitForEndOfFrame);

        yield return(CoroutineEx.waitForEndOfFrame);

        if (!BaseBoat.generate_paths || !(TerrainMeta.Path != null))
        {
            UnityEngine.Debug.Log("Skipping ocean patrol paths, baseboat.generate_paths == false");
        }
        else
        {
            TerrainMeta.Path.OceanPatrolFar = BaseBoat.GenerateOceanPatrolPath(200f, 8f);
        }
        timing7.End();
        Timing timing8 = Timing.Start("Finalizing World");

        LoadingScreen.Update("FINALIZING WORLD");
        yield return(CoroutineEx.waitForEndOfFrame);

        yield return(CoroutineEx.waitForEndOfFrame);

        yield return(CoroutineEx.waitForEndOfFrame);

        if (worldSetup.terrainMeta)
        {
            worldSetup.terrainMeta.BindShaderProperties();
            worldSetup.terrainMeta.PostSetupComponents();
            TerrainMargin.Create();
        }
        World.Serialization.Clear();
        timing8.End();
        LoadingScreen.Update("DONE");
        yield return(CoroutineEx.waitForEndOfFrame);

        yield return(CoroutineEx.waitForEndOfFrame);

        yield return(CoroutineEx.waitForEndOfFrame);

        if (worldSetup)
        {
            GameManager.Destroy(worldSetup.gameObject, 0f);
        }
    }
Esempio n. 51
0
 public void HandleClick()
 {
     if (((this.fullyLoaded && !this.clickedOnPack) && SceneMgr.Get().IsSceneLoaded()) && ((LoadingScreen.Get() == null) || !LoadingScreen.Get().IsTransitioning()))
     {
         MusicManager.Get().StartPlaylist(MusicPlaylistType.Misc_Tutorial01PackOpen);
         this.clickedOnPack = true;
         this.m_playMakerFSM.SendEvent("Action");
     }
 }
Esempio n. 52
0
        private static void PlayLevel(int levelInPlay)
        {
            rock = LoadRock(levelInPlay);
            Level test = GetLevel(levelInPlay);

            PrintLevel(test.board);

            int[] penguinCoord = LoadPenguinCoord(test.board);
            penguinCoordRow          = penguinCoord[0];
            penguinCoordCol          = penguinCoord[1];
            int[,] finalRockPosition = TargetPosition(test.board);

            int stepsCount = 0;

            // Time
            PrintStringOnPosition(5, 25, "Time: " + timeCount, ConsoleColor.Red);
            // Steps
            PrintStringOnPosition(25, 25, "Steps: " + stepsCount, ConsoleColor.Blue);
            // Lives
            PrintStringOnPosition(45, 25, "Score: " + score, ConsoleColor.Green);
            //Reset level
            PrintStringOnPosition(63, 13, "[RESET]", ConsoleColor.Yellow);
            PrintStringOnPosition(62, 15, "Press \"R\"", ConsoleColor.Yellow);

            DateTime controlTime = DateTime.Now;

            //Penguin move if possible
            while (true)
            {
                if (Math.Abs(DateTime.Now.Second - controlTime.Second) > 0)
                {
                    controlTime = DateTime.Now;
                    timeCount++;
                    PrintStringOnPosition(5, 25, "Time: " + timeCount, ConsoleColor.Red);
                }
                if (Console.KeyAvailable)
                {
                    ConsoleKeyInfo pressedKey = Console.ReadKey(true);

                    while (Console.KeyAvailable)
                    {
                        Console.ReadKey(true);
                    }

                    if (pressedKey.KeyChar == 'R')
                    {
                        Console.Clear();
                        rock = LoadRock(levelInPlay);
                        test = GetLevel(levelInPlay);
                        PrintLevel(test.board);

                        penguinCoord      = LoadPenguinCoord(test.board);
                        penguinCoordRow   = penguinCoord[0];
                        penguinCoordCol   = penguinCoord[1];
                        finalRockPosition = TargetPosition(test.board);

                        stepsCount = 0;
                        // Time
                        PrintStringOnPosition(5, 25, "Time: " + timeCount, ConsoleColor.Red);
                        // Steps
                        PrintStringOnPosition(25, 25, "Steps: " + stepsCount, ConsoleColor.Blue);
                        // Lives
                        PrintStringOnPosition(45, 25, "Score: " + score, ConsoleColor.Green);
                        // some score?
                        //Reset level
                        PrintStringOnPosition(63, 13, "[RESET]", ConsoleColor.Yellow);
                        PrintStringOnPosition(62, 15, "Press \"R\"", ConsoleColor.Yellow);
                    }

                    if (pressedKey.Key == ConsoleKey.LeftArrow)
                    {
                        //move left
                        stepsCount += MovePlayer(test.board, 0, -1);
                    }
                    else if (pressedKey.Key == ConsoleKey.RightArrow)
                    {
                        //move right
                        stepsCount += MovePlayer(test.board, 0, 1);
                    }
                    else if (pressedKey.Key == ConsoleKey.UpArrow)
                    {
                        //move up
                        stepsCount += MovePlayer(test.board, -1, 0);
                    }
                    else if (pressedKey.Key == ConsoleKey.DownArrow)
                    {
                        //move down
                        stepsCount += MovePlayer(test.board, 1, 0);
                    }

                    PrintStringOnPosition(25, 25, "Steps: " + stepsCount, ConsoleColor.Blue);


                    if (CheckSolved(test.board) == true)
                    {
                        Console.Clear();
                        LoadingScreen.MainLoading(levelInPlay);
                        Thread.Sleep(300);
                        score += (int)(timeCount * 100 / stepsCount * (levelInPlay + 1));
                        levelInPlay++;
                        timeCount = 0;
                        break;
                    }
                }
            }
            return;
        }
Esempio n. 53
0
 public void LoadScene(int levelIndex)
 {
     LoadingScreen.LoadScene(levelIndex);
 }
Esempio n. 54
0
 void LoadScene(string scene)
 {
     loadingScreenController = GetLoadingScreen();
     loadingScreenController.StartLoadingScreen(scene);
 }
Esempio n. 55
0
        void Current_Activated(object sender, ActivatedEventArgs e)
        {
            Debug.WriteLine("activating event...");
            if (PhoneApplicationService.Current.State.ContainsKey("loading"))
            {

            }

            //if (MediaPlayer.State == MediaState.Playing) isBackgroundSong = true;

            backScreen = PhoneApplicationService.Current.State["background"] as SplashScreen;
            loadingScreen = PhoneApplicationService.Current.State["loading"] as LoadingScreen;

            if (PhoneApplicationService.Current.State.ContainsKey("Unsaved_To"))
            {
                tem = hel;
                attackGame.GameplayHelper = hel;
                //tem  = PhoneApplicationService.Current.State["Unsaved_To"] as GameplayHelper;
                PhoneApplicationService.Current.State.Remove("Unsaved_To");
                Debug.WriteLine("ima");
            }

            ReloadRequired = true;

            //PhoneApplicationService.Current.State[InGameKey] = true;

            screenManager = new ScreenManager(this);

            // Display the main screen
            screenManager.AddScreen(new SplashScreen());
            screenManager.AddScreen(new LoadingScreen());
        }
Esempio n. 56
0
 private void Start()
 {
     LoadingScreen.TransiteFrom();
     print("SELECTED_BOOK::" + PlayerPrefs.GetInt("SELECTED_BOOK", -1));
 }
Esempio n. 57
0
    // Use this for initialization
    void Start()
    {
        GameObject   sax  = GameObject.Find("saveassigner");
        SaveAssigner sa   = sax.GetComponent(typeof(SaveAssigner)) as SaveAssigner;
        int          file = -1;

        pp = GameObject.FindGameObjectWithTag("Player");
        if (sa.isLoading)
        {
            file = sa.savefile;
            SaveData data = SaveData.Load(Application.streamingAssetsPath + "\\" + file + ".uml");
            player = GameObject.FindGameObjectWithTag("Player");
            PlayerController playerscript = player.GetComponent(typeof(PlayerController)) as PlayerController;
            Spells           spells       = player.GetComponent(typeof(Spells)) as Spells;
            PlayerTalents    talents      = player.GetComponent(typeof(PlayerTalents)) as PlayerTalents;
            Items            other        = player.GetComponent(typeof(Items)) as Items;

            playerscript.name            = data.GetValue <string>("name");
            playerscript.gender          = data.GetValue <string>("gender");
            playerscript.CheckpointLevel = data.GetValue <string>("checkpointlevel");
            playerscript.CheckpointName  = data.GetValue <string>("checkpointname");
            playerscript.bagisFull       = data.GetValue <bool>("bagisfull");
            playerscript.equipSpelltoL(data.GetValue <int>("equippedspellL"));
            playerscript.equipSpelltoR(data.GetValue <int>("equippedspellR"));
            playerscript.equipSpellto1(data.GetValue <int>("equippedspell1"));
            playerscript.equipSpellto2(data.GetValue <int>("equippedspell2"));
            playerscript.equipSpelltoQ(data.GetValue <int>("equippedspellQ"));
            playerscript.equipSpelltoQ2(data.GetValue <int>("equippedspellQ2"));
            playerscript.xp          = data.GetValue <float>("xp");
            playerscript.level       = data.GetValue <int>("level");
            playerscript.maxHealth   = data.GetValue <int>("maxhealth");
            playerscript.max_stamina = data.GetValue <int>("maxstamina");
            spells.UnlockedSpells    = data.GetValue <int[]>("unlockedspells");
            spells.UnlockedHats      = data.GetValue <int[]>("unlockedhats");
            spells.UnlockedAmulets   = data.GetValue <int[]>("unlockedamulets");
            spells.UnlockedTunics    = data.GetValue <int[]>("unlockedtunics");
            spells.PickedUpItems     = data.GetValue <int[]>("pickedupitems");
            spells.ItemCount         = data.GetValue <int>("itemcount");
            playerscript.equipHat(data.GetValue <int>("equippedhat"));
            playerscript.equipTunic(data.GetValue <int>("equippedtunic"));
            playerscript.equipAmulet(data.GetValue <int>("equippedamulet"));
            spells.bagSpace        = data.GetValue <int>("bagspace");
            spells.bagIsFull       = data.GetValue <bool>("bagisfull");
            spells.SpellCount      = data.GetValue <int>("spellcount");
            spells.SpellSpace      = data.GetValue <int>("spellspace");
            spells.SpellBookIsFull = data.GetValue <bool>("spellbookisfull");
            spells.HatCount        = data.GetValue <int>("hatcount");
            spells.HatSpace        = data.GetValue <int>("hatspace");
            spells.HatIsFull       = data.GetValue <bool>("hatisfull");
            spells.AmuletCount     = data.GetValue <int>("amuletcount");
            spells.AmuletIsFull    = data.GetValue <bool>("amuletisfull");
            spells.AmuletSpace     = data.GetValue <int>("amuletspace");
            spells.TunicCount      = data.GetValue <int>("tuniccount");
            spells.TunicSpace      = data.GetValue <int>("tunicspace");
            spells.TunicIsFull     = data.GetValue <bool>("tunicisfull");

            talents.Declared      = data.GetValue <bool>("declared");
            talents.declaration   = data.GetValue <string>("declaration");
            playerscript.numheals = 5;


            if (talents.Declared)
            {
                bool[] mys    = data.GetValue <bool[]>("talentsmystery");
                bool[] rea    = data.GetValue <bool[]>("talentsreachable");
                bool[] vis    = data.GetValue <bool[]>("talentsvisible");
                bool[] gotten = data.GetValue <bool[]>("talentsgotten");
                if (talents.declaration == "Inorganic")
                {
                    for (int c = 0; c < talents.Inorganic_Talents_t1.Length; ++c)
                    {
                        talents.Inorganic_Talents_t1[c].mystery   = mys[c];
                        talents.Inorganic_Talents_t1[c].reachable = rea[c];
                        talents.Inorganic_Talents_t1[c].visible   = vis[c];
                        talents.Inorganic_Talents_t1[c].gotten    = gotten[c];
                    }
                }
                else if (talents.declaration == "Organic")
                {
                    for (int c = 0; c < talents.Organic_Talents.Length; ++c)
                    {
                        talents.Organic_Talents[c].mystery   = mys[c];
                        talents.Organic_Talents[c].reachable = rea[c];
                        talents.Organic_Talents[c].visible   = vis[c];
                        talents.Organic_Talents[c].gotten    = gotten[c];
                    }
                }
                else
                {
                    for (int c = 0; c < talents.Biolchem_Talents.Length; ++c)
                    {
                        talents.Biolchem_Talents[c].mystery   = mys[c];
                        talents.Biolchem_Talents[c].reachable = rea[c];
                        talents.Biolchem_Talents[c].visible   = vis[c];
                        talents.Biolchem_Talents[c].gotten    = gotten[c];
                    }
                }
            }
            bool[] wat = data.GetValue <bool[]>("items");
            for (int c = 0; c < wat.Length; ++c)
            {
                other.VodExterior[c] = wat[c];
            }
            wat = data.GetValue <bool[]>("bosses");
            for (int c = 0; c < wat.Length; ++c)
            {
                other.bosses[c] = wat[c];
            }
            if (data.HasKey("spellpower"))
            {
                playerscript.SPELLPOWERBONUS = data.GetValue <float>("spellpower");
            }
            playerscript.currentHealth = playerscript.maxHealth;
            playerscript.savefile      = file;
            StartCoroutine(LoadingScreen.LoadLevelSCREEN(playerscript.CheckpointLevel));
            if (data.HasKey("energyclusterloc"))
            {
                Vector3    pos = data.GetValue <Vector3>("energyclusterloc");
                GameObject wa;
                if (pos != null)
                {
                    wa  = Instantiate(Resources.Load("EnergyCluster")) as GameObject;
                    ecs = wa.GetComponent <EnergyClusterScript>();
                    wa.transform.position = pos;
                    ecs.levelname         = data.GetValue <string>("energyclusterlevel");
                    ecs.worth             = data.GetValue <float>("energyclusterworth");
                }
            }
            StartCoroutine(checkpointerputter(playerscript.CheckpointName));
            if (data.HasKey("energyclusterlevel"))
            {
                StartCoroutine(delayassigner(data.GetValue <string>("energyclusterlevel"), ecs));
            }
        }
        else
        {
            // new game
            GameObject       player       = GameObject.FindGameObjectWithTag("Player");
            PlayerController playerscript = player.GetComponent(typeof(PlayerController)) as PlayerController;
            Spells           s            = player.GetComponent(typeof(Spells)) as Spells;
            playerscript.CheckpointLevel = "Castle_Vod";
            playerscript.CheckpointName  = "Checkpoint1";
            playerscript.currentHealth   = playerscript.maxHealth;
            playerscript.savefile        = sa.savefile;
            playerscript.name            = sa.name;
            s.AddItem(11);
            playerscript.gender = sa.gender;
            Instantiate(Resources.Load("Saved"));
            StartCoroutine(checkpointerputter("Checkpoint1"));
            StartCoroutine(LoadingScreen.LoadLevelSCREEN("Castle_Vod"));
            //StartCoroutine(LoadingScreen.LoadLevelSCREEN("Castle_Vod");
        }
    }
Esempio n. 58
0
 void Start()
 {
     gameManager = GameObject.Find("GameManager");
     loadingScreen = gameManager.GetComponent<LoadingScreen>();
     playerName = PlayerPrefs.GetString("playerName");
 }
Esempio n. 59
0
 // Use this for initialization
 void Start()
 {
     _loadingScreen = GameObject.Find("Loading").GetComponent<LoadingScreen>();
 }
Esempio n. 60
0
        private void btValidarCaja_Click(object sender, EventArgs e)
        {
            if (cmbCaja.SelectedIndex >= 0)
            {
                OpenFileDialog ofd = new OpenFileDialog();
                ofd.Filter          = "Comma-Separated Values (*.csv)|*.csv|All files (*.*)|*.*";
                ofd.CheckFileExists = true;
                ofd.CheckPathExists = true;
                string strSQL = "";
                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    LoadingScreen.iniciarLoading();

                    DataTable dt = new DataTable();
                    //dt = GlobalFunctions.ConvertCsvToDataTable2(ofd.FileName);
                    if (dt is null)
                    {
                        return;
                    }

                    DataTable dt2 = new DataTable("INVENTARIO_GENERAL");

                    if (!Conexion.conectar())
                    {
                        return;
                    }

                    strSQL = "SELECT NUMERO_DE_CAJA, DESCRIPCION_1, DESCRIPCION_2, DESCRIPCION_3, DESCRIPCION_4 FROM INVENTARIO_GENERAL WHERE USUARIO_POSEE = 'DOCUCLASS'";

                    if (!Conexion.iniciaCommand(strSQL))
                    {
                        return;
                    }
                    if (!Conexion.ejecutarQuery())
                    {
                        return;
                    }

                    dt2 = Conexion.llenarDataTable();
                    if (dt2 is null)
                    {
                        return;
                    }


                    var result = from c1 in dt2.AsEnumerable()
                                 join c2 in dt.AsEnumerable() on c1.Field <string>("DESCRIPCION_2") equals c2.Field <string>("Nro de Solicitud") into j
                                 from p in j.DefaultIfEmpty()
                                 select new
                    {
                        DESC_1       = c1.Field <string>("DESCRIPCION_1"),
                        DESC_2       = c1.Field <string>("DESCRIPCION_2"),
                        DESC_3       = c1.Field <string>("DESCRIPCION_3"),
                        DESC_4       = c1.Field <string>("DESCRIPCION_4"),
                        DOCU_SISGO   = p is null ? null : p.Field <string>("Nro de Solicitud"),
                        FECHA_SUBIDO = p is null ? null : p.Field <string>("Archived Date")
                    };

                    var result2 = from c1 in result
                                  group c1.DOCU_SISGO by new { X1 = c1.DESC_1, X2 = c1.DESC_2, X3 = c1.DESC_3, X4 = c1.DESC_4, X5 = c1.DOCU_SISGO } into j
                    from p in j.DefaultIfEmpty()
                    select new
                    {
                        DESC_1       = j.Key.X1,
                        DESC_2       = j.Key.X2,
                        DESC_3       = j.Key.X3,
                        DESC_4       = j.Key.X4,
                        N_DOCUMENTOS = j.Key.X5 is null? 0 : j.Count()
                    };

                    dgv.DataSource = result2.Distinct().ToList();

                    LoadingScreen.cerrarLoading();
                }
            }
        }
    }
}