示例#1
0
 protected virtual void InstantiatePrefab(GameObject gopfb)
 {
     if (gopfb != null)
     {
         GameObject go      = PrefabUtility.InstantiatePrefab(gopfb) as GameObject;
         UIGroup    uigroup = null;
         if (serializedObject.targetObject is UIGroup)
         {
             uigroup = serializedObject.targetObject as UIGroup;
         }
         else
         {
             uigroup = Object.FindObjectOfType <UIGroup>();
         }
         if (uigroup != null)
         {
             UIBundleLoadCtrl.SetTranform(go, (ItemInfoBase.Layer)parentLayerProp.intValue, uigroup.transform);
         }
         else
         {
             go.transform.SetParent(null);
         }
         instanceIDProp.intValue = go.GetInstanceID();
     }
 }
示例#2
0
    protected virtual void InformationShow(Rect rect)
    {
        var infoRect = rect;

        infoRect.x     = infoRect.width - 150;
        infoRect.width = 25;
        GUI.color      = new Color(0.3f, 0.5f, 0.8f);
        EditorGUI.SelectableLabel(infoRect, string.Format("[{0}]", ((ItemInfoBase.Type)typeProp.enumValueIndex).ToString().Substring(0, 1)));

        infoRect.x    += infoRect.width * 3;
        infoRect.width = 100;
        GUI.color      = new Color(0.8f, 0.8f, 0.4f);
        string str = UIBundleLoadCtrl.LayerToString((ItemInfoBase.Layer)parentLayerProp.intValue, false);// LayerToString();

        EditorGUI.SelectableLabel(infoRect, str);
        GUI.color = Color.white;
    }