コード例 #1
0
ファイル: ShopUI.cs プロジェクト: StevenKeir/MinerWars
 private void OnEnable()
 {
     if (ShopUI.shopUI == null)
     {
         ShopUI.shopUI = this;
     }
 }
コード例 #2
0
ファイル: ShopItemUI.cs プロジェクト: K33W1/MOBIGAM-MP
    public void Initialize(ShopUI shopUI, ShopItem shopItem)
    {
        this.shopUI   = shopUI;
        this.shopItem = shopItem;

        UpdateUI();
    }
コード例 #3
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
コード例 #4
0
    void BuyingGoods()
    {
        if (!isoutcoin)
        {
            FlyCoin();

            //增加钱
            ShopUI _shop = transform.Find("/goodBox").GetComponent <ShopUI>();
            _shop.AddMoney(selectgoods.goods.Price);

            isoutcoin = !isoutcoin;
        }

        TimeTool.SetWaitTime(0.5f, gameObject, () =>
        {
            //买东西
            moveType = MoveType.Vertical;
            if (info.startPiont == 0)
            {
                SetTarget("finish2");
            }
            else
            {
                SetTarget("finish1");
            }

            ChangeCharaState(CharaState.Out);
        });
    }
コード例 #5
0
 private void Awake()
 {
     player = GameObject.Find("Player");
     pi     = player.GetComponent <PlayerInfo>();
     shop   = shop.GetComponent <ShopUI>();
     inven  = player.transform.Find("InvenCanvas").Find("Inventory").gameObject.GetComponent <InventoryUI>();
 }
コード例 #6
0
    public void AddSection()
    {
        ShopUI shopUI = (ShopUI)target;

        shopUI.sectionsToInstantiate.RemoveAll(x => x == null);
        shopUI.sectionsToInstantiate.Add(new ShopUI.ShopSection());
    }
コード例 #7
0
    void AddGoodsToHead()
    {
        GameObject     goods   = new GameObject();
        SpriteRenderer _sprite = goods.AddComponent <SpriteRenderer>();

        ShopUI _shop = transform.Find("/goodBox").GetComponent <ShopUI>();

        CharBag.Goods[] goodslist = _shop.GetGoods();

        //如果货架上有商品,则添加道具到背包
        if (goodslist[selectgoods.slotID - 1].Name != null && goodslist[selectgoods.slotID - 1].ID != 0)
        {
            //移除道具
            _shop.BuyedGoods(selectgoods);
        }

        _sprite.sprite           = Materiral.GetMaterialIcon(selectgoods.goods.MateriralType, selectgoods.goods.ID);
        _sprite.sortingLayerName = "Character";

        //设定道具的为角色的子物件
        goods.transform.SetParent(this.transform, false);
        goods.transform.position = goodsVertor;

        //把物体移动到头上
        LeanTween.move(goods.gameObject, new Vector2(goodsVertor.x, goodsVertor.y + 0.5f), 0.5f);
    }
コード例 #8
0
ファイル: ShopUI.cs プロジェクト: vin120/TaiDou
 private void Awake()
 {
     Instance = this;
     tween = this.GetComponent<TweenPosition>();
     coinScrollView = transform.Find("CoinScrollView").gameObject;
     diamondScrollView = transform.Find("DiamondScrollView").gameObject;
     diamondScrollView.SetActive(false);
 }
コード例 #9
0
ファイル: ShopUI.cs プロジェクト: Fir0x/Projet-S2-MSN2
    void Start()
    {
        gameObject.transform.GetChild(0).gameObject.SetActive(false);

        instance = this;

        slots = itemsParent.GetComponentsInChildren <ShopSlot>();
    }
コード例 #10
0
 void Awake()
 {
     Instance          = this;
     tween             = this.GetComponent <TweenPosition>();
     coinScrollView    = transform.Find("CoinScrollView").gameObject;
     diamondScrollView = transform.Find("DiamondScrollView").gameObject;
     diamondScrollView.SetActive(false);
 }
コード例 #11
0
ファイル: ShopSlot.cs プロジェクト: Fir0x/Projet-S2-MSN2
    private void Start()
    {
        inventory = Inventory.instance;
        shop      = Shop.instance;
        shopUI    = ShopUI.instance;

        isHub = shop.isHub;
    }
コード例 #12
0
ファイル: ShopUI.cs プロジェクト: srgvn/itplus_vlGroup
 void Awake()
 {
     if (_instance != null)
     {
         Destroy(this.gameObject);
     }
     _instance = this;
 }
コード例 #13
0
ファイル: ShopUI.cs プロジェクト: a710594/Touhou_Dungeon
 public static void Open()
 {
     if (Instance == null)
     {
         Instance = ResourceManager.Instance.Spawn("ShopUI", ResourceManager.Type.UI).GetComponent <ShopUI>();
     }
     Instance.Init();
 }
コード例 #14
0
    public void Yes()
    {
        Hide();
        ShopUI shopUI = ArenaMenuUI.GetInstance().GetPanel(MenuName.SHOP) as ShopUI;

        shopUI.SetFromPanel(this);
        shopUI.Show();
    }
コード例 #15
0
 protected override void Awake()
 {
     base.Awake();
     gameObject.tag = "ShopGrid";
     itemNameText   = rectTransform.Find("ItemName").GetComponent <Text>();
     moneyText      = rectTransform.Find("MoneyText").GetComponent <Text>();
     borderTrans    = rectTransform.Find("GridBorder") as RectTransform;
     shopUI         = rectTransform.GetComponentInParent <ShopUI>();
 }
コード例 #16
0
 private void Awake()
 {
     controller      = GetComponentInParent <RestController>();
     statusUI        = GetComponentInChildren <StatusUI>();
     dialogueManager = GetComponentInChildren <DialogueManager>();
     inventoryUI     = GetComponentInChildren <InventoryUI>();
     shopUI          = GetComponentInChildren <ShopUI>();
     menuUI          = GetComponentInChildren <MenuUI>();
 }
コード例 #17
0
    void OpenRecipeMenu(GameObject go)
    {
        Plane.SetActive(true);
        MenuUI.SetActive(true);
        recipeUI.SetActive(false);

        ShopUI.ChangeRecipeUiState();

        EventTriggerListener.Get(btn_Close.gameObject).onClick = CloseRecipeMenu;
        GetRecipeList();
    }
コード例 #18
0
ファイル: AvatarUI.cs プロジェクト: kidundead/ow
    public void HandleEvent(UIControl control, int command, float wparam, float lparam)
    {
        if (control == returnButton)
        {
            AudioPlayer.PlayAudio(ArenaMenuUI.GetInstance().GetComponent <AudioSource>());
            Hide();
            ArenaMenuUI ui = GameObject.Find("ArenaMenuUI").GetComponent <ArenaMenuUI>();
            ui.GetPanel(MenuName.ARENA).Show();
            GameApp.GetInstance().Save();
        }

        if (control == avatarScroller && command == (int)UIImageScroller.Command.ScrollSelect)
        {
            currentSelectionIndex = (int)wparam;

            SetBuyButtonText();
            ChangeAvatarModel(BUTTON_NUM - 1 - currentSelectionIndex);
            avatarInfoPanel.SetText(AvatarInfo.AVATAR_INFO[BUTTON_NUM - 1 - currentSelectionIndex]);
            UpdateCashPanel();
        }

        if (control == buyButton)
        {
            AudioPlayer.PlayAudio(ArenaMenuUI.GetInstance().GetComponent <AudioSource>());
            if (GameApp.GetInstance().GetGameState().GetAvatarData((AvatarType)(BUTTON_NUM - 1 - currentSelectionIndex)) == AvatarState.ToBuy)
            {
                GameConfig gConf = GameApp.GetInstance().GetGameConfig();
                if (GameApp.GetInstance().GetGameState().BuyAvatar((AvatarType)(BUTTON_NUM - 1 - currentSelectionIndex), gConf.GetAvatarConfig(BUTTON_NUM - 1 - currentSelectionIndex).price))
                {
                    SetBuyButtonText();
                }
                else
                {
                    TopDialogUI.GetInstance().ShowDialog();
                }
                UpdateAvatarIcon();
                UpdateCashPanel();
            }
            else if (GameApp.GetInstance().GetGameState().GetAvatarData((AvatarType)(BUTTON_NUM - 1 - currentSelectionIndex)) == AvatarState.Avaliable)
            {
                GameApp.GetInstance().GetGameState().Avatar = (AvatarType)(BUTTON_NUM - 1 - currentSelectionIndex);
            }
        }

        else if (control == getMoreMoneyButton)
        {
            AudioPlayer.PlayAudio(ArenaMenuUI.GetInstance().GetComponent <AudioSource>());
            Hide();
            ShopUI shopUI = GameObject.Find("ArenaMenuUI").GetComponent <ArenaMenuUI>().GetPanel(MenuName.SHOP) as ShopUI;
            shopUI.SetFromPanel(this);
            shopUI.Show();
        }
    }
コード例 #19
0
ファイル: ShopUI.cs プロジェクト: vinhpsviguys/sample
    void Awake()
    {
        if (_instance != null && _instance != this)
        {
            // If that is the case, we destroy other instances
            Destroy(gameObject);
        }

        // Here we save our singleton instance
        _instance = this;
        //DontDestroyOnLoad(this.gameObject);
    }
コード例 #20
0
ファイル: ShopUI.cs プロジェクト: MelvinKuhlmann/TopdownGame
    private void Awake()
    {
        if (instance != null)
        {
            Debug.LogWarning("More than one instance of ShopUI found");
            return;
        }

        instance = this;

        ShopItemEvents.OnItemClick += ItemSelected;
    }
コード例 #21
0
 void Start()
 {
     shopUI         = transform.GetComponent <ShopUI> ();
     shopNavigation = transform.GetComponent <ShopNavigation> ();
     shopNavigation.LoadVariables();
     shopUI.LoadVariables();
     SetPlayerNotReady();
     for (int i = 0; i < ownedSpells.Count; i++)
     {
         shopNavigation.spellChoiceContainer.transform.Find(ownedSpells[i].spellName).GetComponent <SpellIcon> ().ownedIcon.SetActive(true);
     }
     hasStarted = true;
 }
コード例 #22
0
    public void Yes()
    {
        Debug.Log("yes");
        //Hide();
        AvatarUI avatarUIPanel = ArenaMenuUI.GetInstance().GetPanel(MenuName.AVATAR) as AvatarUI;

        avatarUIPanel.Hide();
        iapDialog.Hide();
        ShopUI shopUI = ArenaMenuUI.GetInstance().GetPanel(MenuName.SHOP) as ShopUI;

        shopUI.SetFromPanel(avatarUIPanel);
        shopUI.Show();
    }
コード例 #23
0
 public void LoadVariables()
 {
     shop          = transform.GetComponent <Shop> ();
     shopUI        = transform.GetComponent <ShopUI> ();
     input         = transform.GetComponent <ShopInputController> ();
     lastInputTime = Time.time;
     currentX      = 0;
     currentY      = 0;
     FillSpellIconsArray();
     shop.Select(spellArray[currentX, currentY]);
     currentState = ShopStates.Navigating;
     hasStarted   = true;
 }
コード例 #24
0
    void LoadMainUI()
    {
        ShopUI.SetActive(false);
        ProfileUI.SetActive(false);
        RewardsUI.SetActive(false);
        RateUI.SetActive(false);
        SettingsUI.SetActive(false);
        MainUI.SetActive(true);

        RegisterCanvas.enabled = false;
        MainCanvas.enabled     = true;

        UsernameText.text = PlayerPrefs.GetString("USERNAME");
        MoneyText.text    = PlayerPrefs.GetInt("MONEY") + " ₹";
    }
コード例 #25
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(this);
        }

        shopPanel     = GameObject.Find("ShopPanel");
        shopItemsArea = GameObject.Find("ShopItemsArea").transform;
        shopSlots     = shopItemsArea.GetComponentsInChildren <ShopSlot>().ToList();
        tooltip       = GameObject.Find("TooltipPanel");
    }
コード例 #26
0
    void CloseRecipeMenu(GameObject go)
    {
        Plane.SetActive(false);
        _fitter.enabled = false;

        ShopUI.ChangeRecipeUiState();

        scrollList.GetComponent <ScrollRect>().enabled = false;

        SlotList = null;

        foreach (Transform obj in _fitter.transform)
        {
            Destroy(obj.gameObject);
        }
    }
コード例 #27
0
        public override void Load()
        {
            Instance = this;
            Console  = this.Logger;

            if (!Main.dedServ)
            {
                // Custom UI
                m_ShopUI = new ShopUI();
                m_ShopUI.Activate();

                UserInterface = new UserInterface();
            }

            Config.Load();
        }
コード例 #28
0
    // Update is called once per frame
    void Update()
    {
        if (Camera.main != null && !setAudioTime)
        {
            //Camera.mainCamera.audio.time = GameApp.GetInstance().GetGameState().MenuMusicTime;
            setAudioTime = true;
        }


        ArenaMenuPanel panel = panels[MenuName.ARENA] as ArenaMenuPanel;

        if (panel != null)
        {
            panel.Update();
        }

        for (int i = 0; i < MenuName.MENU_COUNT; i++)
        {
            if (panels[i] != null)
            {
                panels[i].UpdateLogic();
            }
        }



        ShopUI shopUI = panels[MenuName.SHOP] as ShopUI;

        if (shopUI != null)
        {
            shopUI.GetPurchaseStatus();
        }

        if (!ReviewDialogUI.GetInstance().IsVisible())
        {
            foreach (UITouchInner touch in iPhoneInputMgr.MockTouches())
            {
                if (m_UIManager != null)
                {
                    if (m_UIManager.HandleInput(touch))
                    {
                        continue;
                    }
                }
            }
        }
    }
コード例 #29
0
 protected override void Awake()
 {
     base.Awake();
     if (scriptEnv != null)
     {
         luaClick = scriptEnv.Get <Action <PointerEventData> >("Click");
         luaClick = scriptEnv.Get <Action <PointerEventData> >("Click");
         luaClick = scriptEnv.Get <Action <PointerEventData> >("Click");
     }
     if (luaAwake != null)
     {
         luaAwake();
         return;
     }
     gameObject.tag = "ShopGrid";
     itemNameText   = rectTransform.Find("ItemName").GetComponent <Text>();
     moneyText      = rectTransform.Find("MoneyText").GetComponent <Text>();
     borderTrans    = rectTransform.Find("GridBorder") as RectTransform;
     shopUI         = rectTransform.GetComponentInParent <ShopUI>();
 }
コード例 #30
0
    public void StartStory()
    {
        if (StoryList.Count == 0 || StoryList == null)
        {
            Debug.LogError("Can't Start Story,Don't have StoryList!");
            return;
        }
        Scene scence = SceneManager.GetActiveScene();

        Debug.Log("Now scence: " + scence.name);

        if (PlayerInfo.GetNowscene() == 0)
        {
            ShopUI.ChangeStoryState();
            Character.ChangeStoryState();
        }
        if (PlayerInfo.GetNowscene() > 0)
        {
            MapPathManager.ChangeStoryState();
        }

        if (chatmanager == null)
        {
            GameObject newobj = new GameObject();
            newobj.name = "ChatSystem";
            chatmanager = newobj.AddComponent <ChatManager>();
            newobj.AddComponent <AudioSource>();
        }
        chatmanager.SetNowScene(scence.name);
        chatmanager.PushStoryList(StoryList);

        ChatEvent ct = (ChatEvent)chatmanager.GetStoryList()[0];

        Loading.GetInstance().LoadingStoryScene(ct.StoryName, () =>
        {
            chatmanager.LoadChatStory(ct.StoryName);
        });
    }
コード例 #31
0
ファイル: Game.cs プロジェクト: PhungThanhTu/UnityPlane
 void LoadComponent()
 {
     waveSpawner             = this.gameObject.GetComponent <WaveSpawner>();
     shopUIComponent         = shopUI.GetComponent <ShopUI>();
     shopUIComponent.plrdata = playerData;
 }