public void SetModule(Module m) { UIObj newobj = m.MUI; if (GameManager.Module != null) { UIObj oldobj = GameManager.Module.MUI; if (GameManager.Module == m) { return; } else if (GameManager.Module.Index < m.Index) { Tweens.SwoopTo(oldobj.transform, ModuleLeft.position).OnComplete(() => oldobj.SetActive(false)); newobj.transform.position = ModuleRight.position; } else { Tweens.SwoopTo(oldobj.transform, ModuleRight.position).OnComplete(() => oldobj.SetActive(false)); newobj.transform.position = ModuleLeft.position; } } else { newobj.transform.position = ModuleRight.position; } Sequence s = Tweens.SwoopTo(m.MUI.transform, ModuleTarget.position); }
public IEnumerator LoadModuleUI(Module m, IntVector v) { UIObj mui = m.MUI; Transform start = ModuleRight; Transform end = ModuleTarget; if (v.x == 1) { start = ModuleRight; } else if (v.x == -1) { start = ModuleLeft; } else { start = ModuleRight; } mui.transform.position = start.position; Sequence s = Tweens.SwoopTo(mui.transform, end.position); yield return(s.WaitForCompletion()); }
public override void OnEnter(object param1 = null, object param2 = null, object param3 = null) { mPanel = UIObj.GetComponent <LoadingPanel>(); loading = (ProcedureLoadingScene)param1; UIObj.SetActive(true); }
public void ResetInformation(UIObj unhovered) { if (unhovered is VendorButton) { infoPane.OpenTab(0); } }
public void SetupFace(Face f, FIRL frame, GrandData g) { f.AddAction(TouchAction.Up, () => { if (ginfo_target != g) { if (ginfo != null) { ginfo.PoolDestroy(); } ginfo_face = f; ginfo_target = g; ginfo = GameManager.UI.GrandInfo(g); Vector3 pos = new Vector3(this.transform.position.x, f.transform.position.y - 10, 0.0F); ginfo.SetUIPositionFromWorld(pos); ginfo.FitOnScreen(); ginfo.SetActive(false); ginfo.TweenActive(true); lastsmiles = g.Smiles.Value; lastgrumps = g.Grumps.Value; Tweens.Bounce(f.transform); } else if (ginfo != null) { ginfo.PoolDestroy(); ginfo_target = null; } }); }
public override void SetParent(UIObj p) { ParentObj = p; transform.SetParent(p.transform); p.AddChild(this); if (!trans) { trans = this.transform as RectTransform; } trans.anchorMax = Vector2.one; //_anchorpoint.anchorMax; trans.anchorMin = Vector2.zero; //_anchorpoint.anchorMin; trans.anchoredPosition = Vector2.zero; //_anchorpoint.anchoredPosition; trans.sizeDelta = Vector2.zero; //_anchorpoint.sizeDelta; if (p is FaceObj) { FaceObj f = p as FaceObj; if (f.FaceParent) { SetFaceParent(f.FaceParent); } } }
public void RemoveChild(UIObj c) { bool remove = false; int index = 0; for (int i = 0; i < Child.Length; i++) { if (Child[i] == c) { remove = true; index = i; break; } } if (!remove) { return; } UIObj [] newchild = new UIObj[Child.Length - 1]; int a = 0; for (int i = 0; i < index; i++) { newchild[a] = Child[i]; a++; } for (int x = index + 1; x < Child.Length; x++) { newchild[a] = Child[x]; a++; } Child = newchild; }
public void BeginTargeting(Spell spell, SpellButton button) { targetSpell = spell; renderTargeting = true; targetPawn = null; originPoint = targetPoint = new Vector2i(button.pos.x - 2, button.pos.y + button.size.height / 2); originButton = button; }
public override void OnRegister() { base.OnRegister(); uiWordDesc = UIObj.GetComponent <UI_Word_Desc>(); uiWordDesc.btnSearch.onClick.AddListener(SearchWord); uiWordDesc.btnAddContext.onClick.AddListener(AddContext); bookMgr = ApplicationFacade.Instance.RetrieveProxy(ProxyEnum.BOOK_MGR) as BookMgr; }
public override void OnRegister() { base.OnRegister(); uiMain = UIObj.GetComponent <UI_Main>(); bookMgr = ApplicationFacade.Instance.RetrieveProxy(ProxyEnum.BOOK_MGR) as BookMgr; listWords = bookMgr.GetWordWithSort("Default"); uiMain.RefreshWordList(listWords, 4); }
public override void OnRegister() { base.OnRegister(); uiTopBar = UIObj.GetComponent <UI_TopBar>(); for (int i = 0; i < topUIName.Count; i++) { uiTopBar.SetCallBack(i, topUIName[i], SelectFunPage); } }
public void RemoveUIObj(UIObj obj) { obj.screen = null; if (objUnderMouse.Contains(obj)) { objUnderMouse.Remove(obj); SetTooltip(""); } uiObjs.Remove(obj); }
public void SetInformation(UIObj hovered) { if (hovered is VendorButton) { Spell viewedSpell = ((VendorButton)hovered).spell; spellName.SetText(viewedSpell.GetName()); description.SetText(viewedSpell.GetLongDescription()); infoPane.OpenTab(1); } }
private void SetFocus(UIObj obj) { if (focusedObj != null) { focusedObj.OnLoseFocus(); } focusedObj = obj; if (focusedObj != null) { focusedObj.OnGainFocus(); } }
public UIObj GrandInfo(GrandData g) { UIObj final = (Prefabs.GetObject("grandinfo") as GameObject).GetComponent <UIObj>(); final.Init(-1, WorldObjects); WorldObjects.AddChild(final); final.ResetRect(); final.transform.localPosition = Vector3.zero; SetGrandInfoObj(final, g); return(final); }
public IEnumerator ResourceAlert(Resource r, int num) { float time_start = 0.2F; float time_adding = 0.8F; float time_end_pause = 0.3F; float time_end = 0.2F; float time_total = time_start + time_adding + time_end; float time_curr = 0.0F; UIObj res = ResUI.Child[(int)r.Index]; UIAlert alert = Instantiate(UIResObj); alert.Init(-1, WorldObjects, time_total); WorldObjects.AddChild(alert); alert.ResetRect(); alert.transform.position = res.Txt[0].transform.position - res.Txt[0].transform.up * 0.5F; Tweens.Bounce(alert.transform); int init = r.Current; alert.Txt[0].text = "+" + num; alert.Svg[0].color = r.Col; yield return(new WaitForSeconds(time_start)); Tweens.Bounce(res.transform); /*float amt_soft = num / (time_adding/Time.deltaTime); * while((time_curr += Time.deltaTime) <= time_adding) * { * init += (int) amt_soft; * * res.Txt[0].text = r.ToString(); * * yield return null; * }*/ r.Add(num); res.Txt[0].text = r.ToString(); yield return(new WaitForSeconds(time_end_pause)); if (alert != null) { alert.PoolDestroy(); } yield return(new WaitForSeconds(time_end)); yield return(null); }
public UIObj Quote(string s, string name) { GameObject o = Prefabs.GetObject("quote") as GameObject; UIObj final = Instantiate(Prefabs.GetObject("quote") as GameObject).GetComponent <UIObj>(); QuoteObjects[0].AddChild(final); final.ResetRect(); final["textbox"].Txt[0].text = s; final.Txt[0].text = name; final.TweenActive(true); return(final); }
public void PlayGame() { // IF WE ARE NOT PLAYING THE GAME if (!playGame) { mainMenuObj.SetActive(false); UIObj.SetActive(true); playGame = true; bestScoreText.text = "Best: " + GameManager.instance.bestScore; totalDiamondScoreText.text = "Total: " + GameManager.instance.diamondScore; } }
public override void Init(int index, UIObj p, params float [] args) { base.Init(index, p, args); Stepper.Setup(this.transform); if (args.Length == 0) { return; } _lifetimeoverride = args[0]; if (_lifetimeoverride < 0.0F) { DestroyOnDeath = false; } played_startaction = false; }
public override void InitUI() { Pathway = MOB["pathway"]; Pathway_init = Pathway.transform.position; EndButton = MUI["reset"]; EndButton.ClearActions(); EndButton.AddAction(UIAction.MouseUp, () => { Clear(); StartCoroutine(Reload()); }); EndInfo = MUI["endcond"]; FitnessObj = MUI["fitobj"]; }
public UIState(UIObj u) { Position = new Vector2(u.transform.localPosition.x, u.transform.localPosition.z); Scale = u.transform.localScale; Color c = Color.white; if (u.Img.Length > 0 && u.Img[0] != null) { c = u.Img[0].color; } else if (u.Svg.Length > 0 && u.Svg[0] != null) { c = u.Svg[0].color; } Col = c; }
public static Sequence SetToState(UIObj u, UIState s, float time = 0.15F) { Sequence seq = DOTween.Sequence(); if (!u.isActive) { return(seq); } //seq.Append(u.transform.DOLocalMove(s.Position, time)) seq.Append(u.transform.DOScale(s.Scale, time)); if (u.Img.Length > 0) { seq.Append(DOTween.To(() => u.Img[0].color, x => u.Img[0].color = x, s.Col, time)); } else if (u.Svg.Length > 0) { seq.Append(DOTween.To(() => u.Svg[0].color, x => u.Img[0].color = x, s.Col, time)); } return(seq); }
public override void InitUI() { MUI["thirdeye"].AddAction(UIAction.MouseDown, () => { if (GameManager.WorldRes.Meds.Charge(ThirdEyeCost)) { Ability_ThirdEye(); } }); MUI["thirdeye"].Txt[0].text = ThirdEyeCost + ""; MUI["kitchen"].AddAction(UIAction.MouseDown, () => { Complete(); }); if (timerobj == null) { timerobj = MUI["kitchen"]; } MUI.SetActive(false); }
//Profile Selection List private void setProfileSelListUI() { uiProfilePtr profileFunc = new uiProfilePtr(uiProfile); gridProfileSel = new UiGrid(assetMngr); gridProfileSel.createGrid(1, profileMngr.getProfileNum()); Console.WriteLine("profile num: "); int profilePos = 0; int position = 50; foreach (KeyValuePair <string, ProfileMngr.Profile> profile in profileMngr.profileLib) { string profileName = profile.Value.profileName; RenderTarget2D renderTargetString = new RenderTarget2D(assetMngr.gDevice, 2500, 200); assetMngr.spriteBatch.Begin(); assetMngr.spriteBatch.DrawString(miramo, profileName, Vector2.Zero, Color.White, 0f, Vector2.Zero, 10f, new SpriteEffects(), 0f); assetMngr.gDevice.SetRenderTarget(renderTargetString); Texture2D profileNameText = (Texture2D)renderTargetString; assetMngr.gDevice.Clear(new Color(0, 0, 0, 0)); assetMngr.spriteBatch.End(); UIObj profileBtn = UiMngr.createUIObj(profileName, profileNameText, profileFunc, new Tuple <int, int>(0, position), (SpaceMngr.scale / 23f)); gridProfileSel.setGrid(profileBtn, 0, profilePos); profilePos = profilePos + 1; position = position - 10; } assetMngr.gDevice.SetRenderTarget(null); firstPass = false; }
public void GetObjInfo(FaceObjInfoContainer f = null, bool side = true) { if (f != null) { if (Element == null || Index != f.Current.Index) { if (Element != null) { DestroyImmediate(Element.gameObject); } Element = Instantiate(f.Current.Prefab).GetComponent <FaceObj>(); Element.transform.SetParent(this.transform); //Element.GetComponent<RectTransform>().anchorMax = Vector3.one; //Element.GetComponent<RectTransform>().sizeDelta = Vector3.zero; Child = new UIObj[1]; Child[0] = Element; Index = f.Current.Index; } //Info = f; //SetInfo(f.Current, null, side); } }
public void AddChild(params UIObj [] c) { UIObj [] newchild = new UIObj[Child.Length + c.Length]; for (int i = 0; i < Child.Length; i++) { newchild[i] = Child[i]; } int x = 0; for (int i = Child.Length; i < Child.Length + c.Length; i++) { newchild[i] = c[x]; newchild[i].Init(i, this); newchild[i].transform.SetParent(this.transform, false); newchild[i].transform.localRotation = Quaternion.identity; newchild[i].transform.localPosition = Vector3.zero; //newchild[i].GetComponent<RectTransform>().anchorMax = Vector2.zero; //newchild[i].GetComponent<RectTransform>().anchorMax = Vector2.one; //newchild[i].GetComponent<RectTransform>().sizeDelta = Vector3.zero; newchild[i].transform.localScale = Vector3.one; x++; } Child = newchild; }
public override void Clear() { _TableManager.Clear(); for (int x = 0; x < Guests.Count; x++) { Guests[x].Destroy(); } Guests.Clear(); for (int i = 0; i < Faces.Length; i++) { Faces[i].PoolDestroy(); } MOB["faceparent"].DestroyChildren(); UIObj end = MUI["endgame"]; for (int i = 0; i < end.Length; i++) { end[i].TweenActive(false); } }
public void SetGrandInfoObj(UIObj final, GrandData g) { final[0].Txt[0].text = g.Info.Name; final[0].Txt[1].text = "Age " + g.Age.Value; final[0].Txt[2].text = g.RoleType + ""; final[1][0].Txt[0].text = "Hungry "; final[1][0].Svg[0].transform.localScale = Vector3.Lerp( final[1][0].Svg[0].transform.localScale, new Vector3(g.Hunger.Ratio, 1, 1), Time.deltaTime * 10); final[1][0].Svg[0].color = Color.Lerp(Color.red, Color.green, g.Hunger.Ratio); final[1][1].Txt[0].text = "Fitness "; final[1][1].Svg[0].transform.localScale = Vector3.Lerp( final[1][1].Svg[0].transform.localScale, new Vector3(g.Fitness.Ratio, 1, 1), Time.deltaTime * 10); final[1][1].Svg[0].color = Color.Lerp(Color.red, Color.green, g.Fitness.Ratio); final[1][2].Txt[0].text = "Social "; final[1][2].Svg[0].transform.localScale = Vector3.Lerp( final[1][2].Svg[0].transform.localScale, new Vector3(g.Social.Ratio, 1, 1), Time.deltaTime * 10); final[1][2].Svg[0].color = Color.Lerp(Color.red, Color.green, g.Social.Ratio); }
public void AddToTab(int index, UIObj obj) { tabs[index].Add(obj); obj.isVisible = index == currentlyOpenTab; }
public override void OnExit() { UIObj.SetActive(false); }