Ejemplo n.º 1
0
    public void Start()
    {
        GameObject t = new GameObject();

        _Temp = t.transform;
        MainCameraTransfom = Camera.main.transform;

        Buttons = new Button[] {
            new Button(Game.Instance.ButtonXPositon + new Vector2(GuiButtonX.Instance.ScreenWidth * 0.5f, GuiButtonX.Instance.ScreenHeight * 0.5f)),
            new Button(Game.Instance.ButtonOPositon + new Vector2(GuiButtonY.Instance.ScreenWidth * 0.5f, GuiButtonY.Instance.ScreenHeight * 0.5f)),
            new Button(Game.Instance.ButtonRPositon + new Vector2(GuiButtonRoll.Instance.ScreenWidth * 0.5f, GuiButtonRoll.Instance.ScreenHeight * 0.5f)),
            new Button(Game.Instance.ButtonOPositon + new Vector2(GuiButtonUse.Instance.ScreenWidth * 0.5f, GuiButtonUse.Instance.ScreenHeight * 0.5f)),
            new Button(GuiButtonShop.Instance.Center),
            new Button(GuiButtonInGameMenu.Instance.Center),
            new Button(GuiShopButtonOk.Instance.ScreenLeft, GuiShopButtonOk.Instance.ScreenBottom - GuiShopButtonOk.Instance.ScreenHeight, GuiShopButtonOk.Instance.ScreenWidth, GuiShopButtonOk.Instance.ScreenHeight * 2),
            new Button(GuiShopButtonBack.Instance.ScreenLeft, GuiShopButtonBack.Instance.ScreenBottom - GuiShopButtonBack.Instance.ScreenHeight, GuiShopButtonBack.Instance.ScreenWidth, GuiShopButtonBack.Instance.ScreenHeight * 2),
            new Button(GuiShopComboButtons.BScreenLeft(0), GuiShopComboButtons.BScreenBottom(0), GuiShopComboButtons.BScreenWidth(0), GuiShopComboButtons.BScreenHeight(0)),
            new Button(GuiShopComboButtons.BScreenLeft(1), GuiShopComboButtons.BScreenBottom(1), GuiShopComboButtons.BScreenWidth(1), GuiShopComboButtons.BScreenHeight(1)),
            new Button(GuiShopComboButtons.BScreenLeft(2), GuiShopComboButtons.BScreenBottom(2), GuiShopComboButtons.BScreenWidth(2), GuiShopComboButtons.BScreenHeight(2)),
            new Button(GuiShopComboButtons.BScreenLeft(3), GuiShopComboButtons.BScreenBottom(3), GuiShopComboButtons.BScreenWidth(3), GuiShopComboButtons.BScreenHeight(3)),
            new Button(GuiShopComboButtons.BScreenLeft(4), GuiShopComboButtons.BScreenBottom(4), GuiShopComboButtons.BScreenWidth(4), GuiShopComboButtons.BScreenHeight(4)),
            new Button(GuiShopComboButtons.BScreenLeft(5), GuiShopComboButtons.BScreenBottom(5), GuiShopComboButtons.BScreenWidth(5), GuiShopComboButtons.BScreenHeight(5)),
            new Button(GuiShopComboButtons.BScreenLeft(6), GuiShopComboButtons.BScreenBottom(6), GuiShopComboButtons.BScreenWidth(6), GuiShopComboButtons.BScreenHeight(6)),
            new Button(GuiShopComboButtons.BScreenLeft(7), GuiShopComboButtons.BScreenBottom(7), GuiShopComboButtons.BScreenWidth(7), GuiShopComboButtons.BScreenHeight(7)),
            new Button(GuiShopBuyInfo.OkScreenLeft, GuiShopBuyInfo.OkScreenBottom - GuiShopBuyInfo.OkScreenHeight, GuiShopBuyInfo.OkScreenWidth, GuiShopBuyInfo.OkScreenHeight * 2),
            new Button(GuiShopBuyInfo.CancelScreenLeft, GuiShopBuyInfo.CancelScreenBottom - GuiShopBuyInfo.CancelScreenHeight, GuiShopBuyInfo.CancelScreenWidth, GuiShopBuyInfo.CancelScreenHeight * 2),
        };

        Joystick = new JoystickControl(Game.Instance.JoystickPositon + new Vector2(GuiJoystick.Instance.ScreenWidth * 0.5f, GuiJoystick.Instance.ScreenHeight * 0.5f));
    }
Ejemplo n.º 2
0
    public void Start(GuiManager manager, int Combo)
    {
        ComboIndex = Combo;
        ComboData  = Player.Instance.PlayerComboAttacks[ComboIndex];

        if (ComboData == null)
        {
            Debug.LogError("ComboData is Null " + ComboIndex);
        }
        Gui             = manager;
        DefaultSpriteUI = manager.DefaultSpriteUI;

        int buttonIndex = 2 + ComboIndex;

        SpriteB = DefaultSpriteUI.AddElement(new Vector2(GuiShopComboButtons.BScreenLeft(buttonIndex), GuiShopComboButtons.BScreenBottom(buttonIndex)), GuiShopComboButtons.BScreenWidth(buttonIndex), GuiShopComboButtons.BScreenHeight(buttonIndex), 9, GuiShopComboButtons.BUvLeft, GuiShopComboButtons.BUvBottom, GuiShopComboButtons.BUvWidth, GuiShopComboButtons.BUvHeight);
        SpriteC = DefaultSpriteUI.AddElement(new Vector2(GuiShopComboButtons.CScreenLeft(buttonIndex), GuiShopComboButtons.CScreenBottom(buttonIndex)), GuiShopComboButtons.CScreenWidth(), GuiShopComboButtons.CScreenHeight(), 9, GuiShopComboButtons.CUvLeft[buttonIndex], GuiShopComboButtons.CUvBottom[buttonIndex], GuiShopComboButtons.CUvWidth, GuiShopComboButtons.CUvHeight);
        SpriteL = DefaultSpriteUI.AddElement(new Vector2(GuiShopComboButtons.LScreenLeft(ComboIndex), GuiShopComboButtons.LScreenBottom(ComboIndex)), GuiShopComboButtons.LScreenWidth(), GuiShopComboButtons.LScreenHeight(), 9, GuiShopIconBigLock.UvLeft, GuiShopIconBigLock.UvTop, GuiShopIconBigLock.UvWidth, GuiShopIconBigLock.UvHeight);

        if (Game.Instance.GameType == E_GameType.SinglePlayer)
        {
            Money = new GuiNumbers()
            {
                UvLeft   = GuiShopNumbers.UvLeft,
                UvTop    = GuiShopNumbers.UvTop,
                UvWidth  = GuiShopNumbers.UvWidth,
                UvHeight = GuiShopNumbers.UvHeight,
                Sprites  = new Sprite[] {
                    DefaultSpriteUI.AddElement(new Vector2(GuiComboNumbers.ScreenLeft(ComboIndex) + GuiComboNumbers.ScreenWidth * 3, GuiComboNumbers.ScreenBottom(ComboIndex)), GuiComboNumbers.ScreenWidth, GuiComboNumbers.ScreenHeight, 9, GuiShopNumbers.UvLeft, GuiShopNumbers.UvTop, GuiShopNumbers.UvWidth, GuiShopNumbers.UvHeight),
                    DefaultSpriteUI.AddElement(new Vector2(GuiComboNumbers.ScreenLeft(ComboIndex) + GuiComboNumbers.ScreenWidth * 2, GuiComboNumbers.ScreenBottom(ComboIndex)), GuiComboNumbers.ScreenWidth, GuiComboNumbers.ScreenHeight, 9, GuiShopNumbers.UvLeft, GuiShopNumbers.UvTop, GuiShopNumbers.UvWidth, GuiShopNumbers.UvHeight),
                    DefaultSpriteUI.AddElement(new Vector2(GuiComboNumbers.ScreenLeft(ComboIndex) + GuiComboNumbers.ScreenWidth, GuiComboNumbers.ScreenBottom(ComboIndex)), GuiComboNumbers.ScreenWidth, GuiComboNumbers.ScreenHeight, 9, GuiShopNumbers.UvLeft, GuiShopNumbers.UvTop, GuiShopNumbers.UvWidth, GuiShopNumbers.UvHeight),
                    DefaultSpriteUI.AddElement(new Vector2(GuiComboNumbers.ScreenLeft(ComboIndex), GuiComboNumbers.ScreenBottom(ComboIndex)), GuiComboNumbers.ScreenWidth, GuiComboNumbers.ScreenHeight, 9, GuiShopNumbers.UvLeft, GuiShopNumbers.UvTop, GuiShopNumbers.UvWidth, GuiShopNumbers.UvHeight),
                }
            };
        }

        for (int i = 0; i < ComboData.ComboSteps.Length; i++)
        {
            if (ComboData.ComboSteps[i].AttackType == E_AttackType.X)
            {
                ProgressSprites.Add(DefaultSpriteUI.AddElement(new Vector2(GuiShopComboButtons.IScreenLeft(ComboIndex) + GuiShopComboButtons.IScreenWidth() * i, GuiShopComboButtons.IScreenBottom(ComboIndex)), GuiShopComboButtons.IScreenWidth(), GuiShopComboButtons.IScreenHeight(), 9, GuiShopIconX.UvLeft, GuiShopIconX.UvTop, GuiShopIconX.UvWidth, GuiShopIconX.UvHeight));
            }
            else
            {
                ProgressSprites.Add(DefaultSpriteUI.AddElement(new Vector2(GuiShopComboButtons.IScreenLeft(ComboIndex) + GuiShopComboButtons.IScreenWidth() * i, GuiShopComboButtons.IScreenBottom(ComboIndex)), GuiShopComboButtons.IScreenWidth(), GuiShopComboButtons.IScreenHeight(), 9, GuiShopIconY.UvLeft, GuiShopIconY.UvTop, GuiShopIconY.UvWidth, GuiShopIconY.UvHeight));
            }
        }
    }
Ejemplo n.º 3
0
    public void Start(GuiManager manager)
    {
        Gui             = manager;
        DefaultSpriteUI = manager.DefaultSpriteUI;

        SpriteB = DefaultSpriteUI.AddElement(new Vector2(GuiShopComboButtons.BScreenLeft(0), GuiShopComboButtons.BScreenBottom(0)), GuiShopComboButtons.BScreenWidth(0), GuiShopComboButtons.BScreenHeight(0), 9, GuiShopComboButtons.BUvLeft, GuiShopComboButtons.BUvBottom, GuiShopComboButtons.BUvWidth, GuiShopComboButtons.BUvHeight);
        SpriteC = DefaultSpriteUI.AddElement(new Vector2(GuiShopComboButtons.CScreenLeft(0), GuiShopComboButtons.CScreenBottom(0)), GuiShopComboButtons.CScreenWidth(), GuiShopComboButtons.CScreenHeight(), 9, GuiShopComboButtons.CUvLeft[0], GuiShopComboButtons.CUvBottom[0], GuiShopComboButtons.CUvWidth, GuiShopComboButtons.CUvHeight);

        if (Game.Instance.GameType != E_GameType.Survival)
        {
            Money = new GuiNumbers()
            {
                UvLeft   = GuiShopNumbers.UvLeft,
                UvTop    = GuiShopNumbers.UvTop,
                UvWidth  = GuiShopNumbers.UvWidth,
                UvHeight = GuiShopNumbers.UvHeight,
                Sprites  = new Sprite[] {
                    DefaultSpriteUI.AddElement(new Vector2(GuiHealthNumbers.ScreenLeft + GuiHealthNumbers.ScreenWidth * 3, GuiHealthNumbers.ScreenBottom), GuiHealthNumbers.ScreenWidth, GuiHealthNumbers.ScreenHeight, 9, GuiShopNumbers.UvLeft, GuiShopNumbers.UvTop, GuiShopNumbers.UvWidth, GuiShopNumbers.UvHeight),
                    DefaultSpriteUI.AddElement(new Vector2(GuiHealthNumbers.ScreenLeft + GuiHealthNumbers.ScreenWidth * 2, GuiHealthNumbers.ScreenBottom), GuiHealthNumbers.ScreenWidth, GuiHealthNumbers.ScreenHeight, 9, GuiShopNumbers.UvLeft, GuiShopNumbers.UvTop, GuiShopNumbers.UvWidth, GuiShopNumbers.UvHeight),
                    DefaultSpriteUI.AddElement(new Vector2(GuiHealthNumbers.ScreenLeft + GuiHealthNumbers.ScreenWidth, GuiHealthNumbers.ScreenBottom), GuiHealthNumbers.ScreenWidth, GuiHealthNumbers.ScreenHeight, 9, GuiShopNumbers.UvLeft, GuiShopNumbers.UvTop, GuiShopNumbers.UvWidth, GuiShopNumbers.UvHeight),
                    DefaultSpriteUI.AddElement(new Vector2(GuiHealthNumbers.ScreenLeft, GuiHealthNumbers.ScreenBottom), GuiHealthNumbers.ScreenWidth, GuiHealthNumbers.ScreenHeight, 9, GuiShopNumbers.UvLeft, GuiShopNumbers.UvTop, GuiShopNumbers.UvWidth, GuiShopNumbers.UvHeight),
                    // DefaultSpriteUI.AddElement(new Vector2(GuiHealthNumbers.ScreenLeft[hardware] + GuiHealthNumbers.ScreenWidth[hardware] * 4, GuiHealthNumbers.ScreenBottom[hardware]),GuiHealthNumbers.ScreenWidth[hardware], GuiHealthNumbers.ScreenHeight[hardware], 9, GuiShopNumbers.UvLeft[hardware], GuiShopNumbers.UvTop[hardware], GuiShopNumbers.UvWidth[hardware], GuiShopNumbers.UvHeight[hardware]),
                }
            };
        }

        Level = new GuiNumbers()
        {
            UvLeft   = GuiShopNumbers.UvLeft,
            UvTop    = GuiShopNumbers.UvTop,
            UvWidth  = GuiShopNumbers.UvWidth,
            UvHeight = GuiShopNumbers.UvHeight,
            Sprites  = new Sprite[] {
                DefaultSpriteUI.AddElement(new Vector2(GuiHealthLevel.ScreenLeft, GuiHealthLevel.ScreenBottom), GuiHealthLevel.ScreenWidth, GuiHealthLevel.ScreenHeight, 9, GuiShopNumbers.UvLeft, GuiShopNumbers.UvTop, GuiShopNumbers.UvWidth, GuiShopNumbers.UvHeight),
            }
        };

        //Hide();

        // of	unlockAchievement
        if (Game.Instance.HealthLevel == E_HealthLevel.Max)
        {
            Achievements.UnlockAchievement(22);
        }
    }
Ejemplo n.º 4
0
    public void Start(GuiManager manager)
    {
        Gui             = manager;
        DefaultSpriteUI = manager.DefaultSpriteUI;

        SpriteB = DefaultSpriteUI.AddElement(new Vector2(GuiShopComboButtons.BScreenLeft(1), GuiShopComboButtons.BScreenBottom(1)), GuiShopComboButtons.BScreenWidth(1), GuiShopComboButtons.BScreenHeight(1), 9, GuiShopComboButtons.BUvLeft, GuiShopComboButtons.BUvBottom, GuiShopComboButtons.BUvWidth, GuiShopComboButtons.BUvHeight);



        if (Game.Instance.GameType != E_GameType.Survival)
        {
            SpriteC = DefaultSpriteUI.AddElement(new Vector2(GuiShopComboButtons.CScreenLeft(1), GuiShopComboButtons.CScreenBottom(1)), GuiShopComboButtons.CScreenWidth(), GuiShopComboButtons.CScreenHeight(), 9, GuiShopComboButtons.CUvLeft[1], GuiShopComboButtons.CUvBottom[1], GuiShopComboButtons.CUvWidth, GuiShopComboButtons.CUvHeight);
            Money   = new GuiNumbers()
            {
                UvLeft   = GuiShopNumbers.UvLeft,
                UvTop    = GuiShopNumbers.UvTop,
                UvWidth  = GuiShopNumbers.UvWidth,
                UvHeight = GuiShopNumbers.UvHeight,
                Sprites  = new Sprite[] {
                    DefaultSpriteUI.AddElement(new Vector2(GuiSwordNumbers.ScreenLeft + GuiSwordNumbers.ScreenWidth * 3, GuiSwordNumbers.ScreenBottom), GuiSwordNumbers.ScreenWidth, GuiSwordNumbers.ScreenHeight, 9, GuiShopNumbers.UvLeft, GuiShopNumbers.UvTop, GuiShopNumbers.UvWidth, GuiShopNumbers.UvHeight),
                    DefaultSpriteUI.AddElement(new Vector2(GuiSwordNumbers.ScreenLeft + GuiSwordNumbers.ScreenWidth * 2, GuiSwordNumbers.ScreenBottom), GuiSwordNumbers.ScreenWidth, GuiSwordNumbers.ScreenHeight, 9, GuiShopNumbers.UvLeft, GuiShopNumbers.UvTop, GuiShopNumbers.UvWidth, GuiShopNumbers.UvHeight),
                    DefaultSpriteUI.AddElement(new Vector2(GuiSwordNumbers.ScreenLeft + GuiSwordNumbers.ScreenWidth, GuiSwordNumbers.ScreenBottom), GuiSwordNumbers.ScreenWidth, GuiSwordNumbers.ScreenHeight, 9, GuiShopNumbers.UvLeft, GuiShopNumbers.UvTop, GuiShopNumbers.UvWidth, GuiShopNumbers.UvHeight),
                    DefaultSpriteUI.AddElement(new Vector2(GuiSwordNumbers.ScreenLeft, GuiSwordNumbers.ScreenBottom), GuiSwordNumbers.ScreenWidth, GuiSwordNumbers.ScreenHeight, 9, GuiShopNumbers.UvLeft, GuiShopNumbers.UvTop, GuiShopNumbers.UvWidth, GuiShopNumbers.UvHeight),
                    // DefaultSpriteUI.AddElement(new Vector2(GuiSwordNumbers.ScreenLeft[hardware] + GuiSwordNumbers.ScreenWidth[hardware] * 4, GuiSwordNumbers.ScreenBottom[hardware]),GuiSwordNumbers.ScreenWidth[hardware], GuiSwordNumbers.ScreenHeight[hardware], 9, GuiShopNumbers.UvLeft[hardware], GuiShopNumbers.UvTop[hardware], GuiShopNumbers.UvWidth[hardware], GuiShopNumbers.UvHeight[hardware]),
                }
            };
        }
        else
        {
            SpriteL = DefaultSpriteUI.AddElement(new Vector2(GuiShopComboButtons.CLScreenLeft, GuiShopComboButtons.CLScreenBottom), GuiShopComboButtons.CLScreenWidth, GuiShopComboButtons.CLScreenHeight, 9, GuiShopIconBigLock.UvLeft, GuiShopIconBigLock.UvTop, GuiShopIconBigLock.UvWidth, GuiShopIconBigLock.UvHeight);
        }

        /* Level = new GuiNumbers()
         * {
         *   UvLeft = GuiShopNumbers.UvLeft[hardware],
         *   UvTop = GuiShopNumbers.UvTop[hardware],
         *   UvWidth = GuiShopNumbers.UvWidth[hardware],
         *   UvHeight = GuiShopNumbers.UvHeight[hardware],
         *   Sprites = new Sprite[]{
         *       DefaultSpriteUI.AddElement(new Vector2(GuiSwordLevel.ScreenLeft[hardware], GuiSwordLevel.ScreenBottom[hardware]),GuiSwordLevel.ScreenWidth[hardware], GuiSwordLevel.ScreenHeight[hardware], 9, GuiShopNumbers.UvLeft[hardware], GuiShopNumbers.UvTop[hardware], GuiShopNumbers.UvWidth[hardware], GuiShopNumbers.UvHeight[hardware]),
         *   }
         * };*/

        //Hide();
    }
Ejemplo n.º 5
0
    public void Start()
    {
        GameObject t = new GameObject();

        _Temp = t.transform;
        MainCameraTransfom = Camera.main.transform;
        Debug.Log("player control start (check game instance=" + Game.Instance.name);
        //no game will cause no button
        //if (Buttons != null) {
        Buttons = new Button[] {
            new Button(Game.Instance.ButtonXPositon + new Vector2(GuiButtonX.Instance.ScreenWidth * 0.5f, GuiButtonX.Instance.ScreenHeight * 0.5f)),
            new Button(Game.Instance.ButtonOPositon + new Vector2(GuiButtonY.Instance.ScreenWidth * 0.5f, GuiButtonY.Instance.ScreenHeight * 0.5f)),
            new Button(Game.Instance.ButtonRPositon + new Vector2(GuiButtonRoll.Instance.ScreenWidth * 0.5f, GuiButtonRoll.Instance.ScreenHeight * 0.5f)),
            new Button(Game.Instance.ButtonOPositon + new Vector2(GuiButtonUse.Instance.ScreenWidth * 0.5f, GuiButtonUse.Instance.ScreenHeight * 0.5f)),
            new Button(GuiButtonShop.Instance.Center),
            new Button(GuiButtonInGameMenu.Instance.Center),
            new Button(GuiShopButtonOk.Instance.ScreenLeft, GuiShopButtonOk.Instance.ScreenBottom - GuiShopButtonOk.Instance.ScreenHeight, GuiShopButtonOk.Instance.ScreenWidth, GuiShopButtonOk.Instance.ScreenHeight * 2),
            new Button(GuiShopButtonBack.Instance.ScreenLeft, GuiShopButtonBack.Instance.ScreenBottom - GuiShopButtonBack.Instance.ScreenHeight, GuiShopButtonBack.Instance.ScreenWidth, GuiShopButtonBack.Instance.ScreenHeight * 2),
            new Button(GuiShopComboButtons.BScreenLeft(0), GuiShopComboButtons.BScreenBottom(0), GuiShopComboButtons.BScreenWidth(0), GuiShopComboButtons.BScreenHeight(0)),
            new Button(GuiShopComboButtons.BScreenLeft(1), GuiShopComboButtons.BScreenBottom(1), GuiShopComboButtons.BScreenWidth(1), GuiShopComboButtons.BScreenHeight(1)),
            new Button(GuiShopComboButtons.BScreenLeft(2), GuiShopComboButtons.BScreenBottom(2), GuiShopComboButtons.BScreenWidth(2), GuiShopComboButtons.BScreenHeight(2)),
            new Button(GuiShopComboButtons.BScreenLeft(3), GuiShopComboButtons.BScreenBottom(3), GuiShopComboButtons.BScreenWidth(3), GuiShopComboButtons.BScreenHeight(3)),
            new Button(GuiShopComboButtons.BScreenLeft(4), GuiShopComboButtons.BScreenBottom(4), GuiShopComboButtons.BScreenWidth(4), GuiShopComboButtons.BScreenHeight(4)),
            new Button(GuiShopComboButtons.BScreenLeft(5), GuiShopComboButtons.BScreenBottom(5), GuiShopComboButtons.BScreenWidth(5), GuiShopComboButtons.BScreenHeight(5)),
            new Button(GuiShopComboButtons.BScreenLeft(6), GuiShopComboButtons.BScreenBottom(6), GuiShopComboButtons.BScreenWidth(6), GuiShopComboButtons.BScreenHeight(6)),
            new Button(GuiShopComboButtons.BScreenLeft(7), GuiShopComboButtons.BScreenBottom(7), GuiShopComboButtons.BScreenWidth(7), GuiShopComboButtons.BScreenHeight(7)),
            new Button(GuiShopBuyInfo.OkScreenLeft, GuiShopBuyInfo.OkScreenBottom - GuiShopBuyInfo.OkScreenHeight, GuiShopBuyInfo.OkScreenWidth, GuiShopBuyInfo.OkScreenHeight * 2),
            new Button(GuiShopBuyInfo.CancelScreenLeft, GuiShopBuyInfo.CancelScreenBottom - GuiShopBuyInfo.CancelScreenHeight, GuiShopBuyInfo.CancelScreenWidth, GuiShopBuyInfo.CancelScreenHeight * 2),
        };
        //}

        if (Game.Instance != null)
        {
            Joystick = new JoystickControl(Game.Instance.JoystickPositon + new Vector2(GuiJoystick.Instance.ScreenWidth * 0.5f, GuiJoystick.Instance.ScreenHeight * 0.5f));
        }
        else
        {
            Joystick = new JoystickControl(new Vector2(100, 100));
        }
    }