private void ShowInfo(object[] info, int index) { this.isEffect = true; if (info.Length > index) { object[] o = (object[])info [index]; GComponent g = Tools.GetComponent(Config.COM_POPTEXT).asCom; g.touchable = false; g.GetChild("n0").text = Tools.GetMessageById(o [0].ToString()); g.x = Convert.ToInt32(o [1]) + this.GetXX(); g.y = Convert.ToInt32(o [2]) + this.GetYY(); g.GetController("c1").selectedIndex = o [3].ToString() == "0" ? 0 : 1; g.scaleY = 0f; // g.scale = new Vector2 (0f, 0f); // g.TweenScale (new Vector2 (1f, 1f), 1f); g.TweenScaleY(1f, 0.5f); DOTween.To(() => g.scaleY, x => g.scaleY = x, 1, 0.2f).OnComplete(() => { g.InvalidateBatchingState(); DOTween.Kill(g, true); }); add.AddChild(g); TimerManager.inst.Add(1.1f, 1, (float obj) => { ShowInfo(info, ++index); }); } else { isEffect = false; } }
public void ShowViewLeft(GComponent view, Action fun = null) { float xx = view.width; view.x = -xx; view.TweenMoveX(0, 0.3f).SetEase(Ease.OutQuad).OnComplete(() => { if (fun != null) { fun(); } view.InvalidateBatchingState(); // }); }
public void ShowMessage(string name) { if (showMessage == null) { showMessage = Tools.GetComponent(Config.COM_MESSAGE).asCom; } else { messages.Add(name); return; } //showMessage.sortingOrder = 1; showMessage.x = ViewManager.bgOffsetX; showMessage.width = ViewManager.bgOffsetW; showMessage.GetChild("n1").text = name; showMessage.y = -showMessage.height; float c = showMessage.y; f.AddChild(showMessage); showMessage.TweenMove(new Vector2(showMessage.x, 0f), 0.5f).OnComplete(() => { showMessage.InvalidateBatchingState(); showMessage.TweenFade(0f, 1f).SetDelay(3f).OnComplete(() => { f.RemoveChild(showMessage, true); showMessage = null; if (messages.Count != 0) { string msg = messages [0]; messages.RemoveAt(0); this.ShowMessage(msg); } }); }); }