void AssigneEvents(PlayerDataCenter.IllNessData _data) { Text titlename = transform.Find("Text").GetComponent <Text>(); titlename.text = _data.title; //点击显示/隐藏 transform.Find("Toggle").GetComponent <Toggle>().onValueChanged.AddListener(iSon => { titlename.text = iSon ? _data.title : "***"; }); //点击编辑 transform.Find("Button").GetComponent <Button>().onClick.RemoveAllListeners(); transform.Find("Button").GetComponent <Button>().onClick.AddListener(() => { TTUIPage.ShowPage <CreateIllnessPopup>(_data); }); //点击病例 GetComponent <Button>().onClick.RemoveAllListeners(); GetComponent <Button>().onClick.AddListener(() => { PlayerDataCenter.NewSceneCame(_data); TTUIPage.ShowPage <UIThirdPage>(_data); }); }
/// <summary> /// ui中调用拾取:移除list中的model. 添加model 到对应的玩家背包list中 /// 拾取和切换武器都是用该方法 /// </summary> /// <param name="_propID"></param> public void PickupProp(int _propID) { //执行动画过程中,不宜拿道具 if (!mUserCtrl.CanPickup()) { return; } PropBaseModel model; if (playerData.PropInBag(_propID)) { //从背包中拿出 model = playerData.GetBagProp(_propID); Debug.Log("_propID = " + _propID + " |name = " + model.name); if (playerData.CurrentModel != null) { Debug.Log("playerData.CurrentModel ID = " + playerData.CurrentModel.prop.propID + "| current name = " + playerData.CurrentModel.name); } if (model == playerData.CurrentModel) { //当前拿的就是这把武器,那么就收起放背后 mUserCtrl.PutPropInBackpack(model); playerData.CurrentModel = null; Debug.Log("放背后呀"); } else { if (playerData.CurrentModel) { mUserCtrl.PutPropInBackpack(playerData.CurrentModel); } mUserCtrl.PickupProp(model); playerData.CurrentModel = model; } TTUIPage.ShowPage <aSongUI_Main>(); return; } if (playerData.PropInList(_propID)) { //list里面更新的话就只需要判断背包是否满了,满了就替换 model = playerData.GetListProp(_propID); //加入背包,会修改当前拿取的对象 AddPropToBag(model); RemovePropFromList(model); //在放入背包的时候,换手了,说明两者一样,那就需要人物拾取道具 if (model == playerData.CurrentModel) { mUserCtrl.PickupProp(model); } else { //道具没有直接拿到手上,那么就直接放入背包 mUserCtrl.PutPropInBackpack(model); } TTUIPage.ShowPage <aSongUI_Main>(); } }
public static void showbag() { // AssetDatabase.Refresh(); //Save.SaveGoods(); //Analysis.GoodsAnalysis(); //Analysis.GoodsAnalysis(); GameObject pa = GameObject.Find("BagPanel(Clone)").transform.GetChild(1).GetChild(0).gameObject; for (int i = 0; i < Save.Goodlist.Count; i++) { if (Save.Goodlist[i].Num > 0) { DataMgr.Item tt1 = DataMgr.GetInstance().GetItemID(Save.Goodlist[i].Id); GameObject ga = GameObject.Instantiate(Resources.Load <GameObject>("bagga")); Debug.Log(Save.Goodlist.Count); ga.transform.SetParent(pa.transform.GetChild(i)); // ga.transform.position = ga.transform.parent.transform.position; ga.transform.localScale = Vector3.one; ga.transform.localPosition = new Vector3(0f, 0, 0); ga.transform.GetChild(0).GetComponent <Image>().sprite = Resources.Load <Sprite>(tt1.item_Img); ga.transform.GetChild(1).GetComponent <Text>().text = Save.Goodlist[i].Num.ToString(); ga.transform.GetChild(0).GetComponent <Button>().onClick.AddListener(() => { TTUIPage.ShowPage <ttttt>(tt1); }); ga.transform.GetComponent <Button>().onClick.AddListener(() => TTUIPage.ShowPage <ttttt>(Save.Goodlist[i])); } }// }
public void ShowTishi(bool isOn, List <int> _itemID, string name) { buttonTishi.gameObject.SetActive(isOn); if (isOn) { if (name != "Quest_NPC") { buttonTishi.onClick.AddListener(() => TTUIPage.ShowPage <ShopPanel>(_itemID)); } else { TaskList = Save.TaskList; buttonTishi.onClick.AddListener(() => TTUIPage.ShowPage <TaskPanel>(TaskList)); } } if (!isOn) { if (name != "Quest_NPC") { TTUIPage.ClosePage <ShopPanel>(); } else { TTUIPage.ClosePage <TaskPanel>(); } buttonTishi.onClick.RemoveAllListeners(); } }
public void Awake() { _frame = this.GetComponent <Image> (); foreach (Transform _tr in this.transform) { if (_cnttxt == null) { _cnttxt = _tr.GetComponent <Text> (); } if (_iconimg == null) { _iconimg = _tr.GetComponent <Image> (); } } this.onClick.AddListener(() => { if (_Items != null && (_Items._NModel >= (int)ModelEnum.Food && _Items._NModel <= (int)ModelEnum.FoodEnd) || (_Items._NModel >= (int)ModelEnum.Equip && _Items._NModel <= (int)ModelEnum.EquipEnd)) { TTUIPage.ShowPage <UIItemPage>(); UIItemPageImpl.Instance().setinfo(this); } else if (_Items._NModel >= (int)ModelEnum.ActionAttack && _Items._NModel <= (int)ModelEnum.AttackEnd) { //GameResources.Instance()._GameMgr._AIPlayer.onattackenter(this); } else { GameResources.Instance()._GameMgr._AIPlayer.onitemclick(this); } }); }
public override void Awake(GameObject go) { base.Awake(go); //初始化物品预制 itemPrefab = Resources.Load <GameObject>("UIPrefab/BagItem"); Grid = transform.Find("Content").transform; BagItem.OnItemSelceted += ShowSelectedItemInfo; iteminfo = transform.Find("Eject"); infoName = iteminfo.transform.Find("TextName").GetComponent <Text>(); infoDes = iteminfo.transform.Find("TextDes").GetComponent <Text>(); iteminfo.gameObject.SetActive(false); buttonUse = iteminfo.transform.Find("ButtonUse").GetComponent <Button>(); buttonCancel = iteminfo.transform.Find("ButtonCancel").GetComponent <Button>(); buttonCancel.onClick.AddListener(() => iteminfo.gameObject.SetActive(false)); buttonUse.onClick.AddListener(() => { iteminfo.gameObject.SetActive(false); Save.UseItem(tempItem); //SoundManager.instance.PlayingSound("BuyItem"); TTUIPage.ShowPage <TipPanel>("使用成功!"); Save.UpdateUser(); ShowBag(); }); for (int i = 0; i < Grid.childCount; i++) { GridArray.Add(Grid.GetChild(i).gameObject); } }
/// <summary> /// 是否显示提示按钮 /// </summary> /// <param name="isShow">按钮是否显示</param> /// <param name="_itemLIst">NPC传来的物品列表</param> public void ShowTips(bool isShow, List <int> _itemLIst) { TipsButton.gameObject.SetActive(isShow);//提示按钮默认隐藏 if (isShow) { TipsButton.onClick.AddListener(() => { TTUIPage.ShowPage <ShopPanel>(_itemLIst); }); } if (!isShow) { TTUIPage.ClosePage <ShopPanel>(); if (ShopPanel.statue == true) { GameObject SS = GameObject.Find("NormalRoot"); if (SS.transform.childCount < 3) { } else { GameObject game = GameObject.Find("NormalRoot").transform.Find("ShopPanel(Clone)").gameObject; GameObject.Destroy(game); } } TipsButton.onClick.RemoveAllListeners(); } }
// Use this for initialization void Start() { //第一个值是起点,第二个值是终点。第三个值是速度 //cube.position = Vector3.MoveTowards(Vector3.zero, Vector3.forward * 10, 10); cam.transform.DOMove(targetPoint.position, 8); TTUIPage.ShowPage <TitlePanel>(); }
void Show() { info.gameObject.SetActive(true); Debug.Log(info.gameObject.name); OkBtn = info.Find("UseBtn").GetComponent <Button>(); CancelBtn = info.Find("Cancel").GetComponent <Button>(); CancelBtn.onClick.AddListener(() => { info.gameObject.SetActive(false); }); OkBtn.onClick.AddListener(() => { if (gameObject.name != "Image(Clone)") { ID = int.Parse(gameObject.name); GoodsModel gm = Save.Equiplist.Find(x => x.Id == ID); Save.BuyItem(Read.GedInstance().GetItemId(ID), false); if (gm != null) { Save.UseItem(Read.GedInstance().GetItemId(ID), true); } //GetComponent<Image>().sprite = Resources.Load<Sprite>("Icon/Slotlayout"); //if (gameObject.name==ID.ToString()) //{ // gameObject.name = "Image"; //} } info.gameObject.SetActive(false); TTUIPage.ShowPage <EquiPanel>(); }); }
/// <summary> /// 是否显示提示按钮 /// </summary> /// <param name="isshow">按钮是否显示</param> /// <param name="npcTag">NPC的标签</param> /// <param name="_list">NPC传来的物品列表</param> public void ShowTishi(bool isshow, string npcTag, List <int> _list) { buttonTishi.gameObject.SetActive(isshow);//默认隐藏提示按钮 if (isshow) { if (npcTag == "Npc_Shop") { buttonTishi.onClick.AddListener(() => TTUIPage.ShowPage <ShopPanel>(_list)); } else if (npcTag == "Npc") { buttonTishi.onClick.AddListener(() => TTUIPage.ShowPage <TaskListPanel>(_list)); } } if (!isshow) { if (TTUIPage.allPages.ContainsKey("ShopPanel")) { TTUIPage.ClosePage <ShopPanel>(); } buttonTishi.onClick.RemoveAllListeners(); } }
private void OnClickCommit() { List <string> levels = new List <string>(); foreach (var item in LevelTree.nodeData[0].Children) { if (item.Check) { levels.Add(item.Title); } } List <string> componentsCode = new List <string>(); foreach (UTreeNodeData node1 in ComponentTree.nodeData) { foreach (UTreeNodeData node2 in node1.Children) { foreach (UTreeNodeData node3 in node2.Children) { if (node3.Check) { string codeNum = node3.Title; componentsCode.Add(codeNum); } } } } TTUIPage.ShowPage <UICountTable>(TreeData.Instance.GetCountTable(levels, componentsCode)); }
public LevelData[] lvls; // 关卡配置 private void Start() { TTUIPage.ShowPage <LogoUIPage>(); heartNum = PlayerPrefs.GetInt("heartNum", 0); diamondNum = PlayerPrefs.GetInt("diamondNum", 0); noAds = PlayerPrefs.GetInt("noAds") == 1; }
private void OnEnable() { TTUIPage.ShowPage <UITitle>(); TTUIPage.ClosePage <UITitle>(); TTUIPage.ShowPage <UICProcess>(); TTUIPage.ClosePage <UICProcess>(); TTUIPage.ShowPage <UIIntroduce>(); TTUIPage.ClosePage <UIIntroduce>(); TTUIPage.ShowPage <UIIntroduceBtn>(); TTUIPage.ClosePage <UIIntroduceBtn>(); TTUIPage.ShowPage <UITip>(); TTUIPage.ClosePage <UITip>(); TTUIPage.ShowPage <UIKou>(); TTUIPage.ClosePage <UIKou>(); TTUIPage.ShowPage <UISetValue>(); TTUIPage.ClosePage <UISetValue>(); TTUIPage.ShowPage <UIQuestion>(); TTUIPage.ClosePage <UIQuestion>(); TTUIPage.ShowPage <UISingleBtn>(); TTUIPage.ClosePage <UISingleBtn>(); TTUIPage.ShowPage <UIPicture>(); TTUIPage.ClosePage <UIPicture>(); TTUIPage.ShowPage <UISlider>(); TTUIPage.ClosePage <UISlider>(); TTUIPage.ShowPage <UIEnd>(); TTUIPage.ClosePage <UIEnd>(); }
void Update() { if (Input.GetKeyDown(KeyCode.Space)) { TTUIPage.ShowPage <ForgePanel>(); } if (Input.GetAxis("Vertical") != 0 || Input.GetAxis("Horizontal") != 0) { myanimator.SetBool("iswalk", true); m_CharacterController.SimpleMove(transform.forward * Input.GetAxis("Vertical") * speed); transform.Rotate(new Vector3(0, Input.GetAxis("Horizontal") * 3, 0)); //rigidbody.MovePosition(go.transform.position + transform.forward * Input.GetAxis("Vertical")); //rigidbody.MoveRotation(go.transform.rotation * Quaternion.Euler(0, Input.GetAxis("Horizontal") * 3, 0)); //Quaternion quaternion = Quaternion.Euler(0, Camera.main.transform.rotation.y, 0); //m_CharacterController.SimpleMove(quaternion* new Vector3(Input.GetAxis("Horizontal"),0, Input.GetAxis("Vertical"))); } else { myanimator.SetBool("iswalk", false); } if (Input.GetKeyDown(KeyCode.J)) { myanimator.SetTrigger("skill2"); } if (Input.GetKeyDown(KeyCode.Space)) { myanimator.SetTrigger("skill1"); } }
private static IEnumerator ExtractResourceFile() { TtuiUtils.GetPage <StartPage>().SetStartButtonEnable(false); TTUIPage.ShowPage <LoadingTip>(); TtuiUtils.GetPage <LoadingTip>().SetText("第一次运行解压中..."); var textAsset = Resources.Load("LocalFiles/DefaultResource") as TextAsset; if (textAsset != null) { var bytes = textAsset.bytes; var tempFilePath = Application.temporaryCachePath + "/MikuMikuARTemp.zip"; var appDataPath = Paths.Getter().Home(); var extractDataThread = new Thread(() => { Directory.CreateDirectory(appDataPath); FileUtils.ExtractZipBytesToFolder(appDataPath, bytes, tempFilePath); }); extractDataThread.Start(); while (extractDataThread.IsAlive) { yield return(null); } } else { Directory.CreateDirectory(Paths.Getter().Home()); Debug.Log("No resource file under LocalFiles/DefaultResource. Skip extracting."); } TTUIPage.ClosePage <LoadingTip>(); TtuiUtils.GetPage <StartPage>().SetStartButtonEnable(true); }
public static void BuyItem(DataMgr.Item _item) { Debug.Log("买买买"); Debug.Log(_item.item_ID); if (Goodlist == null) { Goodlist = new List <GoodsModel>(); } GoodsModel gm = Goodlist.Find(x => x.Id == _item.item_ID); if (gm != null) { gm.Num += 1; } else { Goodlist.Add(new GoodsModel() { Id = _item.item_ID, Num = 1 }); } // SaveGoods(); TTUIPage.ShowPage <TipePanel>(_item.item_ID); }
public void SwitchPlayPause(bool play) { if (_playing == play) { return; } _playing = play; if (_playing) { _audioSource.Play(); } else { _audioSource.Pause(); } foreach (var obj in _mmdObjects) { var mmdGameObject = obj.GetComponent <MmdGameObject>(); mmdGameObject.Playing = _playing; } if (_playing) { if (_currentXrController.EnableGesture()) { TTUIPage.ShowPage <PlayingButtonPage>(); } else { TTUIPage.ShowPage <PlayingBlankPage>(); } } OnPlayPause.Invoke(_playing); }
public static IEnumerator DelayShowPage <T>(int delayFrames, object pageData) where T : TTUIPage, new() { for (var i = 0; i < delayFrames; i++) { yield return(null); } TTUIPage.ShowPage <T>(pageData); }
// Use this for initialization void Start() { TTUIPage.ShowPage <Homepanel>(); //TTUIPage.ShowPage<UITopBar>(); //TTUIPage.ShowPage<UIMainPage>(); //TTUIPage.ShowPage<thisShow>(); // CreatXML(); }
public void OnPointerDown(PointerEventData eventData) { a = int.Parse(eventData.pointerCurrentRaycast.gameObject.name); TTUIPage.ShowPage <TshiPanel>(items[a]); toggle = transform.Find("Toggle").GetComponent <Toggle>(); toggle.isOn = true; //Save.SaveGoodss(); }
private void Start() { Screen.sleepTimeout = SleepTimeout.NeverSleep; InitScene(); TTUIPage.ShowPage <MmdStagePanel>(); Instance = this; InitUiLayer(); }
private void Start() { TTUIPage.ShowPage <UIToolTip>(); TTUIPage.ShowPage <UIBattle_ShowPlaySkill>(); TTUIPage.ShowPage <UIBattle_ShowEnemySkill>(); TTUIPage.ShowPage <UICatchPokemon>(); TTUIPage.ShowPage <UI_PokemonBagIcon>(); TTUIPage.ShowPage <UI_BagIcon>(); }
public static IEnumerator DoRunWithLoadingUI <T>(Delegates.Runnable runnable) where T : TTUIPage, new() { TTUIPage.ShowPage <T>(); yield return(null); runnable(); TTUIPage.ClosePage <T>(); yield return(null); }
public void initpages() { TTUIPage.ShowPage <UIMainBar> (); TTUIPage.ShowPage <UIMainFramePage> (); TTUIPage.ClosePage <UIMainFramePage> (); UISkillPage.Instance().show(false); }
void Awake() { Instance = this; TTUIPage.ShowPage <UIMain>(); if (ScoreSave.Instance == null) { Instantiate(Resources.Load("ScoreSave")); } }
public override void OnMouseLeftClick() { switch (UIManager.Instance.step) { #region case 1001001: TTUIPage.ShowPage <UIAttention>(); foreach (GameObject item in att) { item.GetComponent <Highlighter>().tween = false; item.GetComponent <Collider>().enabled = false; } TTUIPage.ClosePage <UITip>(); break; #endregion #region case 2001001: TTUIPage.ShowPage <UIAttention>(); foreach (GameObject item in att) { item.GetComponent <Highlighter>().tween = false; item.GetComponent <Collider>().enabled = false; } TTUIPage.ClosePage <UITip>(); break; #endregion #region case 3001001: TTUIPage.ShowPage <UIAttention>(); foreach (GameObject item in att) { item.GetComponent <Highlighter>().tween = false; item.GetComponent <Collider>().enabled = false; } TTUIPage.ClosePage <UITip>(); break; #endregion #region case 4001001: TTUIPage.ShowPage <UIAttention>(); foreach (GameObject item in att) { item.GetComponent <Highlighter>().tween = false; item.GetComponent <Collider>().enabled = false; } TTUIPage.ClosePage <UITip>(); break; #endregion default: break; } }
void LoadUserImprot(string message) { SetLastInactive(); userimport = new GameObject("UserImport" + userimporottaltol); OBJLoader = userimport.AddComponent <OBJ>(); STLLoader = userimport.AddComponent <STL>(); Dictionary <int, string> map = MSGCenter.UnFormatMessage(message); //string[] s = message.Split('*'); string serverpath = map[1]; if (map.ContainsKey(2)) { string md5 = map[2]; CreatModel(md5); } if (serverpath.IsObj()) { TTUIPage.ShowPage <UINotice>("请使用stl格式的模型"); //pcpath = "file:///" + pcpath; //try //{ // OBJLoader.Load(pcpath, (result) => // { // MatchingModelNormal(userimport,v, hasposvalue); // userimport.AddComponent<MeshCollider>(); // MSGCenter.Execute(Enums.ModelPath.Result.ToString(), result ); // }); //} //catch (System.Exception e) //{ // MSGCenter.Execute(Enums.ModelPath.Result.ToString(), e.ToString() ); // throw; //} } else if (serverpath.IsStl()) { string stlpath = Tool.LocalModelonSavePath + PlayerDataCenter.Currentillnessdata.ID + ".stl";// mm.pdata.LocalUserModelPath;// if (!Tool.CheckFileExist(stlpath)) { MyWebRequest.Instance.DownloadFileFromWed(serverpath, Tool.LocalModelonSavePath, PlayerDataCenter.Currentillnessdata.ID + ".stl" , (suc, str) => { TTUIPage.ShowPage <UINotice>(Tool.DownloadDir + str); if (suc) { TTUIPage.ClosePage <UINotice>(); CreatStlInstance(stlpath); } }); } else { CreatStlInstance(stlpath); } } }
private void ShowBattleUI() { TTUIPage.ShowPage <UIBattle_Buttons>(); TTUIPage.ShowPage <UIBattle_EnemyInfo>(); TTUIPage.ShowPage <UIBattle_PokemonInfos>(); TTUIPage.ClosePage <UI_PokemonBagIcon>(); TTUIPage.ClosePage <UI_BagIcon>(); }
// Use this for initialization void Start() { int width = (int)Tool.ScreenSize.x; int height = (int)Tool.ScreenSize.y; Screen.SetResolution(width, height, false); //事件注册时机 //TTUIPage.ShowPage<UIThirdPage>(); TTUIPage.ShowPage <UIFirstPage> (); }
private void Start() { Instance = this; Screen.sleepTimeout = SleepTimeout.NeverSleep; InitScene(); TTUIPage.ShowPage <MmdStagePanel>(); OnceTipPage.ShowOnceTip(TipNames.HowToStart); InitUiLayer(); InitXrTypes(); ChangeXrType(XrType.VrManual); }