Various helper functions. More...

Inheritance diagram for Crosstales.TPB.Util.Helper:
Crosstales.Common.EditorUtil.BaseEditorHelper Crosstales.Common.Util.BaseHelper

Static Public Member Functions

static void SetupVCS ()
 Setup the VCS before building. More...
 
static void DeleteBuilds ()
 Delete the builds for all platforms. More...
 
static void ProcessBuildPipeline (string target, bool batchmode=true)
 Builds the target. More...
 
- Static Public Member Functions inherited from Crosstales.Common.EditorUtil.BaseEditorHelper
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 bool isDeleting
 
static Texture2D Logo_Asset => loadImage(ref logo_asset, "logo_asset.png")
 
static Texture2D Logo_Asset_Small => loadImage(ref logo_asset_small, "logo_asset_small.png")
 
static Texture2D Icon_Play => loadImage(ref icon_play, "icon_play.png")
 
static Texture2D Icon_Show => loadImage(ref icon_show, "icon_show.png")
 
static Texture2D Logo_Windows => loadImage(ref logo_windows, "logo_windows.png")
 
static Texture2D Logo_Mac => loadImage(ref logo_mac, "logo_mac.png")
 
static Texture2D Logo_Linux => loadImage(ref logo_linux, "logo_linux.png")
 
static Texture2D Logo_Ios => loadImage(ref logo_ios, "logo_ios.png")
 
static Texture2D Logo_Android => loadImage(ref logo_android, "logo_android.png")
 
static Texture2D Logo_Wsa => loadImage(ref logo_wsa, "logo_wsa.png")
 
static Texture2D Logo_Webgl => loadImage(ref logo_webgl, "logo_webgl.png")
 
static Texture2D Logo_Tvos => loadImage(ref logo_tvos, "logo_tvos.png")
 
static Texture2D Logo_Ps4 => loadImage(ref logo_ps4, "logo_ps4.png")
 
static Texture2D Logo_Ps5 => loadImage(ref logo_ps5, "logo_ps5.png")
 
static Texture2D Logo_Xboxone => loadImage(ref logo_xboxone, "logo_xboxone.png")
 
static Texture2D Logo_Switch => loadImage(ref logo_switch, "logo_switch.png")
 
static BuildTarget TargetWindows => Config.ARCH_WINDOWS == 0 ? BuildTarget.StandaloneWindows : BuildTarget.StandaloneWindows64
 Returns the active Windows platform. More...
 
static BuildTarget TargetMac => BuildTarget.StandaloneOSX
 Returns the active macOS platform. More...
 
static bool hasActiveArchitecturePlatforms => Config.PLATFORM_WINDOWS
 Checks if the user has selected any architecture platforms. More...
 
static string[] ScenePaths => (from t in EditorBuildSettings.scenes where t.enabled select t.path).ToArray()
 All active scene paths of the project. More...
 
static bool hasActiveScenes => ScenePaths.Length > 0
 Checks if a project has any active scenes. More...
 
static bool hasBuild => Crosstales.Common.Util.FileHelper.ExistsDirectory(Config.PATH_BUILD)
 Checks if a build for the project exists. More...
 
- Static Public Attributes inherited from Crosstales.Common.EditorUtil.BaseEditorHelper
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...
 

Properties

static System.Collections.Generic.List< BuildTarget > Targets [get]
 Returns all active platforms. More...
 
static BuildTarget TargetLinux [get]
 Returns the active Linux platform. More...
 
static string? BuildInfo [get]
 Scans the build usage information. More...
 
- 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...
 

Additional Inherited Members

- Static Protected Attributes inherited from Crosstales.Common.Util.BaseHelper
static readonly System.Random _rnd = new System.Random()
 

Detailed Description

Various helper functions.

Member Function Documentation

◆ DeleteBuilds()

static void Crosstales.TPB.Util.Helper.DeleteBuilds ( )
static

Delete the builds for all platforms.

◆ ProcessBuildPipeline()

static void Crosstales.TPB.Util.Helper.ProcessBuildPipeline ( string  target,
bool  batchmode = true 
)
static

Builds the target.

Parameters
targetTarget platform for the build
batchmodeBuild in batch-mode (default: true, optional)

◆ SetupVCS()

static void Crosstales.TPB.Util.Helper.SetupVCS ( )
static

Setup the VCS before building.

Member Data Documentation

◆ hasActiveArchitecturePlatforms

bool Crosstales.TPB.Util.Helper.hasActiveArchitecturePlatforms => Config.PLATFORM_WINDOWS
static

Checks if the user has selected any architecture platforms.

Returns
True if the user has selected any architecture platforms.

◆ hasActiveScenes

bool Crosstales.TPB.Util.Helper.hasActiveScenes => ScenePaths.Length > 0
static

Checks if a project has any active scenes.

Returns
True if a project has any active scenes.

◆ hasBuild

bool Crosstales.TPB.Util.Helper.hasBuild => Crosstales.Common.Util.FileHelper.ExistsDirectory(Config.PATH_BUILD)
static

Checks if a build for the project exists.

Returns
True if a build for the project exists.

◆ ScenePaths

string [] Crosstales.TPB.Util.Helper.ScenePaths => (from t in EditorBuildSettings.scenes where t.enabled select t.path).ToArray()
static

All active scene paths of the project.

Returns
All active scene paths of the project.

◆ TargetMac

BuildTarget Crosstales.TPB.Util.Helper.TargetMac => BuildTarget.StandaloneOSX
static

Returns the active macOS platform.

Returns
Active macOS platform.

◆ TargetWindows

BuildTarget Crosstales.TPB.Util.Helper.TargetWindows => Config.ARCH_WINDOWS == 0 ? BuildTarget.StandaloneWindows : BuildTarget.StandaloneWindows64
static

Returns the active Windows platform.

Returns
Active Windows platform.

Property Documentation

◆ BuildInfo

string? Crosstales.TPB.Util.Helper.BuildInfo
staticget

Scans the build usage information.

Returns
Build usage information.

◆ TargetLinux

BuildTarget Crosstales.TPB.Util.Helper.TargetLinux
staticget

Returns the active Linux platform.

Returns
Active Linux platform.

◆ Targets

System.Collections.Generic.List<BuildTarget> Crosstales.TPB.Util.Helper.Targets
staticget

Returns all active platforms.

Returns
All active platforms.

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