C# Класс Hugula.Utils.LuaHelper

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddComponent ( GameObject obj, System t ) : Component
AddComponent ( GameObject obj, string className ) : Component
Destroy ( Object original ) : void

Destroy object

Destroy ( Object original, float t ) : void
DestroyImmediate ( Object original ) : void
DestroyImmediate ( Object original, bool allowDestroyingAssets ) : void
Find ( string name ) : GameObject

寻找GAMEOBJECT

FindWithTag ( string tag ) : GameObject

ForeachChild ( GameObject parent, LuaFunction eachFn ) : void

GCCollect ( ) : void

调用GC.Collect

GetAllChild ( GameObject obj ) : UnityEngine.Transform[]

GetAngle ( float p1x, float p1y, float p2x, float p2y ) : float

得到两个点之间的夹角

GetBytes ( string utf8Str ) : byte[]

获取bytes

GetClassType ( string classname ) : System.Type

getType

GetComponent ( GameObject obj, System t ) : Component
GetComponent ( GameObject obj, string classname ) : Component

GetComponentInChildren ( GameObject obj, System t ) : Component
GetComponentInChildren ( GameObject obj, string classname ) : Component

GetComponentInChildren

GetComponents ( GameObject obj, System t ) : UnityEngine.Component[]
GetComponents ( GameObject obj, string classname ) : UnityEngine.Component[]

GetComponentsInChildren ( GameObject obj, System t ) : UnityEngine.Component[]
GetComponentsInChildren ( GameObject obj, string classname ) : UnityEngine.Component[]

GetLayerMask ( string args ) : int

the Layersmask

GetUTF8String ( System bytes ) : string

获取utf8字符串

Instantiate ( Object original ) : Object

Instantiate Object

InstantiateGlobal ( GameObject original, GameObject parent = null ) : GameObject

InstantiateLocal ( GameObject original ) : GameObject
InstantiateLocal ( GameObject original, GameObject parent ) : GameObject

InstantiateLocal ( GameObject original, GameObject parent, Vector3 pos ) : GameObject
InstantiateLocal ( GameObject original, Vector3 pos ) : GameObject
LoadFromMemory ( System bytes ) : AssetBundle

Creates from byte array.

LoadScene ( string sceneName, bool isAdditive ) : void

Loads the scene.

PlayAnimation ( Animation anim, string name, AnimationDirection dir ) : AnimationState

播放动画片段

PlayAnimator ( Animator anim, string name, AnimationDirection dir ) : AnimatorStateInfo

播放动画片段

Raycast ( Ray ray ) : object

Raycast the specified ray.

RefreshShader ( AssetBundle assetBundle ) : void

/// 得到类型 ///

刷新shader

RefreshShader ( GameObject obj ) : void
ReleaseLuaFn ( LuaFunction fn ) : void
RemoveComponent ( Component comp ) : void
RemoveComponent ( GameObject obj, string className ) : void
SetLayer ( Transform transform, int layer ) : void

Sets the layer.

SetParent ( GameObject child, GameObject parent ) : void

设置父对象

StringToHash ( string str ) : int

str 转换为hash code

UnloadScene ( string sceneName ) : void

卸载场景

Описание методов

AddComponent() публичный статический Метод

public static AddComponent ( GameObject obj, System t ) : Component
obj UnityEngine.GameObject
t System
Результат UnityEngine.Component

AddComponent() публичный статический Метод

public static AddComponent ( GameObject obj, string className ) : Component
obj UnityEngine.GameObject
className string
Результат UnityEngine.Component

Destroy() публичный статический Метод

Destroy object
public static Destroy ( Object original ) : void
original Object
Результат void

Destroy() публичный статический Метод

public static Destroy ( Object original, float t ) : void
original Object
t float
Результат void

DestroyImmediate() публичный статический Метод

public static DestroyImmediate ( Object original ) : void
original Object
Результат void

DestroyImmediate() публичный статический Метод

public static DestroyImmediate ( Object original, bool allowDestroyingAssets ) : void
original Object
allowDestroyingAssets bool
Результат void

Find() публичный статический Метод

寻找GAMEOBJECT
public static Find ( string name ) : GameObject
name string
Результат UnityEngine.GameObject

FindWithTag() публичный статический Метод

public static FindWithTag ( string tag ) : GameObject
tag string
Результат UnityEngine.GameObject

ForeachChild() публичный статический Метод

public static ForeachChild ( GameObject parent, LuaFunction eachFn ) : void
parent UnityEngine.GameObject
eachFn SLua.LuaFunction
Результат void

GCCollect() публичный статический Метод

调用GC.Collect
public static GCCollect ( ) : void
Результат void

GetAllChild() публичный статический Метод

public static GetAllChild ( GameObject obj ) : UnityEngine.Transform[]
obj UnityEngine.GameObject
Результат UnityEngine.Transform[]

GetAngle() публичный статический Метод

得到两个点之间的夹角
public static GetAngle ( float p1x, float p1y, float p2x, float p2y ) : float
p1x float
p1y float
p2x float
p2y float
Результат float

GetBytes() публичный статический Метод

获取bytes
public static GetBytes ( string utf8Str ) : byte[]
utf8Str string
Результат byte[]

GetClassType() публичный статический Метод

getType
public static GetClassType ( string classname ) : System.Type
classname string
Результат System.Type

GetComponent() публичный статический Метод

public static GetComponent ( GameObject obj, System t ) : Component
obj UnityEngine.GameObject
t System
Результат UnityEngine.Component

GetComponent() публичный статический Метод

public static GetComponent ( GameObject obj, string classname ) : Component
obj UnityEngine.GameObject
classname string
Результат UnityEngine.Component

GetComponentInChildren() публичный статический Метод

public static GetComponentInChildren ( GameObject obj, System t ) : Component
obj UnityEngine.GameObject
t System
Результат UnityEngine.Component

GetComponentInChildren() публичный статический Метод

GetComponentInChildren
public static GetComponentInChildren ( GameObject obj, string classname ) : Component
obj UnityEngine.GameObject
classname string
Результат UnityEngine.Component

GetComponents() публичный статический Метод

public static GetComponents ( GameObject obj, System t ) : UnityEngine.Component[]
obj UnityEngine.GameObject
t System
Результат UnityEngine.Component[]

GetComponents() публичный статический Метод

public static GetComponents ( GameObject obj, string classname ) : UnityEngine.Component[]
obj UnityEngine.GameObject
classname string
Результат UnityEngine.Component[]

GetComponentsInChildren() публичный статический Метод

public static GetComponentsInChildren ( GameObject obj, System t ) : UnityEngine.Component[]
obj UnityEngine.GameObject
t System
Результат UnityEngine.Component[]

GetComponentsInChildren() публичный статический Метод

public static GetComponentsInChildren ( GameObject obj, string classname ) : UnityEngine.Component[]
obj UnityEngine.GameObject
classname string
Результат UnityEngine.Component[]

GetLayerMask() публичный статический Метод

the Layersmask
public static GetLayerMask ( string args ) : int
args string Arguments.
Результат int

GetUTF8String() публичный статический Метод

获取utf8字符串
public static GetUTF8String ( System bytes ) : string
bytes System
Результат string

Instantiate() публичный статический Метод

Instantiate Object
public static Instantiate ( Object original ) : Object
original Object
Результат Object

InstantiateGlobal() публичный статический Метод

public static InstantiateGlobal ( GameObject original, GameObject parent = null ) : GameObject
original UnityEngine.GameObject
parent UnityEngine.GameObject
Результат UnityEngine.GameObject

InstantiateLocal() публичный статический Метод

public static InstantiateLocal ( GameObject original ) : GameObject
original UnityEngine.GameObject
Результат UnityEngine.GameObject

InstantiateLocal() публичный статический Метод

public static InstantiateLocal ( GameObject original, GameObject parent ) : GameObject
original UnityEngine.GameObject
parent UnityEngine.GameObject
Результат UnityEngine.GameObject

InstantiateLocal() публичный статический Метод

public static InstantiateLocal ( GameObject original, GameObject parent, Vector3 pos ) : GameObject
original UnityEngine.GameObject
parent UnityEngine.GameObject
pos UnityEngine.Vector3
Результат UnityEngine.GameObject

InstantiateLocal() публичный статический Метод

public static InstantiateLocal ( GameObject original, Vector3 pos ) : GameObject
original UnityEngine.GameObject
pos UnityEngine.Vector3
Результат UnityEngine.GameObject

LoadFromMemory() публичный статический Метод

Creates from byte array.
public static LoadFromMemory ( System bytes ) : AssetBundle
bytes System Bytes.
Результат UnityEngine.AssetBundle

LoadScene() публичный статический Метод

Loads the scene.
public static LoadScene ( string sceneName, bool isAdditive ) : void
sceneName string Scene name.
isAdditive bool If set to true is additive.
Результат void

PlayAnimation() публичный статический Метод

播放动画片段
public static PlayAnimation ( Animation anim, string name, AnimationDirection dir ) : AnimationState
anim UnityEngine.Animation
name string
dir AnimationDirection
Результат UnityEngine.AnimationState

PlayAnimator() публичный статический Метод

播放动画片段
public static PlayAnimator ( Animator anim, string name, AnimationDirection dir ) : AnimatorStateInfo
anim UnityEngine.Animator
name string
dir AnimationDirection
Результат UnityEngine.AnimatorStateInfo

Raycast() публичный статический Метод

Raycast the specified ray.
public static Raycast ( Ray ray ) : object
ray UnityEngine.Ray Ray.
Результат object

RefreshShader() публичный статический Метод

/// 得到类型 /// 刷新shader
public static RefreshShader ( AssetBundle assetBundle ) : void
assetBundle UnityEngine.AssetBundle
Результат void

RefreshShader() публичный статический Метод

public static RefreshShader ( GameObject obj ) : void
obj UnityEngine.GameObject
Результат void

ReleaseLuaFn() публичный статический Метод

public static ReleaseLuaFn ( LuaFunction fn ) : void
fn SLua.LuaFunction
Результат void

RemoveComponent() публичный статический Метод

public static RemoveComponent ( Component comp ) : void
comp UnityEngine.Component
Результат void

RemoveComponent() публичный статический Метод

public static RemoveComponent ( GameObject obj, string className ) : void
obj UnityEngine.GameObject
className string
Результат void

SetLayer() публичный статический Метод

Sets the layer.
public static SetLayer ( Transform transform, int layer ) : void
transform UnityEngine.Transform
layer int Layer.
Результат void

SetParent() публичный статический Метод

设置父对象
public static SetParent ( GameObject child, GameObject parent ) : void
child UnityEngine.GameObject
parent UnityEngine.GameObject
Результат void

StringToHash() публичный статический Метод

str 转换为hash code
public static StringToHash ( string str ) : int
str string
Результат int

UnloadScene() публичный статический Метод

卸载场景
public static UnloadScene ( string sceneName ) : void
sceneName string
Результат void