private void AddSeconds()
 {
     secondBonus.SetActive(false);
     ProgressTime.getInstance().CountingTime = true;
     ProgressTime.getInstance().TimeSeconds += Config.SECOND_BONUS;
     Destroy(gameObject);
 }
Esempio n. 2
0
        // Metodo que da inicio a la emulacion del terremoto
        private void StartEarthQuake()
        {
            clock.SetActive(true);
            ProgressTime progressTime = clock.GetComponentInChildren <ProgressTime>();

            progressTime.TimeAmt      = nivel.Seconds;
            progressTime.TimeSeconds  = nivel.Seconds;
            progressTime.CountingTime = true;
            music.Play();
        }
Esempio n. 3
0
 private void ProgressTime_Tick(object sender, EventArgs e)
 {
     start           += 1;
     MyProgress.Value = start;
     if (MyProgress.Value == 100)
     {
         MyProgress.Value = 0;
         ProgressTime.Stop();
         LoginForm login = new LoginForm();
         login.Show();
         this.Hide();
     }
 }
 /**
  * Metodo que es invocado cuando el collider del jugador colisione con un colider del tipo trigger,
  * en este caso es usado para detectar cuando el jugador haya logrado salir del edificio,
  * siguiendo las indicaciones y rutas de evacuacion para ponerse a salvo y ganar la partida
  **/
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals(Config.TAG_PLAYER))
     {
         if (this.tag.Equals(Config.TAG_EXIT))
         {
             Debug.Log("Salio del mayor");
             GameObject.FindWithTag(Config.TAG_PLAYER).GetComponent <PlayerMovementControl>().setEnableFps(false);
             GameObject.FindWithTag(Config.TAG_GAME_CONTROLLER).GetComponent <GameController>().EvaluateVictory();
         }
         else
         {
             ProgressTime.getInstance().CountingTime = false;
             secondBonus.SetActive(true);
             Debug.Log("Entro a punto de control");
             Invoke("AddSeconds", 3);
         }
     }
 }
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteBoolean(IsEmpty);
                if (!IsEmpty)
                {
                    if (WarTable == null)
                    {
                        WarTable = new WarTable();
                    }
                    WarTable.Write(io);
                }
                if (_isfirst)
                {
                    if (SStructure.ProjectVersion < 0x1A)
                    {
                        io.WriteInt32(ProgressTime.ToUnixSecondsNoAdd());
                    }
                    else
                    {
                        io.WriteInt64(ProgressTime.ToUnixSecondsNoAdd());
                    }
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Esempio n. 6
0
        private void _ShowProgress(string text, ProgressType type = ProgressType.Loading, ProgressTime time = ProgressTime.Infinite, List <string> buttons = null)
        {
            HideProgress();
            _lastTime            = time;
            _isProgressCompleted = false;
            _progressText.Text   = text;

            if (!string.IsNullOrEmpty(text))
            {
                _logoGrid.Visibility = Visibility.Collapsed;
            }
            _progressGrid.Visibility = Visibility.Visible;

            _progressRing.Visibility    = Visibility.Collapsed;
            _progressImage.Visibility   = Visibility.Collapsed;
            _progressText.TextWrapping  = TextWrapping.NoWrap;
            _progressButtons.Visibility = Visibility.Collapsed;

            switch (type)
            {
            case ProgressType.Loading:
                _progressRing.Visibility = Visibility.Visible;
                break;

            case ProgressType.Success:
                BackgroundAnimation(Colors.Green);
                _progressImage.Visibility = Visibility.Visible;
                _progressImage.Source     = new BitmapImage(new Uri("/Assets/success.png", UriKind.RelativeOrAbsolute));
                break;

            case ProgressType.Warning:
                BackgroundAnimation(Color.FromArgb(0xFF, 0xFF, 0x72, 0x56));
                _progressImage.Visibility = Visibility.Visible;
                _progressImage.Source     = new BitmapImage(new Uri("/Assets/warning.png", UriKind.RelativeOrAbsolute));
                break;

            case ProgressType.Error:
                BackgroundAnimation(Colors.Red);
                _progressImage.Visibility = Visibility.Visible;
                _progressImage.Source     = new BitmapImage(new Uri("/Assets/error.png", UriKind.RelativeOrAbsolute));
                break;

            default:
                break;
            }

            if (buttons != null && buttons.Count() != 0)
            {
                int i = 0;
                foreach (var buttonText in buttons)
                {
                    var button = new Button()
                    {
                        Value = buttonText
                    };
                    _progressButtons.ColumnDefinitions.Add(new ColumnDefinition()
                    {
                        Width = new GridLength(1, GridUnitType.Star)
                    });
                    Grid.SetColumn(button, i);
                    button.Clicked += (s, e) =>
                    {
                        if (HeaderConfirmed != null)
                        {
                            HeaderConfirmed(Grid.GetColumn(s as Button));
                        }
                        HideProgress();
                    };
                    _progressButtons.Children.Add(button);
                    i++;
                }
                _progressButtons.Visibility = Visibility.Visible;
            }

            HeightControl();

            if (time != ProgressTime.Infinite)
            {
                var timer = new DispatcherTimer();
                if (time == ProgressTime.Short)
                {
                    timer.Interval = TimeSpan.FromMilliseconds(1000);
                }
                else if (time == ProgressTime.Normal)
                {
                    timer.Interval = TimeSpan.FromMilliseconds(1750);
                }
                else
                {
                    timer.Interval = TimeSpan.FromMilliseconds(2500);
                }
                timer.Tick += (c, r) =>
                {
                    _isProgressCompleted = true;
                    HideProgress();
                    timer.Stop();
                };
                timer.Start();
            }
            else
            {
                _isProgressCompleted = false;
            }
        }
Esempio n. 7
0
 public static void ShowProgress(string text, ProgressType type = ProgressType.Loading, ProgressTime time = ProgressTime.Infinite, List <string> buttons = null)
 {
     if (_isHeaderLoaded)
     {
         if (_isProgressCompleted || _lastTime == ProgressTime.Infinite)
         {
             if (Current != null)
             {
                 Current._ShowProgress(text, type, time, buttons);
             }
         }
         else
         {
             _progressStack.Push(() =>
             {
                 if (Current != null)
                 {
                     Current._ShowProgress(text, type, time, buttons);
                 }
             });
         }
     }
     else
     {
         _onHeaderLoaded += (s, e) =>
         {
             if (_isProgressCompleted || _lastTime == ProgressTime.Infinite)
             {
                 if (Current != null)
                 {
                     Current._ShowProgress(text, type, time, buttons);
                 }
             }
             else
             {
                 _progressStack.Push(() =>
                 {
                     if (Current != null)
                     {
                         Current._ShowProgress(text, type, time, buttons);
                     }
                 });
             }
         };
     }
 }
Esempio n. 8
0
 public static void ShowProgress(string text = null, ProgressType type = ProgressType.Loading, ProgressTime time = ProgressTime.Infinite, List <string> buttons = null)
 {
     RootFrame.Dispatcher.BeginInvoke(() =>
     {
         Logger.HeaderChanged(text);
         Header.ShowProgress(text, type, time, buttons);
     });
 }
Esempio n. 9
0
        public void ShowProgress(string text, ProgressType type = ProgressType.Loading, ProgressTime time = ProgressTime.Infinite)
        {
            IsProgressCompleted = false;
            ProgressText.Text   = text;
            if (!string.IsNullOrEmpty(text))
            {
                LogoGrid.Visibility = Visibility.Collapsed;
            }
            ProgressGrid.Visibility = Visibility.Visible;

            ProgressRing.Visibility  = Visibility.Collapsed;
            ProgressImage.Visibility = Visibility.Collapsed;

            switch (type)
            {
            case ProgressType.Loading:
                ProgressRing.Visibility = Visibility.Visible;
                break;

            case ProgressType.Success:
                ProgressImage.Visibility = Visibility.Visible;
                ProgressImage.Source     = new BitmapImage(new Uri("/Assets/success.png", UriKind.RelativeOrAbsolute));
                break;

            case ProgressType.Warning:
                ProgressImage.Visibility = Visibility.Visible;
                ProgressImage.Source     = new BitmapImage(new Uri("/Assets/warning.png", UriKind.RelativeOrAbsolute));
                break;

            case ProgressType.Error:
                ProgressImage.Visibility = Visibility.Visible;
                ProgressImage.Source     = new BitmapImage(new Uri("/Assets/error.png", UriKind.RelativeOrAbsolute));
                break;

            default:
                break;
            }

            if (time != ProgressTime.Infinite)
            {
                var timer = new DispatcherTimer();
                if (time == ProgressTime.Short)
                {
                    timer.Interval = TimeSpan.FromMilliseconds(1000);
                }
                else if (time == ProgressTime.Normal)
                {
                    timer.Interval = TimeSpan.FromMilliseconds(1750);
                }
                else
                {
                    timer.Interval = TimeSpan.FromMilliseconds(2500);
                }
                timer.Tick += (c, r) =>
                {
                    IsProgressCompleted = true;
                    HideProgress();
                    timer.Stop();
                };
                timer.Start();
            }
            else
            {
                IsProgressCompleted = true;
            }
        }
Esempio n. 10
0
 private void Form1_Load(object sender, EventArgs e)
 {
     ProgressTime.Start();
 }