/// <summary> /// Copies a skin so you can make a new custom skin from an already defined one /// </summary> /// <param name="SkinID">The string ID of the custom skin</param> /// <returns>The new copy of the skin</returns> internal static GUISkin CopySkin(String SkinID) { if (List.ContainsKey(SkinID)) { return((GUISkin)MonoBehaviourExtended.Instantiate(List[SkinID])); } else { MonoBehaviourExtended.LogFormatted("Unable to copy GUISkin to {0}, GUISkin not found", SkinID); throw new SystemException(String.Format("Unable to copy GUISkin to {0}, GUISkin not found", SkinID)); } }
/// <summary> /// Copies a skin so you can make a new custom skin from an already defined one /// </summary> /// <param name="DefaultSkin">Which predefined skin to use</param> /// <returns>The new copy of the skin</returns> internal static GUISkin CopySkin(DefSkinType DefaultSkin) { switch (DefaultSkin) { case DefSkinType.Unity: return((GUISkin)MonoBehaviourExtended.Instantiate(DefUnitySkin)); case DefSkinType.KSP: return((GUISkin)MonoBehaviourExtended.Instantiate(DefKSPSkin)); //case DefSkinType.None: return new GUISkin(); default: return((GUISkin)MonoBehaviourExtended.Instantiate(DefKSPSkin)); } }