示例#1
0
    bool DrawSignInButton()
    {
        DrawSignInBar();

        // draw the sign in button
        GUI.skin = SignInButtonGuiSkin;
        bool result = Gu.Button(Gu.Center(GameConsts.Menu.SignInButtonX),
                                Gu.Bottom(GameConsts.Menu.SignInButtonY),
                                Gu.Dim(GameConsts.Menu.SignInButtonWidth),
                                Gu.Dim(GameConsts.Menu.SignInButtonHeight),
                                Gu.Dim(GameConsts.Menu.SignInButtonFontSize),
                                "     " + Strings.SignIn);

        GUI.skin = GuiSkin;

        // draw the Google+ logo
        GUI.DrawTexture(new Rect(Gu.Center(GameConsts.Menu.GooglePlusLogoX),
                                 Gu.Bottom(GameConsts.Menu.GooglePlusLogoY),
                                 Gu.Dim(GameConsts.Menu.GooglePlusLogoSize),
                                 Gu.Dim(GameConsts.Menu.GooglePlusLogoSize)), GooglePlusTex);

        // draw sign in encouragement text
        DrawSignInBlurb(Strings.SignInBlurb);

        return(result);
    }
示例#2
0
    //This is where we perform the actual action based on
    // the given tag
    void performAction(string tag)
    {
        Gu gu = Gu.Instance;

        switch (tag)
        {
        case "Large Object":
            gu.StartPush();
            break;

        case "Small Object":
            if (gu.IsCarrying())
            {
                print("butts");
                gu.PutDown();
            }
            else
            {
                print("dicks");
                gu.PickUp();
            }
            break;

        default:
            break;
        }
    }
 void DrawTitle()
 {
     Gu.SetColor(Color.black);
     Gu.Label(Gu.Center(0), Gu.Middle(GameConsts.PauseScreen.TitleY),
              Gu.Dim(GameConsts.PauseScreen.TitleFontSize),
              Strings.GamePaused);
 }
示例#4
0
        void OnGUI()
        {
            int stars;

            GUI.skin = GuiSkin;

            DrawHud();

            switch (mGameState)
            {
            case GameState.GameOver:
                ShowCenteredMessage(mGameOverReason == GameOverReason.CiviliansDied ?
                                    Strings.GameOverCiviliansDied : Strings.GameOverPlayerDied,
                                    Strings.RetryingIn);
                GameManager.Instance.AutoSave();
                break;

            case GameState.Won:
                // show the "Level Cleared" message
                ShowCenteredMessage(Strings.LevelCleared, Strings.NextLevelIn);

                // show # of stars earned
                stars = CalcStars();
                Gu.Label(Gu.Center(0), Gu.Middle(GameConsts.StarsY),
                         Gu.Dim(GameConsts.StarsFontSize), Util.MakeStars(stars));

                // show message based on # of stars
                Gu.SetColor(GameConsts.StarsMessageColor);
                Gu.Label(Gu.Center(0), Gu.Middle(GameConsts.StarsMessageY),
                         Gu.Dim(GameConsts.StarsMessageFontSize),
                         Strings.StarsMessage[stars]);
                GameManager.Instance.AutoSave();
                break;
            }
        }
    void OnGUI()
    {
        GUI.skin = GuiSkin;

        int i, j;

        for (i = 0; i < Rows; i++)
        {
            for (j = 0; j < Cols; j++)
            {
                int level = i * Cols + j;
                if (DrawLevelButton(level, j, i))
                {
                    // level clicked
                    Beep();
                    GameManager.Instance.GoToLevel(level);
                    return;
                }
            }
        }

        Gu.SetColor(Color.white);
        if (DrawUpButton())
        {
            this.enabled = false;
            gameObject.GetComponent <MainMenuGUI>().enabled = true;
            Beep();
        }
    }
 bool DrawPauseButton()
 {
     return(GUI.Button(new Rect(
                           Gu.Right(GameConsts.PauseScreen.PauseButtonX),
                           Gu.Bottom(GameConsts.PauseScreen.PauseButtonY),
                           Gu.Dim(GameConsts.PauseScreen.PauseButtonSize),
                           Gu.Dim(GameConsts.PauseScreen.PauseButtonSize)), PauseButtonTexture));
 }
示例#7
0
 void DrawTitle()
 {
     Gu.SetColor(GameConsts.ThemeColor);
     Gu.Label(Gu.Center(0),
              (int)Util.Interpolate(0.0f, 0.0f, 1.0f, Gu.Top(GameConsts.Menu.TitleY),
                                    mTransition.NormalizedElapsed),
              Gu.Dim(GameConsts.Menu.TitleFontSize), Strings.GameTitle);
 }
 public List <BE.BankAccount> GetBankList()
 {
     if (DataSource.Banks == null)
     {
         throw new SomeException("הרשימה ריקה ");
     }
     return(DataSource.Banks.Select(Gu => (BankAccount)Gu.Clone()).ToList());
 }
 public List <BE.Order> GetOrderList()
 {
     if (DataSource.Orders == null)
     {
         throw new SomeException("הרשימה ריקה ");
     }
     return(XMLHandler.GetXMLHandler().LoadOrderFile().Select(Gu => (Order)Gu.Clone()).ToList());
 }
 public List <BE.Host> GetHostList()
 {
     if (DataSource.Hosts == null)
     {
         throw new SomeException("הרשימה ריקה ");
     }
     return(XMLHandler.GetXMLHandler().LoadHostFile().Select(Gu => (Host)Gu.Clone()).ToList());
 }
示例#11
0
 public List <BE.Passworde> GetPasswordList()
 {
     if (DataSource.pass == null)
     {
         throw new SomeException("אין קודים שמורים במערכת  ");
     }
     return(DataSource.pass.Select(Gu => (Passworde)Gu.Clone()).ToList());
 }
示例#12
0
 public List <BE.Order> GetOrderList()
 {
     if (DataSource.Orders == null)
     {
         throw new SomeException("הרשימה ריקה ");
     }
     return(DataSource.Orders.Select(Gu => (Order)Gu.Clone()).ToList());
 }
示例#13
0
 public List <BE.Host> GetHostList()
 {
     if (DataSource.Hosts == null)
     {
         throw new SomeException("הרשימה ריקה ");
     }
     return(DataSource.Hosts.Select(Gu => (Host)Gu.Clone()).ToList());
 }
示例#14
0
 bool DrawSignOutButton()
 {
     return(Gu.Button(Gu.Right(GameConsts.Menu.SignOutButtonX),
                      Gu.Bottom(GameConsts.Menu.SignOutButtonY),
                      Gu.Dim(GameConsts.Menu.SignOutButtonWidth),
                      Gu.Dim(GameConsts.Menu.SignOutButtonHeight),
                      Gu.Dim(GameConsts.Menu.SignInButtonFontSize),
                      Strings.SignOut));
 }
示例#15
0
    void OnGUI()
    {
        GUI.skin = GuiSkin;
        Vector3 pos = Camera.main.WorldToScreenPoint(gameObject.transform.position);

        Gu.SetColor(ToastColor);
        Gu.Label((int)pos.x, Screen.height - (int)pos.y, Gu.Dim(GameConsts.ScoreToastFontSize),
                 Value.ToString());
    }
示例#16
0
 public Form1()
 {
     gu                     = new Gu();
     times                  = new int[10];
     bg.DoWork             += Bg_DoWork;
     bg.RunWorkerCompleted += Bg_RunWorkerCompleted;
     InitializeComponent();
     g = panel1.CreateGraphics();
 }
示例#17
0
        void ShowCenteredMessage(string centerMessage, string restartMessage)
        {
            int rem = (int)Mathf.Ceil(mAutoAdvanceCountdown.Remaining);

            Gu.SetColor(Color.black);
            Gu.Label(Gu.Center(0), Gu.Middle(0), Gu.Dim(GameConsts.GameOverFontSize), centerMessage);
            Gu.Label(Gu.Center(0), Gu.Middle(GameConsts.RetryTextOffset),
                     Gu.Dim(GameConsts.RetryTextFontSize), restartMessage + " " + rem);
        }
示例#18
0
    void DrawSignInBar()
    {
        // draw the sign-in bar (the white bar behind the sign in button)
        Rect r = new Rect(Gu.Left(0), Gu.Bottom(GameConsts.Menu.SignInBarY),
                          (int)Util.Interpolate(0.0f, 0.0f, 1.0f, Screen.width,
                                                mTransition.NormalizedElapsed),
                          Gu.Dim(GameConsts.Menu.SignInBarHeight));

        GUI.DrawTexture(r, SignInBarTex);
    }
 bool DrawQuitButton()
 {
     Gu.SetColor(Color.white);
     return(Gu.Button(Gu.Center(GameConsts.PauseScreen.QuitX),
                      Gu.Middle(GameConsts.PauseScreen.QuitY),
                      Gu.Dim(GameConsts.PauseScreen.ButtonWidth),
                      Gu.Dim(GameConsts.PauseScreen.ButtonHeight),
                      Gu.Dim(GameConsts.PauseScreen.ButtonFontSize),
                      Strings.QuitGame));
 }
 bool DrawUpButton()
 {
     return(Gu.Button(
                Gu.Left(GameConsts.Menu.UpButtonLeft),
                Gu.Top(GameConsts.Menu.UpButtonTop),
                Gu.Dim(GameConsts.Menu.UpButtonWidth),
                Gu.Dim(GameConsts.Menu.UpButtonHeight),
                Gu.Dim(GameConsts.Menu.UpButtonFontSize),
                "<<"));
 }
    bool DrawQuitButton()
    {
        float w = GameConsts.Menu.AchButtonWidth;
        float h = GameConsts.Menu.AchButtonHeight;
        float x = -500;
        float y = 200;

        return(Gu.Button(Gu.Center(x), Gu.Middle(y),
                         Gu.Dim(w), Gu.Dim(h),
                         Gu.Dim(GameConsts.Menu.AchFontSize),
                         Strings.QuitGame));
    }
示例#22
0
    void DrawSignInBlurb(string text)
    {
        bool  authenticated = GameManager.Instance.Authenticated;
        float x             = authenticated ? 0.0f : GameConsts.Menu.SignInBlurbX;

        // draw sign in explanation text
        Gu.SetColor(authenticated ? GameConsts.Menu.SignedInBlurbColor :
                    GameConsts.Menu.SignInBlurbColor);
        Gu.Label(Gu.Center(x),
                 Gu.Bottom(GameConsts.Menu.SignInBlurbY),
                 Gu.Dim(GameConsts.Menu.SignInBlurbFontSize),
                 text);
    }
示例#23
0
    public void DrawPilotInfo()
    {
        Gu.SetColor(Color.black);
        PilotStats stats    = GameManager.Instance.Progress.CurPilotStats;
        float      fontSize = SmallFormat ? GameConsts.Menu.PilotInfoFontSizeSmall :
                              GameConsts.Menu.PilotInfoFontSize;
        float y = SmallFormat ? GameConsts.Menu.PilotInfoYSmallFont :
                  GameConsts.Menu.PilotInfoY;

        // show summary info
        string summary;

        if (GameManager.Instance.Progress.IsMaxLevel())
        {
            summary = string.Format(Strings.ExpStringMaxLevel,
                                    stats.Level, stats.Title,
                                    GameManager.Instance.Progress.PilotExperience);
        }
        else
        {
            summary = string.Format(Strings.ExpString,
                                    stats.Level, stats.Title,
                                    GameManager.Instance.Progress.PilotExperience,
                                    GameManager.Instance.Progress.GetExpForNextLevel());
        }

        if (ShowPilotLevel)
        {
            Gu.Label(Gu.Left(GameConsts.Menu.PilotInfoX),
                     Gu.Top(y), Gu.Dim(fontSize),
                     summary, false);
        }

        if (!SmallFormat)
        {
            int total = GameManager.Instance.Progress.TotalScore;
            int stars = GameManager.Instance.Progress.TotalStars;
            Gu.Label(Gu.Right(GameConsts.Menu.TotalScoreLabelX),
                     Gu.Top(GameConsts.Menu.TotalScoreLabelY),
                     Gu.Dim(GameConsts.Menu.TotalScoreLabelFontSize),
                     Strings.TotalScore);
            Gu.Label(Gu.Right(GameConsts.Menu.TotalScoreX),
                     Gu.Top(GameConsts.Menu.TotalScoreY),
                     Gu.Dim(GameConsts.Menu.TotalScoreFontSize),
                     total.ToString("D7"));
            Gu.Label(Gu.Right(GameConsts.Menu.StarsX),
                     Gu.Top(GameConsts.Menu.StarsY),
                     Gu.Dim(GameConsts.Menu.StarsFontSize),
                     string.Format(Strings.TotalStarsFmt, stars));
        }
    }
示例#24
0
    bool DrawPlayButton()
    {
        float w = GameConsts.Menu.PlayButtonWidth;
        float h = GameConsts.Menu.PlayButtonHeight;

        Gu.SetColor(Color.white);
        return(Gu.Button(
                   Gu.Center(-w / 2),
                   (int)Util.Interpolate(0.0f, Screen.height, 1.0f, Gu.Middle(-h / 2),
                                         mTransition.NormalizedElapsed),
                   Gu.Dim(w), Gu.Dim(h),
                   Gu.Dim(GameConsts.Menu.PlayButtonFontSize),
                   Strings.Play));
    }
示例#25
0
    bool DrawLbButton()
    {
        float w = GameConsts.Menu.LbButtonWidth;
        float h = GameConsts.Menu.LbButtonHeight;
        float x = GameConsts.Menu.LbButtonX;
        float y = GameConsts.Menu.LbButtonY;

        return(Gu.Button(Gu.Center(x),
                         (int)Util.Interpolate(0.0f, Screen.height, 1.0f, Gu.Middle(y),
                                               mTransition.NormalizedElapsed),
                         Gu.Dim(w), Gu.Dim(h),
                         Gu.Dim(GameConsts.Menu.LbFontSize),
                         Strings.Leaderboards));
    }
示例#26
0
    // If the action was a continuous action that we want to
    // make sure that when it is over that everything is
    // reset and set back to normal
    void endConcurrentAction(string tag)
    {
        Gu gu = Gu.Instance;

        switch (tag)
        {
        case "Large Object":
            gu.EndPush();
            break;

        default:
            break;
        }
    }
示例#27
0
文件: Gu.cs 项目: Yeruot/Project-Gu
    void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            instance = this;
        }

        //Don't destroy the object when loading new scenes.
        //This will allow our object to persist between scenes.
        DontDestroyOnLoad(this.gameObject);
    }
示例#28
0
        void DrawHud()
        {
            Gu.SetColor(Color.black);

            // draw score
            Gu.Label(Gu.Right(GameConsts.Hud.ScoreX), Gu.Top(GameConsts.Hud.ScoreY),
                     Gu.Dim(GameConsts.Hud.ScoreFontSize), ((int)mDisplayedScore.Value).ToString("D5"));

            // draw % level complete
            int pc = Util.Clamp((int)(mLevelTime.NormalizedElapsed * 100), 0, 100);

            if (mGameState == GameState.Playing && pc == 100)
            {
                // while playing, we never get to 100% :-D
                pc = 99;
            }

            // draw level # and % complete
            Gu.Label(Gu.Left(GameConsts.Hud.StageX), Gu.Bottom(GameConsts.Hud.StageY),
                     Gu.Dim(GameConsts.Hud.StageFontSize),
                     string.Format(Strings.StageFmt, Util.GetLevelLetter(GameManager.Instance.Level),
                                   pc));

            // draw accuracy
            Gu.Label(Gu.Right(GameConsts.Hud.AccuracyX), Gu.Top(GameConsts.Hud.AccuracyY),
                     Gu.Dim(GameConsts.Hud.AccuracyFontSize),
                     string.Format(Strings.AccuracyFmt, GetAccuracyPercent()));

            // draw combo counter
            if (mCombo > 1 && Util.BlinkFunc(GameConsts.BlinkPeriod, 0.0f))
            {
                Gu.SetColor(GameConsts.Hud.ComboColor);
                Gu.Label(Gu.Center(GameConsts.Hud.ComboX), Gu.Top(GameConsts.Hud.ComboY),
                         Gu.Dim(GameConsts.Hud.ComboFontSize),
                         string.Format(Strings.ComboFmt, GetComboMult()));
            }

            // if there's a message being displayed, draw it now
            if (mMessageCd.Active && mMessage != null)
            {
                Gu.SetColor(0.0f, 0.0f, 0.0f,
                            Util.Trapezoid(GameConsts.Hud.MessageDuration,
                                           GameConsts.Hud.MessageTransitionDuration, mMessageCd.Elapsed));
                Gu.Label(Gu.Center(0), Gu.Middle(0),
                         Gu.Dim(GameConsts.Hud.MessageFontSize), mMessage);
            }
        }
        void OnGUI()
        {
            if (Time.timeScale == 0)
            {
                return;
            }

            if (DelayBeforeStart > 0)
            {
                return;
            }

            GUI.skin = GuiSkin;
            switch (phase)
            {
            case 0:
                float aspect = ArrowTex.width / (float)ArrowTex.height;
                GUI.DrawTexture(new Rect(Gu.Left(GameConsts.Tutorial.SteerArrowX),
                                         Gu.Top(0), aspect * Screen.height,
                                         (int)(mTransitionCd.NormalizedElapsed * Screen.height)), ArrowTex);
                Gu.Label(
                    Gu.Left(GameConsts.Tutorial.SteerTextX),
                    (int)Util.Interpolate(0.0f, 0.0f, 1.0f, Gu.Middle(0),
                                          mTransitionCd.NormalizedElapsed),
                    Gu.Dim(GameConsts.Tutorial.FontSize),
                    Strings.Tutorial1);
                break;

            case 1:
                Gu.Label(Gu.Right(GameConsts.Tutorial.FireTextX),
                         (int)Util.Interpolate(0.0f, Screen.height, 1.0f, Gu.Middle(0),
                                               mTransitionCd.NormalizedElapsed),
                         Gu.Dim(GameConsts.Tutorial.FontSize),
                         Strings.Tutorial2);
                break;

            default:
                Gu.Label(Gu.Center(0),
                         (int)(Util.Interpolate(0.0f, 0.0f, 1.0f, Gu.Middle(0),
                                                mTransitionCd.NormalizedElapsed)),
                         Gu.Dim(GameConsts.Tutorial.FontSize),
                         Strings.Tutorial3);
                break;
            }
        }
示例#30
0
        void OnGUI()
        {
            GUI.skin = GuiSkin;
            Gu.SetColor(Color.black);
            Gu.Label(Gu.Center(GameConsts.EndScreen.EndTextX),
                     (int)Util.Interpolate(0.0f, Screen.height, 1.0f,
                                           Gu.Middle(GameConsts.EndScreen.EndTextY),
                                           mTransitionCd.NormalizedElapsed),
                     Gu.Dim(GameConsts.EndScreen.EndTextFontSize),
                     Strings.EndText, false);

            bool wantOut = DrawUpButton();

            if (mTransitionCd.Expired && wantOut)
            {
                GameManager.Instance.QuitToMenu();
            }
        }