public static void NewInstance() { _countTimesNew += 1; timersInstance = new Timers(); stageInstance = new Stage();//严格顺序必须比GRoot先实例化 grootInstance = new GRoot(); }
/// <summary> /// /// </summary> /// <param name="target"></param> /// <param name="downward"></param> public void ShowPopup(GObject target, object downward) { GRoot r = target != null ? target.root : GRoot.inst; r.ShowPopup(this.contentPane, (target is GRoot) ? null : target, downward); // r.AddChild(this.contentPane); // r.AdjustModalLayer(); }
public void CenterOn(GRoot r, bool restraint) { this.SetXY((int)((r.width - this.width) / 2), (int)((r.height - this.height) / 2)); if (restraint) { this.AddRelation(r, RelationType.Center_Center); this.AddRelation(r, RelationType.Middle_Middle); } }
protected FRoot() { InitWithObj(GRoot.inst); _root = GRoot.inst; }
private void restoreSelfHp(GRoot heroDoc) { HeroData tempHeroData = heroDoc.data as HeroData; Hashtable tempNumber = SkillLib.instance.getSkillDefBySkillID("GROOT1").activeEffectTable; //GROOT1 float tempHp = ((Effect)tempNumber["hp"]).num; int tempSelfHp = (int)(heroDoc.realMaxHp * (tempHp / 100f)); heroDoc.addHp(tempSelfHp); // heroDoc.realHp = (tempSelfHp > heroDoc.realMaxHp) ? heroDoc.realMaxHp : tempSelfHp; }