private void OnGetProducts(List <Product> products) { if (productViewPort != null) { for (int i = 0; i < productViewPort.transform.childCount; i++) { Destroy(productViewPort.transform.GetChild(i).gameObject); } foreach (var product in products) { var productView = Gs2Util.LoadGlobalResource <ProductView>(); productView.transform.SetParent(productViewPort.transform); productView.Initialize(product); productView.transform.localScale = new Vector3(1, 1, 1); if (!productView.Sold) { productView.transform.GetComponentInChildren <Button>().onClick.AddListener( () => { ClickToBuy(product); } ); } } } }
public void OnLogin(EzAccount account, GameSession session) { var request = Gs2Util.LoadGlobalResource <MoneyRequest>("MoneyRequest"); request.gameSession = session; StartCoroutine(LoadScene()); }
public void OnLogin(EzAccount account, GameSession session) { var request = Gs2Util.LoadGlobalResource <AccountTakeOverRequest>("AccountTakeOverRequest"); request.gameSession = session; SceneManager.LoadScene("AccountTakeOver"); }
private void OnListGroupQuestModelFunc(List <EzQuestGroupModel> questGroups) { if (questGroupsViewPort != null) { for (int i = 0; i < questGroupsViewPort.transform.childCount; i++) { Destroy(questGroupsViewPort.transform.GetChild(i).gameObject); } foreach (var questGroup in questGroups) { var questType = Gs2Util.LoadGlobalResource <QuestGroupView>(); questType.transform.SetParent(questGroupsViewPort.transform); questType.Initialize(new QuestGroupInformation(questGroup)); questType.transform.localScale = new Vector3(1, 1, 1); questType.transform.GetComponentInChildren <Button>().onClick.AddListener( () => { _currentCompletedQuestList = _completedQuestLists.Find(completedQuestList => completedQuestList.QuestGroupName == questGroup.Name); ClickToSelect(questGroup); } ); questType.gameObject.SetActive(true); } } }
public void OnLogin(EzAccount account, GameSession session) { var request = Gs2Util.LoadGlobalResource <MatchmakingRequest>("MatchmakingRequest"); request.gameSession = session; SceneManager.LoadScene("Matchmaking"); }
public void OnCompleteMatchmaking(EzGathering gathering, List <string> joinPlayerIds) { var request = Gs2Util.LoadGlobalResource <RealtimeRequest>("RealtimeRequest"); request.gameSession = _gameSession; request.gatheringId = gathering.Name; SceneManager.LoadScene("Realtime"); }
public void OnLogin(EzAccount account, GameSession session) { { var request = Gs2Util.LoadGlobalResource <MoneyRequest>("MoneyRequest"); request.gameSession = session; } { var request = Gs2Util.LoadGlobalResource <StaminaRequest>("StaminaRequest"); request.gameSession = session; } SceneManager.LoadScene("Stamina"); }
public void OnPlayGameHandler() { if (_stateMachine.PlayGame()) { var widget = Gs2Util.LoadGlobalResource <PlayGameWidget>(); var parent = GameObject.Find("PlayGameHolder"); var rectTransform = (RectTransform)widget.transform; rectTransform.SetParent(parent.transform); rectTransform.position = parent.transform.position; rectTransform.sizeDelta = new Vector2(); rectTransform.localScale = new Vector3(1, 1, 1); widget.gameObject.SetActive(true); } }
private void OnListQuestModel(List <EzQuestModel> quests) { if (questsViewPort != null) { for (int i = 0; i < questsViewPort.transform.childCount; i++) { Destroy(questsViewPort.transform.GetChild(i).gameObject); } foreach (var quest in quests) { var questType = Gs2Util.LoadGlobalResource <QuestView>(); questType.transform.SetParent(questsViewPort.transform); questType.Initialize(new QuestInformation(quest, _currentCompletedQuestList)); questType.transform.localScale = new Vector3(1, 1, 1); questType.transform.GetComponentInChildren <Button>().onClick.AddListener( () => { ClickToSelect(quest); } ); } } }