public static void SetEuler(int id, float x, float y, float z) { var go = LuaReference.Get(id); if (go) { go.transform.rotation = Quaternion.Euler(x, y, z); } }
public static void SetActive(int id, int active) { var go = LuaReference.Get(id); if (go) { go.SetActive(active == 1); } }
public static void SetText(int id, string text) { var go = LuaReference.Get(id); if (go) { SetText(go.transform, text); } }
public static void SetSiblingIndex(int id, int index) { var go = LuaReference.Get(id); if (go) { go.transform.SetSiblingIndex(index); } }
public static void SetLayer(int id, int layer) { var go = LuaReference.Get(id); if (go) { NGUITools.SetLayer(go, layer); } }
public static void SetSprite(int id, string spriteName, bool native) { var go = LuaReference.Get(id); if (go) { SetSprite(go.transform, spriteName, native); } }
public static void LookAt(int id, float x, float y, float z) { var go = LuaReference.Get(id); if (go) { go.transform.LookAt(new Vector3(x, y, z)); } }
public static void Translate(int id, float x, float y, float z) { var go = LuaReference.Get(id); if (go) { go.transform.Translate(x, y, z); } }
public static void DontDestroyOnLoad(int id) { var go = LuaReference.Get(id); if (go) { UnityEngine.Object.DontDestroyOnLoad(go); } }
public static void SetAsLastSibling(int id) { var go = LuaReference.Get(id); if (go) { go.transform.SetAsLastSibling(); } }
public static void DestroyImmediate(int id) { var go = LuaReference.Get(id); if (go) { UnityEngine.Object.DestroyImmediate(go); LuaReference.Remove(id); } }
public static int GetParent(int id) { var go = LuaReference.Get(id); if (go && go.transform.parent) { return(LuaReference.Add(go.transform.parent.gameObject)); } return(LuaReference.INVALID_GAMEOBJECT_ID); }
public static int GetChildCount(int id) { var go = LuaReference.Get(id); if (go) { return(go.transform.childCount); } return(0); }
private static T FindChildWithComponent <T>(int id) where T : Component { var go = LuaReference.Get(id); if (go) { return(go.GetComponentInChildren <T>()); } return(null); }
public static int Instantiate(int id) { var go = LuaReference.Get(id); if (go) { return(LuaReference.Add(UnityEngine.Object.Instantiate(go))); } return(LuaReference.INVALID_GAMEOBJECT_ID); }
public static int IsActive(int id) { var go = LuaReference.Get(id); if (go) { return(go.activeInHierarchy ? 1 : 0); } return(0); }
public static int GetSiblingIndex(int id) { var go = LuaReference.Get(id); if (go) { return(go.transform.GetSiblingIndex()); } return(-1); }
public static int AddComponent(int id, int type) { var go = LuaReference.Get(id); if (go) { go.AddComponent(LuaReference.GetComponentType(type)); return(id); } return(LuaReference.INVALID_GAMEOBJECT_ID); }
public static void SetParent(int id, int parent) { var go = LuaReference.Get(id); if (go) { var p = LuaReference.Get(parent); go.transform.SetParent(p != null?p.transform:null); } }
public static void AddClick(int id, SLua.LuaFunction function) { var go = LuaReference.Get(id); if (go == null) { return; } AddClick(go.transform, function); }
public static void SetRotation(int id, float x, float y, float z, float w) { var go = LuaReference.Get(id); if (go) { Quaternion q = go.transform.rotation; q.Set(x, y, z, w); go.transform.rotation = q; } }
public static void GetEuler(int id, float x, float y, float z) { var go = LuaReference.Get(id); x = y = z = 0; if (go) { x = go.transform.eulerAngles.x; y = go.transform.eulerAngles.y; z = go.transform.eulerAngles.z; } }
public static void GetForward(int id, out float x, out float y, out float z) { var go = LuaReference.Get(id); x = y = z = 0; if (go) { x = go.transform.forward.x; y = go.transform.forward.y; z = go.transform.forward.z; } }
public static void SetWidgetDepth(int id, int depth) { var go = LuaReference.Get(id); if (go) { UIWidget widget = go.GetComponent <UIWidget>(); if (widget) { widget.depth = depth; } } }
public static void ResizeCollider(int id) { var go = LuaReference.Get(id); if (go) { UIWidget widget = go.GetComponent <UIWidget>(); if (widget) { widget.ResizeCollider(); } } }
public static void SetPanelDepth(int id, int depth) { var go = LuaReference.Get(id); if (go) { UIPanel panel = go.GetComponent <UIPanel>(); if (panel) { panel.depth = depth; } } }
public static void SetLocalPosition(int id, float x, float y, float z) { var go = LuaReference.Get(id); if (go) { Vector3 position = go.transform.localPosition; position.x = x; position.y = y; position.z = z; go.transform.localPosition = position; } }
public static void SetPanelAlpha(int id, float alpha) { var go = LuaReference.Get(id); if (go) { UIPanel panel = go.GetComponent <UIPanel>(); if (panel) { panel.alpha = alpha; } } }
public static void SetCameraCullingMask(int id, int mask) { var go = LuaReference.Get(id); if (go) { Camera camera = go.GetComponent <Camera>(); if (camera) { camera.cullingMask = mask; } } }
public static void SetCameraDepth(int id, int depth) { var go = LuaReference.Get(id); if (go) { Camera camera = go.GetComponent <Camera>(); if (camera) { camera.depth = depth; } } }