Crosstales.Common.EditorUtil.BaseEditorHelper Class Reference

Base for various Editor helper functions. More...

Inheritance diagram for Crosstales.Common.EditorUtil.BaseEditorHelper:
Crosstales.Common.Util.BaseHelper Crosstales.OnlineCheck.EditorUtil.EditorHelper

Static Public Member Functions

static void RestartUnity (string executeMethod="")
 Restart Unity. More...
 
static void SeparatorUI (int space=12)
 Shows a separator-UI. More...
 
static void ReadOnlyTextField (string label, string text)
 Generates a read-only text field with a label. More...
 
static void RefreshAssetDatabase (ImportAssetOptions options=ImportAssetOptions.Default)
 Refreshes the asset database. More...
 
static bool isValidBuildTarget (BuildTarget target)
 Returns the true if the BuildTarget is installed in Unity. More...
 
static BuildTarget GetBuildTargetForBuildName (string build)
 Returns the BuildTarget for a build name, like 'win64'. More...
 
static string GetBuildNameFromBuildTarget (BuildTarget build)
 Returns the build name for a BuildTarget. More...
 
static System.Collections.Generic.List< T > FindAssetsByType< T > ()
 Returns assets for a certain type. More...
 
static T CreateAsset< T > (string name, bool showSaveFileBrowser=true)
 Create and return a new asset in a smart location based on the current selection and then select it. More...
 
static void InstantiatePrefab (string prefabName, string path)
 Instantiates a prefab. More...
 
- Static Public Member Functions inherited from Crosstales.Common.Util.BaseHelper
static string CreateString (string generateChars, int stringLength)
 Creates a string of characters with a given length. More...
 
static System.Collections.Generic.List< string > SplitStringToLines (string text, bool ignoreCommentedLines=true, int skipHeaderLines=0, int skipFooterLines=0)
 Split the given text to lines and return it as list. More...
 
static string FormatBytesToHRF (long bytes, bool useSI=false)
 Format byte-value to Human-Readable-Form. More...
 
static string FormatSecondsToHRF (double seconds)
 Format seconds to Human-Readable-Form. More...
 
static Color HSVToRGB (float h, float s, float v, float a=1f)
 Generate nice HSV colors. Based on https://gist.github.com/rje/6206099 More...
 
static string GenerateLoremIpsum (int length, int minSentences=1, int maxSentences=int.MaxValue, int minWords=1, int maxWords=15)
 Generates a "Lorem Ipsum" based on various parameters. More...
 
static string LanguageToISO639 (SystemLanguage language)
 Converts a SystemLanguage to an ISO639-1 code. Returns "en" if the SystemLanguage could not be converted. More...
 
static SystemLanguage ISO639ToLanguage (string isoCode)
 Converts an ISO639-1 code to a SystemLanguage. Returns SystemLanguage.English if the code could not be converted. More...
 
static object InvokeMethod (string className, string methodName, System.Reflection.BindingFlags flags=System.Reflection.BindingFlags.Static|System.Reflection.BindingFlags.Public, params object[] parameters)
 Invokes a method on a full qualified class. More...
 
static string GetArgument (string name)
 Returns an argument for a name from the url or command line. More...
 
static string[] GetArguments ()
 Returns all arguments from the url or command line. More...
 
static System.Collections.Generic.Dictionary< string, System.Collections.Generic.List< string > > ParseJSON (string json)
 Parses a given JSON into a dictionary with key and values Note: this is a very basic implementation for simple JSON-strings - don't expect it to work with complex (e.g. nested) JSONs More...
 

Static Public Attributes

static Texture2D Logo_Asset_BWF => loadImage(ref logo_asset_bwf, "logo_asset_bwf.png")
 
static Texture2D Logo_Asset_DJ => loadImage(ref logo_asset_dj, "logo_asset_dj.png")
 
static Texture2D Logo_Asset_FB => loadImage(ref logo_asset_fb, "logo_asset_fb.png")
 
static Texture2D Logo_Asset_OC => loadImage(ref logo_asset_oc, "logo_asset_oc.png")
 
static Texture2D Logo_Asset_Radio => loadImage(ref logo_asset_radio, "logo_asset_radio.png")
 
static Texture2D Logo_Asset_RTV => loadImage(ref logo_asset_rtv, "logo_asset_rtv.png")
 
static Texture2D Logo_Asset_TB => loadImage(ref logo_asset_tb, "logo_asset_tb.png")
 
static Texture2D Logo_Asset_TPB => loadImage(ref logo_asset_tpb, "logo_asset_tpb.png")
 
static Texture2D Logo_Asset_TPS => loadImage(ref logo_asset_tps, "logo_asset_tps.png")
 
static Texture2D Logo_Asset_TR => loadImage(ref logo_asset_tr, "logo_asset_tr.png")
 
static Texture2D Logo_CT => loadImage(ref logo_ct, "logo_ct.png")
 
static Texture2D Logo_Unity => loadImage(ref logo_unity, "logo_unity.png")
 
static Texture2D Icon_Save => loadImage(ref icon_save, "icon_save.png")
 
static Texture2D Icon_Reset => loadImage(ref icon_reset, "icon_reset.png")
 
static Texture2D Icon_Refresh => loadImage(ref icon_refresh, "icon_refresh.png")
 
static Texture2D Icon_Delete => loadImage(ref icon_delete, "icon_delete.png")
 
static Texture2D Icon_Folder => loadImage(ref icon_folder, "icon_folder.png")
 
static Texture2D Icon_Plus => loadImage(ref icon_plus, "icon_plus.png")
 
static Texture2D Icon_Minus => loadImage(ref icon_minus, "icon_minus.png")
 
static Texture2D Icon_Manual => loadImage(ref icon_manual, "icon_manual.png")
 
static Texture2D Icon_API => loadImage(ref icon_api, "icon_api.png")
 
static Texture2D Icon_Forum => loadImage(ref icon_forum, "icon_forum.png")
 
static Texture2D Icon_Product => loadImage(ref icon_product, "icon_product.png")
 
static Texture2D Icon_Check => loadImage(ref icon_check, "icon_check.png")
 
static Texture2D Social_Discord => loadImage(ref social_Discord, "social_Discord.png")
 
static Texture2D Social_Facebook => loadImage(ref social_Facebook, "social_Facebook.png")
 
static Texture2D Social_Twitter => loadImage(ref social_Twitter, "social_Twitter.png")
 
static Texture2D Social_Youtube => loadImage(ref social_Youtube, "social_Youtube.png")
 
static Texture2D Social_Linkedin => loadImage(ref social_Linkedin, "social_Linkedin.png")
 
static Texture2D Video_Promo => loadImage(ref video_promo, "video_promo.png")
 
static Texture2D Video_Tutorial => loadImage(ref video_tutorial, "video_tutorial.png")
 
static Texture2D Icon_Videos => loadImage(ref icon_videos, "icon_videos.png")
 
static Texture2D Icon_3p_Assets => loadImage(ref icon_3p_assets, "icon_3p_assets.png")
 
static Texture2D Asset_PlayMaker => loadImage(ref asset_PlayMaker, "asset_PlayMaker.png")
 
static Texture2D Asset_VolumetricAudio => loadImage(ref asset_VolumetricAudio, "asset_VolumetricAudio.png")
 
static Texture2D Asset_RockTomate => loadImage(ref asset_rocktomate, "asset_rocktomate.png")
 
static Texture2D Asset_RTFB => loadImage(ref asset_RTFB, "asset_RTFB.png")
 
- Static Public Attributes inherited from Crosstales.Common.Util.BaseHelper
static bool ApplicationIsPlaying = Application.isPlaying
 
static bool isEditorMode => isEditor && !ApplicationIsPlaying
 Checks if we are in Editor mode. More...
 
static bool isStandalonePlatform => isWindowsPlatform || isMacOSPlatform || isLinuxPlatform
 Checks if the current platform is standalone (Windows, macOS or Linux). More...
 
static bool isWebPlatform => isWebGLPlatform
 Checks if the current platform is Web (WebPlayer or WebGL). More...
 
static bool isWindowsBasedPlatform => isWindowsPlatform || isWSAPlatform || isXboxOnePlatform
 Checks if the current platform is Windows-based (Windows standalone, WSA or XboxOne). More...
 
static bool isWSABasedPlatform => isWSAPlatform || isXboxOnePlatform
 Checks if the current platform is WSA-based (WSA or XboxOne). More...
 
static bool isAppleBasedPlatform => isMacOSPlatform || isIOSPlatform || isTvOSPlatform
 Checks if the current platform is Apple-based (macOS standalone, iOS or tvOS). More...
 
static bool isIOSBasedPlatform => isIOSPlatform || isTvOSPlatform
 Checks if the current platform is iOS-based (iOS or tvOS). More...
 
static bool isMobilePlatform => isAndroidPlatform || isIOSBasedPlatform
 Checks if the current platform is mobile (Android and iOS). More...
 
static bool isEditor => isWindowsEditor || isMacOSEditor || isLinuxEditor
 Checks if we are inside the Editor. More...
 

Additional Inherited Members

- Static Protected Attributes inherited from Crosstales.Common.Util.BaseHelper
static readonly System.Random _rnd = new System.Random()
 
- Properties inherited from Crosstales.Common.Util.BaseHelper
static System.Globalization.CultureInfo BaseCulture [get]
 The current culture of the application. More...
 
static bool isIL2CPP [get]
 Checks if the current build target uses IL2CPP. More...
 
static Crosstales.Common.Model.Enum.PlatformCurrentPlatform [get]
 Returns the current platform. More...
 
static int AndroidAPILevel [get]
 Returns the Android API level of the current device (Android only)". More...
 
static bool isWindowsPlatform [get]
 Checks if the current platform is Windows. More...
 
static bool isMacOSPlatform [get]
 Checks if the current platform is OSX. More...
 
static bool isLinuxPlatform [get]
 Checks if the current platform is Linux. More...
 
static bool isAndroidPlatform [get]
 Checks if the current platform is Android. More...
 
static bool isIOSPlatform [get]
 Checks if the current platform is iOS. More...
 
static bool isTvOSPlatform [get]
 Checks if the current platform is tvOS. More...
 
static bool isWSAPlatform [get]
 Checks if the current platform is WSA. More...
 
static bool isXboxOnePlatform [get]
 Checks if the current platform is XboxOne. More...
 
static bool isPS4Platform [get]
 Checks if the current platform is PS4. More...
 
static bool isWebGLPlatform [get]
 Checks if the current platform is WebGL. More...
 
static bool isWindowsEditor [get]
 Checks if we are inside the Windows Editor. More...
 
static bool isMacOSEditor [get]
 Checks if we are inside the macOS Editor. More...
 
static bool isLinuxEditor [get]
 Checks if we are inside the Linux Editor. More...
 

Detailed Description

Base for various Editor helper functions.

Member Function Documentation

◆ CreateAsset< T >()

static T Crosstales.Common.EditorUtil.BaseEditorHelper.CreateAsset< T > ( string  name,
bool  showSaveFileBrowser = true 
)
static

Create and return a new asset in a smart location based on the current selection and then select it.

Parameters
nameName of the new asset. Do not include the .asset extension.
showSaveFileBrowserShows the save file browser to select a destination for the asset (default: true, optional).
Returns
The new asset.
Type Constraints
T :ScriptableObject 

◆ FindAssetsByType< T >()

static System.Collections.Generic.List<T> Crosstales.Common.EditorUtil.BaseEditorHelper.FindAssetsByType< T > ( )
static

Returns assets for a certain type.

Returns
List of assets for a certain type.
Type Constraints
T :Object 

◆ GetBuildNameFromBuildTarget()

static string Crosstales.Common.EditorUtil.BaseEditorHelper.GetBuildNameFromBuildTarget ( BuildTarget  build)
static

Returns the build name for a BuildTarget.

Parameters
buildBuildTarget for a build name
Returns
The build name for a BuildTarget.

◆ GetBuildTargetForBuildName()

static BuildTarget Crosstales.Common.EditorUtil.BaseEditorHelper.GetBuildTargetForBuildName ( string  build)
static

Returns the BuildTarget for a build name, like 'win64'.

Parameters
buildBuild name, like 'win64'
Returns
The BuildTarget for a build name.

◆ InstantiatePrefab()

static void Crosstales.Common.EditorUtil.BaseEditorHelper.InstantiatePrefab ( string  prefabName,
string  path 
)
static

Instantiates a prefab.

Parameters
prefabNameName of the prefab.
pathPath to the prefab.

◆ isValidBuildTarget()

static bool Crosstales.Common.EditorUtil.BaseEditorHelper.isValidBuildTarget ( BuildTarget  target)
static

Returns the true if the BuildTarget is installed in Unity.

Parameters
targetBuildTarget to test
Returns
True if the BuildTarget is installed in Unity.

◆ ReadOnlyTextField()

static void Crosstales.Common.EditorUtil.BaseEditorHelper.ReadOnlyTextField ( string  label,
string  text 
)
static

Generates a read-only text field with a label.

◆ RefreshAssetDatabase()

static void Crosstales.Common.EditorUtil.BaseEditorHelper.RefreshAssetDatabase ( ImportAssetOptions  options = ImportAssetOptions.Default)
static

Refreshes the asset database.

Parameters
optionsAsset import options (default: ImportAssetOptions.Default, optional).

◆ RestartUnity()

static void Crosstales.Common.EditorUtil.BaseEditorHelper.RestartUnity ( string  executeMethod = "")
static

Restart Unity.

Parameters
executeMethodExecuted method after the restart (optional)

◆ SeparatorUI()

static void Crosstales.Common.EditorUtil.BaseEditorHelper.SeparatorUI ( int  space = 12)
static

Shows a separator-UI.

Parameters
spaceSpace in pixels between the component and the separator line (default: 12, optional).

The documentation for this class was generated from the following file:
  • C:/Users/slaub/Unity/assets/OnlineCheck/OnlineCheckPro/Assets/Plugins/crosstales/Common/Scripts/Editor/Util/BaseEditorHelper.cs