Ejemplo n.º 1
0
 public void Shopview(bool t)
 {
     if (t)
     {
         InfoButton.SetActive(false);
         SettingsButton.SetActive(false);
         PlayScreen.SetActive(false);
         AccountBtnIcon.SetActive(false);
         ShopButton.SetActive(false);
         BtnAvatar.SetActive(false);
         LeaderButton.SetActive(false);
         ShopPanel.SetActive(true);
         LeaderButton.SetActive(false);
         Camera.GetComponent <CameraController>().enabled = false;
     }
     else
     {
         ShopPanel.SetActive(false);
         InfoButton.SetActive(true);
         SettingsButton.SetActive(true);
         PlayScreen.SetActive(true);
         ShopButton.SetActive(true);
         BtnAvatar.SetActive(true);
         LeaderButton.SetActive(true);
         AccountBtnIcon.SetActive(true);
         Camera.GetComponent <CameraController>().enabled = true;
     }
 }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        shopPanel = GetComponentInChildren <ShopPanel>();

        mouseSetings      = GetComponent <RigidbodyFirstPersonController>().mouseLook;
        fireingManagement = GetComponentInChildren <FireingManagement>();
    }
    // Fills the main part of the shop screen with inventory for purchase
    void PopulateGrid()
    {
        // Load a shop panel template
        GameObject newPanel;
        GameObject prefabPanel = Resources.Load <GameObject>(@"MenuPrefabs\prefabShopPanel");

        // Retrieve the Inventory of the Party
        Inventory partyStash = BattleLoader.Party.Inventory;

        // Shop.Stock was populated during file load or during Initializing
        foreach (InvItem item in Shop.Stock.Contents)
        {
            // Create instances of the shopPanel, naming Content object as its parent
            newPanel = GameObject.Instantiate(prefabPanel, gridContent.transform);
            ShopPanel shopPanel = newPanel.GetComponent <ShopPanel>();

            // Retrieve the number of identical items from the partyStash
            int held = 0;
            if (partyStash.ContainsItem(item.Name))
            {
                held = partyStash.Contents[partyStash.IndexOfItem(item.Name)].Quantity;
            }

            // Set up the shop Panel with the InvItem from Shop.Stock
            shopPanel.SetPanel(item, held);
        }
    }
    public Script_UIManager()
    {
        //Create character panel
        Canvas         = GameObject.Find("Canvas");
        CharacterPanel = GameObject.Instantiate(Resources.Load <Script_CharacterPanel>("Prefabs/UI/CharacterPanel"));
        CharacterPanel.Initialise();
        CharacterPanel.transform.SetParent(Canvas.transform);
        CharacterPanel.transform.localPosition = Vector3.zero;
        CharacterPanel.Refresh();
        CharacterPanel.Hide();

        //Create inventory panel
        InventoryPanel = GameObject.Instantiate(Resources.Load <Script_InventoryPanel>("Prefabs/UI/InventoryPanel"));
        InventoryPanel.Initialise();
        InventoryPanel.transform.SetParent(Canvas.transform);
        InventoryPanel.transform.localPosition = Vector3.zero;
        InventoryPanel.Refresh();
        InventoryPanel.Hide();

        //Create shop panel
        ShopPanel = GameObject.Instantiate(Resources.Load <Script_ShopPanel>("Prefabs/UI/ShopPanel"));
        ShopPanel.Initialise();
        ShopPanel.transform.SetParent(Canvas.transform);
        ShopPanel.transform.localPosition = Vector3.zero;
        ShopPanel.Refresh();
        ShopPanel.Hide();
    }
Ejemplo n.º 5
0
    void Start()
    {
        PlayerPrefs.SetString("TetherHead_0", "False");

        shopPanel = FindObjectOfType <ShopPanel>();
        AddTetherHeads();
    }
Ejemplo n.º 6
0
 void Awake()
 {
     item      = null;
     weapon    = null;
     armor     = null;
     shop      = GameObject.Find("Shop").GetComponent <Shop>();
     infoPanel = shop.GetComponent <ShopPanel>();
 }
Ejemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     shop       = GetComponentInParent <ShopPanel>();
     data       = Director.UI.skins[skinId];
     price.text = data.price.ToString();
     text.text  = data.skinName;
     UpdateState();
 }
Ejemplo n.º 8
0
        private void ShopButton(object sender, RoutedEventArgs e)
        {
            ShopPanel newShopPanel = new ShopPanel();

            newShopPanel.Show();

            this.Close();
        }
Ejemplo n.º 9
0
 public void Init()
 {
     if (isMoreSpeed)
     {
         PlayControl.SetSpeed(ShopPanel.GetSpeedTimes());
         ControlinPlay.SetSpeed(ShopPanel.GetSpeedTimes());
     }
 }
Ejemplo n.º 10
0
 public void OnClick()
 {
     if (GetComponent <Toggle>().isOn)
     {
         ShopPanel panel = UIManager.Instance.GetPanel(UIPanelType.Shop) as ShopPanel;
         panel.OnEquipmentClick(ItemId);
     }
 }
Ejemplo n.º 11
0
 public void OnBuyDiamondClick()
 {
     ShopPanel.Load();
     if (ShopPanel.Instance != null)
     {
         ShopPanel.Instance.RefreshToState(ShopPanel.ShopState.Recharge);
     }
 }
Ejemplo n.º 12
0
 public void OnBuyCoinClick()
 {
     ShopPanel.Load();
     if (ShopPanel.Instance != null)
     {
         ShopPanel.Instance.RefreshToState(ShopPanel.ShopState.ExchangeMoney10);
     }
 }
Ejemplo n.º 13
0
 public static void AddInvoker_Shop_AdjustPurchaseAmount(ShopPanel panelScript)
 {
     invokers_Shop_AdjustPurchaseAmount.Add(panelScript);
     if (listener_Shop_AdjustPurchaseAmount != null)
     //foreach (UnityAction<int> listener in listeners_Battle_EnemyDeathEnd)
     {
         panelScript.AddListener_Shop_AdjustPurchaseAmount(listener_Shop_AdjustPurchaseAmount);
     }
 }
Ejemplo n.º 14
0
    private void OnClick()
    {
        switch (ButtonType)
        {
        case ButtonTypeEnum.BuyHeart:

            UMengPlugin.UMengEvent(EventId.GOTO_HEART,
                                   new Dictionary <string, object>
            {
                { "from", MainRoot.Instance.CurrentViewStateName },
                { "heart", CommonData.HeartData.Count }
            });

            ShopPanel.Load();
            if (ShopPanel.Instance != null)
            {
                ShopPanel.Instance.RefreshToState(ShopPanel.ShopState.ExchangeHeart);
            }
            break;

        case ButtonTypeEnum.BuyCoin:

            UMengPlugin.UMengEvent(EventId.GOTO_COIN,
                                   new Dictionary <string, object>
            {
                { "from", MainRoot.Instance.CurrentViewStateName },
                { "coin", CommonData.MyUser.Money10 }
            });

            ShopPanel.Load();
            if (ShopPanel.Instance != null)
            {
                ShopPanel.Instance.RefreshToState(ShopPanel.ShopState.ExchangeMoney10);
            }
            break;

        case ButtonTypeEnum.BuyDiamond:

            UMengPlugin.UMengEvent(EventId.GOTO_DIAMOND,
                                   new Dictionary <string, object>
            {
                { "from", MainRoot.Instance.CurrentViewStateName },
                { "diamond", CommonData.MyUser.Money1 }
            });

            ShopPanel.Load();
            if (ShopPanel.Instance != null)
            {
                ShopPanel.Instance.RefreshToState(ShopPanel.ShopState.Recharge);
            }
            break;

        default:
            Debug.LogError("超出范围", this);
            break;
        }
    }
Ejemplo n.º 15
0
 public void MovePanelsRight()
 {
     isMovingPanels = true;
     for (int i = 0; i < shopPanels.Length; i++)
     {
         ShopPanel nextPanel = shopPanels[(i + 1) % shopPanels.Length];
         shopPanels[i].StartMovingTo(nextPanel.rectTransform.localPosition, nextPanel.rectTransform.localScale, nextPanel.isMainPanel);
     }
 }
Ejemplo n.º 16
0
        public void OnShopClick()
        {
            UMengPlugin.UMengEvent(EventId.HOME_SHOP, null);

            ShopPanel.Load();
            if (ShopPanel.Instance != null)
            {
                ShopPanel.Instance.RefreshToState(ShopPanel.ShopState.Recharge);
            }
        }
Ejemplo n.º 17
0
 public MenuController(ShopPanel shopPanel, OpenShopPanel openShopPanel,
                       ShowMeshBtn showMeshBtn, CloseShopPanel closeShopPanel)
 {
     _shopPanel                 = shopPanel;
     _openShopPanel             = openShopPanel;
     _showMeshBtn               = showMeshBtn;
     _closeShopPanel            = closeShopPanel;
     _openShopPanel.OpenMenu   += OpenMenu;
     _closeShopPanel.CloseMenu += CloseMenu;
 }
Ejemplo n.º 18
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 19
0
    public void Show(ShopModel model)
    {
        HideAllShopPanel();

        for (int i = 0; i < model.shopDataList.Count; i++)
        {
            ShopData  sd = model.shopDataList[i];
            ShopPanel sp = shopPanelList[i];

            sp.Show(sd);
        }

        this.gameObject.SetActive(true);
    }
Ejemplo n.º 20
0
    public void Setup(ShopPanel shopPanel, GameObject dialogue, int itemId, int diamondPrice, int goldPrice, Sprite buttonSprite, bool unlocked)
    {
        this.itemId                  = itemId;
        shop                         = shopPanel;
        confirmDialogue              = dialogue;
        this.goldPrice               = goldPrice;
        this.diamondPrice            = diamondPrice;
        diamondPriceText.text        = diamondPrice.ToString();
        goldPriceText.text           = goldPrice.ToString();
        iconImage.sprite             = buttonSprite;
        buttonComponent.interactable = !unlocked;

        // TODO: Edit size
    }
Ejemplo n.º 21
0
    public void ShopItemButtonRightClick()
    {
        ShopPanel sp = UIManager.Instance.GetBaseUIForm <ShopPanel>();

        if (sp.Cur_BoughtShopItem.Contains(Cur_ShopItem))
        {
            sp.Cur_BoughtShopItem.Remove(Cur_ShopItem);
            StoryManager.Instance.GetStory().Crystal += Cur_ShopItem.Price;
            UIManager.Instance.GetBaseUIForm <StoryPlayerInformationPanel>().SetCrystal(StoryManager.Instance.GetStory().Crystal);
            IsSold = false;
            SetButtonLocked(false);
            sp.RefreshAllShopItemAffordable();
        }
    }
Ejemplo n.º 22
0
    private void Awake()
    {
        Menu menu = FindObjectOfType <Menu>();

        _inventory  = menu.inventory;
        _parameters = menu.parameters;

        ShopPanel shopPanel = GetComponentInParent <ShopPanel>();

        _moneyAmountText = shopPanel.moneyText;

        ShopTabContent shopTabContent = GetComponentInParent <ShopTabContent>();

        _equipPanel = shopTabContent.equipPanel;
    }
Ejemplo n.º 23
0
    private void InitShopPanelList()
    {
        shopPanelList = new List <ShopPanel>();

        GameObject shopPanelPrefab = Resources.Load("ShopPanel") as GameObject;

        for (int i = 0; i < 10; i++)
        {
            ShopPanel sp = ((GameObject)Instantiate(shopPanelPrefab)).GetComponent <ShopPanel>();
            sp.Init(i);

            sp.transform.SetParent(shopPanelParent);
            shopPanelList.Add(sp);
        }
    }
Ejemplo n.º 24
0
        private void Awake()
        {
            Instance = this;
            PausePanel.SetActive(false);
            ShopPanel.SetActive(false);

            _gameSpeed = 1;

            _statHolders = new List <GameObject>
            {
                StatHolderTransform.GetChild(0).gameObject,
                StatHolderTransform.GetChild(1).gameObject,
                StatHolderTransform.GetChild(2).gameObject
            };
        }
Ejemplo n.º 25
0
 private void Show()
 {
     gameObject.SetActive(true);
     Myaudio.PlayOneShot(vars.DeadClip);
     GameData.isGame = false;
     Gamemanager.Instance.SetDiamondCount(Gamemanager.Instance.NewDiamondCount);
     if (Gamemanager.Instance.isHardMode)
     {
         Gamemanager.Instance.SetBestScoreHard(Gamemanager.Instance.Score);
         if (Gamemanager.Instance.GetBestScoreHard() <= Gamemanager.Instance.GetScore())
         {
             Myaudio.PlayOneShot(vars.NewBestClip);
             New.SetActive(true);
             txt_BestScore.text = "最高分:" + Gamemanager.Instance.GetScore().ToString();
         }
         else
         {
             New.SetActive(false);
             txt_BestScore.text = "最高分:" + Gamemanager.Instance.GetBestScoreHard().ToString();
         }
     }
     else
     {
         Gamemanager.Instance.SetBestScore(Gamemanager.Instance.Score);
         if (Gamemanager.Instance.GetBestScore() <= Gamemanager.Instance.GetScore())
         {
             Myaudio.PlayOneShot(vars.NewBestClip);
             New.SetActive(true);
             txt_BestScore.text = "最高分:" + Gamemanager.Instance.GetScore().ToString();
         }
         else
         {
             New.SetActive(false);
             txt_BestScore.text = "最高分:" + Gamemanager.Instance.GetBestScore().ToString();
         }
     }
     if (Gamemanager.Instance.isMoreScore)
     {
         txt_Score.text = Gamemanager.Instance.GetScore().ToString() + "*" + ShopPanel.GetScoreTimes().ToString()
                          + "=" + ((int)(Gamemanager.Instance.GetScore() * ShopPanel.GetScoreTimes())).ToString();
     }
     else
     {
         txt_Score.text = Gamemanager.Instance.GetScore().ToString();
     }
     txt_NewAddDiamond.text = "+" + Gamemanager.Instance.NewDiamondCount.ToString();
     //NewDiamondCount = 0;
 }
Ejemplo n.º 26
0
 public void ShowTiShi(bool isShow, List <int> _item)
 {
     btnTishi.gameObject.SetActive(isShow);//默认隐藏提示按钮
     if (isShow)
     {
         btnTishi.onClick.AddListener(() => TTUIPage.ShowPage <ShopPanel>(_item));//传出所有的商品信息
     }
     if (!isShow)
     {
         if (TTUIPage.allPages.ContainsKey("ShopPanel"))
         {
             ShopPanel.Close();
             TTUIPage.ClosePage <ShopPanel>();
             btnTishi.onClick.RemoveAllListeners();
         }
     }
 }
Ejemplo n.º 27
0
 public void ShopCall()
 {
     _audio.clip = itemOpenSound;
     _audio.Play();
     if (ShopPanel.activeSelf)
     {
         //Time.timeScale = 1;
         //environment.SW.Start();
         ShopPanel.SetActive(false);
     }
     else
     {
         //Time.timeScale = 0;
         //environment.SW.Stop();
         ShopPanel.SetActive(true);
     }
 }
Ejemplo n.º 28
0
 private void RefreshItemList()
 {
     if (MainMenuComponent != null)
     {
         foreach (Transform child in ShopTable.transform)
         {
             ShopPanel panel = child.GetComponent <ShopPanel> ();
             if (panel != null)
             {
                 if (panel.ItemPrice > MainMenuComponent.CreditCurrency)
                 {
                     panel.PanelButton.interactable = false;
                 }
             }
         }
     }
 }
Ejemplo n.º 29
0
    public void DisableAllPanels()
    {
        LoadingPanel.SetActive(false);

        AccountPanel.SetActive(false);
        ProcessPanel.SetActive(false);

        LobbyPanel.SetActive(false);
        CharacterSelectPanel.SetActive(false);
        ProfilePanel.SetActive(false);
        ShopPanel.SetActive(false);
        FriendsPanel.SetActive(false);
        GameModePanel.SetActive(false);
        SettingsPanel.SetActive(false);
        AboutPanel.SetActive(false);
        WaitingPanel.SetActive(false);
    }
Ejemplo n.º 30
0
 public void ShopItemButtonLeftClick()
 {
     if (Affordable)
     {
         AudioManager.Instance.SoundPlay("sfx/OnBuyShopItem");
         ShopPanel sp = UIManager.Instance.GetBaseUIForm <ShopPanel>();
         sp.SetAllButtonLock(true);
         sp.Cur_BoughtShopItem.Add(Cur_ShopItem);
         StoryManager.Instance.GetStory().Crystal -= Cur_ShopItem.Price;
         IsSold = true;
         SetButtonLocked(true);
         UIManager.Instance.GetBaseUIForm <StoryPlayerInformationPanel>().SetCrystal(StoryManager.Instance.GetStory().Crystal);
         sp.RefreshAllShopItemAffordable();
     }
     else
     {
         NoticeManager.Instance.ShowInfoPanelCenter(LanguageManager.Instance.GetText("ShopPanel_CannotAffordShopItem"), 0f, 1f);
     }
 }
Ejemplo n.º 31
0
    void Awake()
    {
        AudioListener.volume = 0.0f;
        //DontDestroyOnLoad(this.gameObject);
        GameObject UIRoot = GameObject.Find("UI Root");
        

        AccountPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/AccountPanel") as GameObject);
        GameReadyPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/GameReadyPanel") as GameObject);
        GameEndPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/GameEndPanel") as GameObject);
        GuildManagementPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/GuildManagementPanel") as GameObject);
        HeadHunterCenterPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/HeadHunterCenterPanel") as GameObject);
        LobbyPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/LobbyPanel") as GameObject);
        StageListPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/StageListPanel") as GameObject);
        ShopPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/ShopPanel") as GameObject);
        MuhanPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/MuhanPanel") as GameObject);
        SettingPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/SettingPanel") as GameObject);
        

        Account = AccountPanel.GetComponent<AccountPanel>();
        GameReady = GameReadyPanel.GetComponent<GameReadyPanel>();
        GameEnd = GameEndPanel.GetComponent<GameEndPanel>();
        GuildManagement = GuildManagementPanel.GetComponent<GuildManagementPanel>();
        HeadHunterCenter = HeadHunterCenterPanel.GetComponent<HeadHunterCenterPanel>();
        Lobby = LobbyPanel.GetComponent<LobbyPanel>();
        StageList = StageListPanel.GetComponent<StageListPanel>();
        Shop = ShopPanel.GetComponent<ShopPanel>();
        Muhan = MuhanPanel.GetComponent<MuhanPanel>();
        Setting = SettingPanel.GetComponent<SettingPanel>();

        //savedAccountData = new ClientSaveData();
        //savedAccountData.Save();

       
        if (!windows.ContainsKey(ID.ACCOUNT_INFO))
        {
            windows.Add(ID.ACCOUNT_INFO, Account);
            windows.Add(ID.GAME_READY, GameReady);
            windows.Add(ID.GAME_END, GameEnd);
            windows.Add(ID.GUILD_MANAGEMENT, GuildManagement);
            windows.Add(ID.HEADHUNTER_CENTER, HeadHunterCenter);
            windows.Add(ID.LOBBY, Lobby);
            windows.Add(ID.STAGE_LIST, StageList);
            windows.Add(ID.STORE, Shop);
            windows.Add(ID.MUHAN, Muhan);
            windows.Add(ID.CONFIG, Setting);
        }
        //Initialize temp;;
        
        if (!GameManager.firstInit)
        {
            GameObject.Find("GameManager").GetComponent<GameManager>().InitParty();
            GameManager.firstInit = true;
        }
        GuildManagement.Init();
        
        GameReady.Hide();
        GameEnd.Hide();
        GuildManagement.Hide();
        HeadHunterCenter.Hide();
        Lobby.Hide();
        StageList.Hide();
        Shop.Hide();
        Muhan.Hide();
        Setting.Hide();
        
        if(GameManager.lobbyin)
        {
            if (GameManager.quest_num == 1000)
            {
                gotoMuhan();
                GameManager.lobbyin = false;
            }
            else
            {
                gotoStagelist();
                GameManager.lobbyin = false;
            }
        }
        else
        {
            //ChangeScene(ID.LOBBY);
            gotoLobby();
        }
        AndroidAdmob.Get().Init();
    }