C# Class Hugula.Utils.LuaHelper

Datei anzeigen Open project: tenvick/hugula Class Usage Examples

Public Methods

Method Description
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

卸载场景

Method Details

AddComponent() public static method

public static AddComponent ( GameObject obj, System t ) : Component
obj UnityEngine.GameObject
t System
return UnityEngine.Component

AddComponent() public static method

public static AddComponent ( GameObject obj, string className ) : Component
obj UnityEngine.GameObject
className string
return UnityEngine.Component

Destroy() public static method

Destroy object
public static Destroy ( Object original ) : void
original Object
return void

Destroy() public static method

public static Destroy ( Object original, float t ) : void
original Object
t float
return void

DestroyImmediate() public static method

public static DestroyImmediate ( Object original ) : void
original Object
return void

DestroyImmediate() public static method

public static DestroyImmediate ( Object original, bool allowDestroyingAssets ) : void
original Object
allowDestroyingAssets bool
return void

Find() public static method

寻找GAMEOBJECT
public static Find ( string name ) : GameObject
name string
return UnityEngine.GameObject

FindWithTag() public static method

public static FindWithTag ( string tag ) : GameObject
tag string
return UnityEngine.GameObject

ForeachChild() public static method

public static ForeachChild ( GameObject parent, LuaFunction eachFn ) : void
parent UnityEngine.GameObject
eachFn SLua.LuaFunction
return void

GCCollect() public static method

调用GC.Collect
public static GCCollect ( ) : void
return void

GetAllChild() public static method

public static GetAllChild ( GameObject obj ) : UnityEngine.Transform[]
obj UnityEngine.GameObject
return UnityEngine.Transform[]

GetAngle() public static method

得到两个点之间的夹角
public static GetAngle ( float p1x, float p1y, float p2x, float p2y ) : float
p1x float
p1y float
p2x float
p2y float
return float

GetBytes() public static method

获取bytes
public static GetBytes ( string utf8Str ) : byte[]
utf8Str string
return byte[]

GetClassType() public static method

getType
public static GetClassType ( string classname ) : System.Type
classname string
return System.Type

GetComponent() public static method

public static GetComponent ( GameObject obj, System t ) : Component
obj UnityEngine.GameObject
t System
return UnityEngine.Component

GetComponent() public static method

public static GetComponent ( GameObject obj, string classname ) : Component
obj UnityEngine.GameObject
classname string
return UnityEngine.Component

GetComponentInChildren() public static method

public static GetComponentInChildren ( GameObject obj, System t ) : Component
obj UnityEngine.GameObject
t System
return UnityEngine.Component

GetComponentInChildren() public static method

GetComponentInChildren
public static GetComponentInChildren ( GameObject obj, string classname ) : Component
obj UnityEngine.GameObject
classname string
return UnityEngine.Component

GetComponents() public static method

public static GetComponents ( GameObject obj, System t ) : UnityEngine.Component[]
obj UnityEngine.GameObject
t System
return UnityEngine.Component[]

GetComponents() public static method

public static GetComponents ( GameObject obj, string classname ) : UnityEngine.Component[]
obj UnityEngine.GameObject
classname string
return UnityEngine.Component[]

GetComponentsInChildren() public static method

public static GetComponentsInChildren ( GameObject obj, System t ) : UnityEngine.Component[]
obj UnityEngine.GameObject
t System
return UnityEngine.Component[]

GetComponentsInChildren() public static method

public static GetComponentsInChildren ( GameObject obj, string classname ) : UnityEngine.Component[]
obj UnityEngine.GameObject
classname string
return UnityEngine.Component[]

GetLayerMask() public static method

the Layersmask
public static GetLayerMask ( string args ) : int
args string Arguments.
return int

GetUTF8String() public static method

获取utf8字符串
public static GetUTF8String ( System bytes ) : string
bytes System
return string

Instantiate() public static method

Instantiate Object
public static Instantiate ( Object original ) : Object
original Object
return Object

InstantiateGlobal() public static method

public static InstantiateGlobal ( GameObject original, GameObject parent = null ) : GameObject
original UnityEngine.GameObject
parent UnityEngine.GameObject
return UnityEngine.GameObject

InstantiateLocal() public static method

public static InstantiateLocal ( GameObject original ) : GameObject
original UnityEngine.GameObject
return UnityEngine.GameObject

InstantiateLocal() public static method

public static InstantiateLocal ( GameObject original, GameObject parent ) : GameObject
original UnityEngine.GameObject
parent UnityEngine.GameObject
return UnityEngine.GameObject

InstantiateLocal() public static method

public static InstantiateLocal ( GameObject original, GameObject parent, Vector3 pos ) : GameObject
original UnityEngine.GameObject
parent UnityEngine.GameObject
pos UnityEngine.Vector3
return UnityEngine.GameObject

InstantiateLocal() public static method

public static InstantiateLocal ( GameObject original, Vector3 pos ) : GameObject
original UnityEngine.GameObject
pos UnityEngine.Vector3
return UnityEngine.GameObject

LoadFromMemory() public static method

Creates from byte array.
public static LoadFromMemory ( System bytes ) : AssetBundle
bytes System Bytes.
return UnityEngine.AssetBundle

LoadScene() public static method

Loads the scene.
public static LoadScene ( string sceneName, bool isAdditive ) : void
sceneName string Scene name.
isAdditive bool If set to true is additive.
return void

PlayAnimation() public static method

播放动画片段
public static PlayAnimation ( Animation anim, string name, AnimationDirection dir ) : AnimationState
anim UnityEngine.Animation
name string
dir AnimationDirection
return UnityEngine.AnimationState

PlayAnimator() public static method

播放动画片段
public static PlayAnimator ( Animator anim, string name, AnimationDirection dir ) : AnimatorStateInfo
anim UnityEngine.Animator
name string
dir AnimationDirection
return UnityEngine.AnimatorStateInfo

Raycast() public static method

Raycast the specified ray.
public static Raycast ( Ray ray ) : object
ray UnityEngine.Ray Ray.
return object

RefreshShader() public static method

/// 得到类型 /// 刷新shader
public static RefreshShader ( AssetBundle assetBundle ) : void
assetBundle UnityEngine.AssetBundle
return void

RefreshShader() public static method

public static RefreshShader ( GameObject obj ) : void
obj UnityEngine.GameObject
return void

ReleaseLuaFn() public static method

public static ReleaseLuaFn ( LuaFunction fn ) : void
fn SLua.LuaFunction
return void

RemoveComponent() public static method

public static RemoveComponent ( Component comp ) : void
comp UnityEngine.Component
return void

RemoveComponent() public static method

public static RemoveComponent ( GameObject obj, string className ) : void
obj UnityEngine.GameObject
className string
return void

SetLayer() public static method

Sets the layer.
public static SetLayer ( Transform transform, int layer ) : void
transform UnityEngine.Transform
layer int Layer.
return void

SetParent() public static method

设置父对象
public static SetParent ( GameObject child, GameObject parent ) : void
child UnityEngine.GameObject
parent UnityEngine.GameObject
return void

StringToHash() public static method

str 转换为hash code
public static StringToHash ( string str ) : int
str string
return int

UnloadScene() public static method

卸载场景
public static UnloadScene ( string sceneName ) : void
sceneName string
return void