Exemple #1
0
 protected virtual void DisplayDataProperties()
 {
     //skins
     EditorGUILayout.PropertyField(data);
     if (data.objectReferenceValue)
     {
         EditorGUILayout.PropertyField(skinOptions);
         if (skinOptions.enumValueIndex == 1)
         {
             spawnSkinOverride.objectReferenceValue = EditorGUILayout.ObjectField("Prefab Override", spawnSkinOverride.objectReferenceValue, typeof(GameObject), false);
         }
         else if (skinOptions.enumValueIndex == 2)
         {
             EditorGUILayout.PropertyField(childSkinOverride);
             var child = childSkinOverride.GetRootValue <GameObject>();
             if (child)
             {
                 if (!source.transform.FindDeepChild(child.name))
                 {
                     Debug.Log("You must assign a child of " + source + " to " + childSkinOverride.displayName);
                     childSkinOverride.objectReferenceValue = null;
                 }
             }
         }
         var sourceData = data.GetRootValue <UnitData>();
         if (sourceData)
         {
             if ((sourceData.skinPrefab && skinOptions.enumValueIndex != 2) || spawnSkinOverride.objectReferenceValue || childSkinOverride.objectReferenceValue)
             {
                 if (spawnSkinOverride.objectReferenceValue)
                 {
                     itemSpawnLocation.ChildNamePopUpParentOverride(sourceRef, spawnSkinOverride);
                 }
                 else if (childSkinOverride.objectReferenceValue)
                 {
                     itemSpawnLocation.ChildNamePopUpParentOverride(sourceRef, childSkinOverride);
                 }
             }
             else
             {
                 EditorExtensions.LabelFieldCustom("You must assign a skin to equip items!", Color.red, FontStyle.Bold);
             }
         }
     }
     else
     {
         EditorExtensions.LabelFieldCustom("You must assign a unit data file to " + data.displayName, Color.red, FontStyle.Bold);
     }
 }
Exemple #2
0
 protected virtual void DisplaySkinProperties()
 {
     EditorGUILayout.LabelField("Skin Properties", boldStyle);
     EditorGUILayout.PropertyField(setSkin);
     if (setSkin.boolValue)
     {
         EditorGUILayout.PropertyField(skinPrefab);
         itemSpawnLocation.ChildNamePopUpParentOverride(sourceRef, skinPrefab);
         EditorGUILayout.PropertyField(skinSize);
         EditorGUILayout.PropertyField(skinRotation);
     }
 }