public static SQYBISoul CreateBISoul() { UnityEngine.Object obj = PrefabLoader.loadFromPack("SQY/pbSQYBISoul", true, true); if (obj != null) { GameObject go = Instantiate(obj) as GameObject; SQYBISoul cv = go.GetComponent <SQYBISoul>(); cv.initBoxItem(); return(cv); } return(null); }
/// <summary> /// 根据背包元素类型 来确定当前星级的元素是什么(人物,道具,装备等) /// </summary> /// <param name="node">Node.</param> /// <param name="iType">I type.</param> /// <param name="parent">Parent.</param> void checkNodeBoxItem(SQYNodeForBI node, EMItemType iType, GameObject parent) { switch (iType) { case EMItemType.Charator: if (node._charator == null) { node._charator = SQYBICharator.CreateBICharator(); node._charator.OnClick += this.On_Click; } break; case EMItemType.Equipment: if (node._equipment == null) { node._equipment = SQYBIEquipment.CreateBIEquipment(); node._equipment.OnClick += this.On_Click; } break; case EMItemType.Gem: if (node._gem == null) { node._gem = SQYBIGem.CreateBIGem(); node._gem.OnClick += this.On_Click; } break; case EMItemType.Props: if (node._props == null) { node._props = SQYBIProps.CreateBIProps(); node._props.OnClick += this.On_Click; } break; case EMItemType.AtkFrag: case EMItemType.DefFrag: case EMItemType.MonFrag: if (node._soul == null) { node._soul = SQYBISoul.CreateBISoul(); node._soul.OnClick += this.On_Click; } break; } node.resetItemType(iType); //根据类型 把当前的元素重设. RED.AddChild(node._boxItem.gameObject, parent); node._boxItem.myParent = this; node._boxItem.myNode = node; }