C# 클래스 JCSUnity.JCS_Util

All the utility function put here.
파일 보기 프로젝트 열기: MapleStoryUnity/MapleStoryUnity 1 사용 예제들

공개 메소드들

메소드 설명
AddEventTriggerEvent ( EventTrigger te, EventTriggerType type, EventTriggerEvent func ) : void

Add Event to Unity's Event Trigger(Script)

AddEventTriggerEvent ( EventTrigger te, EventTriggerType type, EventTriggerEventButtonSelection func, JCSUnity.JCS_ButtonSelection selection ) : void

Add Event to Unity's Event Trigger(Script)

ApplyRandVector3 ( Vector3 trans, Vector3 randVec, JCS_Bool3 checks ) : Vector3

Add random value to Vector3

AttachChildren ( RectTransform trans, List childs ) : void
AttachChildren ( Transform trans, List childs ) : void

Attach all childs to this transform.

BytesToString ( Array data, JCS_CharsetType charset ) : string

Convert byte array to string by charset type.

CopyByteArray ( Array inBuf, int start, int len ) : byte[]

Copy byte array to another byte array memory space.

DeleteAllFilesFromDir ( string dirPath ) : void

Delete all files in directory.

DestroyAllTypeObjectInScene ( ) : void

Destroy all the 'TYPE' object in the scene.

DestroyImmediateAllTypeObjectInScene ( ) : void

Destroy all the 'TYPE' object in the scene.

DetachChildren ( RectTransform trans ) : List
DetachChildren ( Transform trans ) : List

Detttach all the child from one transform.

EnumSize ( ) : int

Return the length of an enumerator.

EscapeURL ( string url ) : string

Simple version of escape url.

FillSlot ( List inList, int len, with ) : List
FillSlot ( Array inArray, int len, with ) : T[]

Fill slots with initialize value type by length.

FindCloneObjectsOfTypeAll ( ) : T[]

Find all the objects that are clone in the scene by type.

FindNotCloneObjectsOfTypeAll ( ) : T[]

Find all the objects that are not clone in the scene by type.

FindObjectsOfTypeAllInHierarchy ( ) : T[]

Find all objects that only ACTIVE in hierarchy.

ForceDetachChildren ( RectTransform trans ) : List
ForceDetachChildren ( Transform trans ) : List

Force to clean all the children, this will make sure the transform have 0 children transform.

ForceGetComponent ( MonoBehaviour mb ) : T

Force to get a component, if not found we will add one then.

GetEasing ( JCS_TweenType type ) : TweenDelegate

Return the easing function pointer base on tweener type.

GetFinalLocalEulerAngles ( Transform trans, Vector3 &inEulerAngles ) : Vector3

Multiply all the parent localEulerAngles to get the correct description of the transform information. ATTENTION(jenchieh): This will cause some performance, use it wisely.

GetImageRect ( Image img ) : Vector2

Returns the size of the image.

GetSpriteRendererRect ( SpriteRenderer sr ) : Vector2

Returns the size of the sprite renderer.

GetSpriteRendererRectWithNoScale ( SpriteRenderer sr ) : Vector2

Returns the size of the sprite renderer without the scale value multiply.

GetValues ( ) : IEnumerable

Enum typed version casting. Source: http://stackoverflow.com/questions/972307/can-you-loop-through-all-enum-values

HasChild ( RectTransform trans ) : bool
HasChild ( Transform trans ) : bool

Return true, if transform has at least one children.

IncVec3 ( Vector3 val, float x, float y, float z ) : Vector3
IncVecX ( Vector3 val, float x ) : Vector3

Add the vector value.

IncVecY ( Vector3 val, float y ) : Vector3
IncVecZ ( Vector3 val, float z ) : Vector3
IsArrayEmpty ( Array list ) : bool

Check if the list empty.

IsNumberString ( string str ) : bool

Is the string the valid number to parse.

IsOverGUI ( ) : bool

Check if mosue is over any UI element.

IsSameTribe ( JCS_2DLiveObject liveObj1, JCS_2DLiveObject liveObj2 ) : bool

Check if the object are the same tribe.

IsScene ( string name ) : bool

Check current scene's with NAME.

LastFileIndex ( string path, string prefixStr, string ext ) : int

Method to do search directory and get the last file index.

ListPopBack ( List list ) : T

Pop the last value from the list.

ListPopFront ( List list ) : T

Pop the last value from the list.

LoopInArray ( int index, Array arr ) : int

Loop in an array. (Array)

LoopInArray ( int index, List arr ) : int

Loop in an array. (List)

MergeArrays ( ) : T[]

Merge multiple arrays into one array.

MergeArrays2 ( Array arr1, Array arr2 ) : T[]

Merging two array and return the new array.

MergeList ( ) : List

Merging two list and return the new list.

MouseOverGUI ( RectTransform imageRect, RectTransform rootPanel = null ) : bool

Solve the flash problem! (JCS_CheckableObject) Check if the mouse still on top of the image! ATTENTIOIN(jenchieh): this will not work on the resizable window.

MoveToTheLastChild ( Transform trans ) : void

Move the object to the last child of the Unty's tree system(Hierarchy) transform.

ReattachSelf ( RectTransform trans, ReattachCallback callback ) : void
ReattachSelf ( Transform trans, ReattachCallback callback ) : void

Execution callback after detach and reattach.

RemoveEmptySlot ( List inList ) : List
RemoveEmptySlot ( Array inArray ) : T[]

Remove the empty slot in the array.

RemoveEmptySlotIncludeMissing ( List inList ) : List
RemoveEmptySlotIncludeMissing ( Array inArray ) : T[]

Remove the empty slot in the list including remove the missing gameobject too. I guess Unity do the CG collection later a while when you call 'Destory()' function. Before scripting layer acknowledge this game object is destory might be too late in some situation. This will avoid this type of issue/circumstance.

SetActiveToAllChildren ( Transform trans, bool act ) : void

Active all the child in a transform.

SetEnableAllComponents ( Transform trans, bool act ) : void

Set eabled/disabled to all component in a transform.

SetParentWithoutLosingInfo ( Transform trans, Transform parent ) : void

Set the transform to onther transform in the hierarchy and without losing the info. Info: position, rotation, scale, etc.

SetVec3 ( Vector3 &val, float x, float y, float z ) : Vector3
SetVecX ( Vector3 &val, float x ) : Vector3

Set the vector value.

SetVecY ( Vector3 &val, float y ) : Vector3
SetVecZ ( Vector3 &val, float z ) : Vector3
SpawnAnimateObject ( RuntimeAnimatorController anim, int orderLayer = 15 ) : GameObject

Spawn an animate object.

SpawnAnimateObjectDeathEvent ( RuntimeAnimatorController anim, int orderLayer = 15, int loopTimes = 1 ) : GameObject

Spawn a animate object with the death event, so after the animate was played serval loop times the object will be destroyed.

SpawnGameObject ( string objectPath, Vector3 position = newVector3(), Quaternion rotation = newQuaternion() ) : GameObject

Spawn a gmae object.

SpawnGameObject ( Object trans, Vector3 position = newVector3(), Quaternion rotation = newQuaternion() ) : Object

Spawn a gmae object.

StringToBytes ( string data, JCS_CharsetType charset ) : byte[]

Convert string to byte array by charset type.

ToJson ( obj ) : string

Return JSON by passing serializable object.

VectorDirection ( JCS_Vector3Direction direction ) : Vector3

Return direction of Unity's Vector system.

WithInAcceptRange ( float range, float acceptRange, float currentVal ) : bool

Check the value within the range plus acceptable range.

WithInArrayRange ( int index, Array arr ) : bool

With in array range. (Array)

WithInArrayRange ( int index, List arr ) : bool

With in array range. (List)

WithInRange ( float minRange, float maxRange, float currentVal ) : bool

Check the value within the range.

메소드 상세

AddEventTriggerEvent() 공개 정적인 메소드

Add Event to Unity's Event Trigger(Script)
public static AddEventTriggerEvent ( EventTrigger te, EventTriggerType type, EventTriggerEvent func ) : void
te EventTrigger
type EventTriggerType
func EventTriggerEvent
리턴 void

AddEventTriggerEvent() 공개 정적인 메소드

Add Event to Unity's Event Trigger(Script)
public static AddEventTriggerEvent ( EventTrigger te, EventTriggerType type, EventTriggerEventButtonSelection func, JCSUnity.JCS_ButtonSelection selection ) : void
te EventTrigger
type EventTriggerType
func EventTriggerEventButtonSelection
selection JCSUnity.JCS_ButtonSelection
리턴 void

ApplyRandVector3() 공개 정적인 메소드

Add random value to Vector3
public static ApplyRandVector3 ( Vector3 trans, Vector3 randVec, JCS_Bool3 checks ) : Vector3
trans Vector3 transfrorm u want to apply.
randVec Vector3 value for each axis.
checks JCS_Bool3 check for eaxh axis.
리턴 Vector3

AttachChildren() 공개 정적인 메소드

public static AttachChildren ( RectTransform trans, List childs ) : void
trans RectTransform
childs List
리턴 void

AttachChildren() 공개 정적인 메소드

Attach all childs to this transform.
public static AttachChildren ( Transform trans, List childs ) : void
trans Transform transform we want to add the childs to.
childs List childs we want to add to transform.
리턴 void

BytesToString() 공개 정적인 메소드

Convert byte array to string by charset type.
public static BytesToString ( Array data, JCS_CharsetType charset ) : string
data Array Byte array data to convert to string data.
charset JCS_CharsetType Target charset type.
리턴 string

CopyByteArray() 공개 정적인 메소드

Copy byte array to another byte array memory space.
public static CopyByteArray ( Array inBuf, int start, int len ) : byte[]
inBuf Array byte array to copy.
start int Starting index to copy.
len int Length to copy.
리턴 byte[]

DeleteAllFilesFromDir() 공개 정적인 메소드

Delete all files in directory.
public static DeleteAllFilesFromDir ( string dirPath ) : void
dirPath string Target delete directory.
리턴 void

DestroyAllTypeObjectInScene() 공개 정적인 메소드

Destroy all the 'TYPE' object in the scene.
public static DestroyAllTypeObjectInScene ( ) : void
리턴 void

DestroyImmediateAllTypeObjectInScene() 공개 정적인 메소드

Destroy all the 'TYPE' object in the scene.
public static DestroyImmediateAllTypeObjectInScene ( ) : void
리턴 void

DetachChildren() 공개 정적인 메소드

public static DetachChildren ( RectTransform trans ) : List
trans RectTransform
리턴 List

DetachChildren() 공개 정적인 메소드

Detttach all the child from one transform.
public static DetachChildren ( Transform trans ) : List
trans Transform transform you want to remove all /// the children under.
리턴 List

EnumSize() 공개 정적인 메소드

Return the length of an enumerator.
public static EnumSize ( ) : int
리턴 int

EscapeURL() 공개 정적인 메소드

Simple version of escape url.
public static EscapeURL ( string url ) : string
url string Url you want to escape.
리턴 string

FillSlot() 공개 정적인 메소드

public static FillSlot ( List inList, int len, with ) : List
inList List
len int
리턴 List

FillSlot() 공개 정적인 메소드

Fill slots with initialize value type by length.
public static FillSlot ( Array inArray, int len, with ) : T[]
inArray Array Array you would like to fill out.
len int Target length to initialize.
with Initialize object type.
리턴 T[]

FindCloneObjectsOfTypeAll() 공개 정적인 메소드

Find all the objects that are clone in the scene by type.
public static FindCloneObjectsOfTypeAll ( ) : T[]
리턴 T[]

FindNotCloneObjectsOfTypeAll() 공개 정적인 메소드

Find all the objects that are not clone in the scene by type.
public static FindNotCloneObjectsOfTypeAll ( ) : T[]
리턴 T[]

FindObjectsOfTypeAllInHierarchy() 공개 정적인 메소드

Find all objects that only ACTIVE in hierarchy.
public static FindObjectsOfTypeAllInHierarchy ( ) : T[]
리턴 T[]

ForceDetachChildren() 공개 정적인 메소드

public static ForceDetachChildren ( RectTransform trans ) : List
trans RectTransform
리턴 List

ForceDetachChildren() 공개 정적인 메소드

Force to clean all the children, this will make sure the transform have 0 children transform.
public static ForceDetachChildren ( Transform trans ) : List
trans Transform transform you want to remove all /// the children under.
리턴 List

ForceGetComponent() 공개 정적인 메소드

Force to get a component, if not found we will add one then.
public static ForceGetComponent ( MonoBehaviour mb ) : T
mb MonoBehaviour Any MonoBehaviour.
리턴 T

GetEasing() 공개 정적인 메소드

Return the easing function pointer base on tweener type.
public static GetEasing ( JCS_TweenType type ) : TweenDelegate
type JCS_TweenType type of the tween formula
리턴 TweenDelegate

GetFinalLocalEulerAngles() 공개 정적인 메소드

Multiply all the parent localEulerAngles to get the correct description of the transform information. ATTENTION(jenchieh): This will cause some performance, use it wisely.
public static GetFinalLocalEulerAngles ( Transform trans, Vector3 &inEulerAngles ) : Vector3
trans Transform transform we want to get from and use /// it for parent.
inEulerAngles Vector3 use to store the result.
리턴 Vector3

GetImageRect() 공개 정적인 메소드

Returns the size of the image.
public static GetImageRect ( Image img ) : Vector2
img Image
리턴 Vector2

GetSpriteRendererRect() 공개 정적인 메소드

Returns the size of the sprite renderer.
public static GetSpriteRendererRect ( SpriteRenderer sr ) : Vector2
sr SpriteRenderer
리턴 Vector2

GetSpriteRendererRectWithNoScale() 공개 정적인 메소드

Returns the size of the sprite renderer without the scale value multiply.
public static GetSpriteRendererRectWithNoScale ( SpriteRenderer sr ) : Vector2
sr SpriteRenderer
리턴 Vector2

GetValues() 공개 정적인 메소드

Enum typed version casting. Source: http://stackoverflow.com/questions/972307/can-you-loop-through-all-enum-values
public static GetValues ( ) : IEnumerable
리턴 IEnumerable

HasChild() 공개 정적인 메소드

public static HasChild ( RectTransform trans ) : bool
trans RectTransform
리턴 bool

HasChild() 공개 정적인 메소드

Return true, if transform has at least one children.
public static HasChild ( Transform trans ) : bool
trans Transform
리턴 bool

IncVec3() 공개 정적인 메소드

public static IncVec3 ( Vector3 val, float x, float y, float z ) : Vector3
val Vector3
x float
y float
z float
리턴 Vector3

IncVecX() 공개 정적인 메소드

Add the vector value.
public static IncVecX ( Vector3 val, float x ) : Vector3
val Vector3
x float
리턴 Vector3

IncVecY() 공개 정적인 메소드

public static IncVecY ( Vector3 val, float y ) : Vector3
val Vector3
y float
리턴 Vector3

IncVecZ() 공개 정적인 메소드

public static IncVecZ ( Vector3 val, float z ) : Vector3
val Vector3
z float
리턴 Vector3

IsArrayEmpty() 공개 정적인 메소드

Check if the list empty.
public static IsArrayEmpty ( Array list ) : bool
list Array
리턴 bool

IsNumberString() 공개 정적인 메소드

Is the string the valid number to parse.
public static IsNumberString ( string str ) : bool
str string
리턴 bool

IsOverGUI() 공개 정적인 메소드

Check if mosue is over any UI element.
public static IsOverGUI ( ) : bool
리턴 bool

IsSameTribe() 공개 정적인 메소드

Check if the object are the same tribe.
public static IsSameTribe ( JCS_2DLiveObject liveObj1, JCS_2DLiveObject liveObj2 ) : bool
liveObj1 JCS_2DLiveObject obj one
liveObj2 JCS_2DLiveObject obj two
리턴 bool

IsScene() 공개 정적인 메소드

Check current scene's with NAME.
public static IsScene ( string name ) : bool
name string Name of the scene.
리턴 bool

LastFileIndex() 공개 정적인 메소드

Method to do search directory and get the last file index.
public static LastFileIndex ( string path, string prefixStr, string ext ) : int
path string path to search index.
prefixStr string Filen name prefix.
ext string Filen name extension.
리턴 int

ListPopBack() 공개 정적인 메소드

Pop the last value from the list.
public static ListPopBack ( List list ) : T
list List
리턴 T

ListPopFront() 공개 정적인 메소드

Pop the last value from the list.
public static ListPopFront ( List list ) : T
list List
리턴 T

LoopInArray() 공개 정적인 메소드

Loop in an array. (Array)
public static LoopInArray ( int index, Array arr ) : int
index int Index
arr Array Array.
리턴 int

LoopInArray() 공개 정적인 메소드

Loop in an array. (List)
public static LoopInArray ( int index, List arr ) : int
index int Index
arr List List.
리턴 int

MergeArrays() 공개 정적인 메소드

Merge multiple arrays into one array.
public static MergeArrays ( ) : T[]
리턴 T[]

MergeArrays2() 공개 정적인 메소드

Merging two array and return the new array.
public static MergeArrays2 ( Array arr1, Array arr2 ) : T[]
arr1 Array First array.
arr2 Array Second array.
리턴 T[]

MergeList() 공개 정적인 메소드

Merging two list and return the new list.
public static MergeList ( ) : List
리턴 List

MouseOverGUI() 공개 정적인 메소드

Solve the flash problem! (JCS_CheckableObject) Check if the mouse still on top of the image! ATTENTIOIN(jenchieh): this will not work on the resizable window.
public static MouseOverGUI ( RectTransform imageRect, RectTransform rootPanel = null ) : bool
imageRect RectTransform
rootPanel RectTransform
리턴 bool

MoveToTheLastChild() 공개 정적인 메소드

Move the object to the last child of the Unty's tree system(Hierarchy) transform.
public static MoveToTheLastChild ( Transform trans ) : void
trans Transform
리턴 void

ReattachSelf() 공개 정적인 메소드

public static ReattachSelf ( RectTransform trans, ReattachCallback callback ) : void
trans RectTransform
callback ReattachCallback
리턴 void

ReattachSelf() 공개 정적인 메소드

Execution callback after detach and reattach.
public static ReattachSelf ( Transform trans, ReattachCallback callback ) : void
trans Transform Transform you want to detach and reattach after callback.
callback ReattachCallback Callback after detach and before reattach.
리턴 void

RemoveEmptySlot() 공개 정적인 메소드

public static RemoveEmptySlot ( List inList ) : List
inList List
리턴 List

RemoveEmptySlot() 공개 정적인 메소드

Remove the empty slot in the array.
public static RemoveEmptySlot ( Array inArray ) : T[]
inArray Array Array list.
리턴 T[]

RemoveEmptySlotIncludeMissing() 공개 정적인 메소드

public static RemoveEmptySlotIncludeMissing ( List inList ) : List
inList List
리턴 List

RemoveEmptySlotIncludeMissing() 공개 정적인 메소드

Remove the empty slot in the list including remove the missing gameobject too. I guess Unity do the CG collection later a while when you call 'Destory()' function. Before scripting layer acknowledge this game object is destory might be too late in some situation. This will avoid this type of issue/circumstance.
public static RemoveEmptySlotIncludeMissing ( Array inArray ) : T[]
inArray Array
리턴 T[]

SetActiveToAllChildren() 공개 정적인 메소드

Active all the child in a transform.
public static SetActiveToAllChildren ( Transform trans, bool act ) : void
trans Transform transform to do the effect.
act bool action to the effect
리턴 void

SetEnableAllComponents() 공개 정적인 메소드

Set eabled/disabled to all component in a transform.
public static SetEnableAllComponents ( Transform trans, bool act ) : void
trans Transform transform to apply the effect.
act bool enable or disable?
리턴 void

SetParentWithoutLosingInfo() 공개 정적인 메소드

Set the transform to onther transform in the hierarchy and without losing the info. Info: position, rotation, scale, etc.
public static SetParentWithoutLosingInfo ( Transform trans, Transform parent ) : void
trans Transform transform to set to parent transform
parent Transform parent transform
리턴 void

SetVec3() 공개 정적인 메소드

public static SetVec3 ( Vector3 &val, float x, float y, float z ) : Vector3
val Vector3
x float
y float
z float
리턴 Vector3

SetVecX() 공개 정적인 메소드

Set the vector value.
public static SetVecX ( Vector3 &val, float x ) : Vector3
val Vector3
x float
리턴 Vector3

SetVecY() 공개 정적인 메소드

public static SetVecY ( Vector3 &val, float y ) : Vector3
val Vector3
y float
리턴 Vector3

SetVecZ() 공개 정적인 메소드

public static SetVecZ ( Vector3 &val, float z ) : Vector3
val Vector3
z float
리턴 Vector3

SpawnAnimateObject() 공개 정적인 메소드

Spawn an animate object.
public static SpawnAnimateObject ( RuntimeAnimatorController anim, int orderLayer = 15 ) : GameObject
anim RuntimeAnimatorController anim assign
orderLayer int sorting order
리턴 GameObject

SpawnAnimateObjectDeathEvent() 공개 정적인 메소드

Spawn a animate object with the death event, so after the animate was played serval loop times the object will be destroyed.
public static SpawnAnimateObjectDeathEvent ( RuntimeAnimatorController anim, int orderLayer = 15, int loopTimes = 1 ) : GameObject
anim RuntimeAnimatorController animation u want to play
orderLayer int sorting order
loopTimes int loop times
리턴 GameObject

SpawnGameObject() 공개 정적인 메소드

Spawn a gmae object.
public static SpawnGameObject ( string objectPath, Vector3 position = newVector3(), Quaternion rotation = newQuaternion() ) : GameObject
objectPath string path of the game object
position Vector3 position of the game object spawn
rotation Quaternion rotation of the game object spawn
리턴 GameObject

SpawnGameObject() 공개 정적인 메소드

Spawn a gmae object.
public static SpawnGameObject ( Object trans, Vector3 position = newVector3(), Quaternion rotation = newQuaternion() ) : Object
trans UnityEngine.Object
position Vector3
rotation Quaternion
리턴 UnityEngine.Object

StringToBytes() 공개 정적인 메소드

Convert string to byte array by charset type.
public static StringToBytes ( string data, JCS_CharsetType charset ) : byte[]
data string String data to convert to byte array.
charset JCS_CharsetType Target charset type.
리턴 byte[]

ToJson() 공개 정적인 메소드

Return JSON by passing serializable object.
public static ToJson ( obj ) : string
obj Object that are serializable.
리턴 string

VectorDirection() 공개 정적인 메소드

Return direction of Unity's Vector system.
public static VectorDirection ( JCS_Vector3Direction direction ) : Vector3
direction JCS_Vector3Direction direction u wants.
리턴 Vector3

WithInAcceptRange() 공개 정적인 메소드

Check the value within the range plus acceptable range.
public static WithInAcceptRange ( float range, float acceptRange, float currentVal ) : bool
range float
acceptRange float
currentVal float
리턴 bool

WithInArrayRange() 공개 정적인 메소드

With in array range. (Array)
public static WithInArrayRange ( int index, Array arr ) : bool
index int
arr Array
리턴 bool

WithInArrayRange() 공개 정적인 메소드

With in array range. (List)
public static WithInArrayRange ( int index, List arr ) : bool
index int
arr List
리턴 bool

WithInRange() 공개 정적인 메소드

Check the value within the range.
public static WithInRange ( float minRange, float maxRange, float currentVal ) : bool
minRange float
maxRange float
currentVal float
리턴 bool