void Start() { if (worldPivote) { spacePivot = UnityEngine.Space.World; } }
static int IntToEnum(IntPtr L) { int arg0 = (int)LuaDLL.lua_tointeger(L, 1); UnityEngine.Space o = (UnityEngine.Space)arg0; ToLua.Push(L, o); return(1); }
static int IntToEnum(IntPtr L) { #if UNITY_EDITOR ToluaProfiler.AddCallRecord("UnityEngine.Space.IntToEnum"); #endif int arg0 = (int)LuaDLL.lua_tonumber(L, 1); UnityEngine.Space o = (UnityEngine.Space)arg0; ToLua.Push(L, o); return(1); }
static bool Transform_Translate__Vector3__Space(JSVCall vc, int argc) { int len = argc; if (len == 2) { UnityEngine.Vector3 arg0 = (UnityEngine.Vector3)JSApi.getVector3S((int)JSApi.GetType.Arg); UnityEngine.Space arg1 = (UnityEngine.Space)JSApi.getEnum((int)JSApi.GetType.Arg); ((UnityEngine.Transform)vc.csObj).Translate(arg0, arg1); } return(true); }
static bool Transform_Rotate__Vector3__Single__Space(JSVCall vc, int argc) { int len = argc; if (len == 3) { UnityEngine.Vector3 arg0 = (UnityEngine.Vector3)JSApi.getVector3S((int)JSApi.GetType.Arg); System.Single arg1 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg); UnityEngine.Space arg2 = (UnityEngine.Space)JSApi.getEnum((int)JSApi.GetType.Arg); ((UnityEngine.Transform)vc.csObj).Rotate(arg0, arg1, arg2); } return(true); }
static bool Transform_Translate__Single__Single__Single__Space(JSVCall vc, int argc) { int len = argc; if (len == 4) { System.Single arg0 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg); System.Single arg1 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg); System.Single arg2 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg); UnityEngine.Space arg3 = (UnityEngine.Space)JSApi.getEnum((int)JSApi.GetType.Arg); ((UnityEngine.Transform)vc.csObj).Translate(arg0, arg1, arg2, arg3); } return(true); }
public void In( [FriendlyName("Target", "The GameObject(s) to rotate"), AutoLinkType(typeof(GameObject))] GameObject[] Target, [FriendlyName("Rotation", "Quaternion rotation to set")] Quaternion Rotation, [FriendlyName("Space", "Space to apply rotation")] [SocketState(false, false)] UnityEngine.Space CoordinateSystem, [FriendlyName("As Offset", "Treat this rotation as an offset of the current GameObject's rotation")] [SocketState(false, false)] bool AsOffset ) { foreach (GameObject currentTarget in Target) { Quaternion eq; if (CoordinateSystem == Space.World) { eq = Rotation; } else { eq = currentTarget.transform.rotation * Rotation; } if (true == AsOffset) { //existing rotation followed by new rotation currentTarget.transform.rotation = eq * currentTarget.transform.rotation; } else { currentTarget.transform.rotation = eq; } } }
// Applies a rotation of /zAngle/ degrees around the z axis, /xAngle/ degrees around the x axis, and /yAngle/ degrees around the y axis (in that order). public void Rotate(float xAngle, float yAngle, float zAngle, [UnityEngine.Internal.DefaultValue("Space.Self")] Space relativeTo) { Rotate(new Vector3(xAngle, yAngle, zAngle), relativeTo); }
/// <summary> /// <para>Moves the transform by x along the x axis, y along the y axis, and z along the z axis.</para> /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="z"></param> /// <param name="relativeTo"></param> public void Translate(float x, float y, float z, Space relativeTo) { this.Translate(new Vector3(x, y, z), relativeTo); }
public void Rotate(Vector3 eulerAngles) { Space relativeTo = Space.Self; this.Rotate(eulerAngles, relativeTo); }
/// <summary> /// <para>Moves the transform by x along the x axis, y along the y axis, and z along the z axis.</para> /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="z"></param> /// <param name="relativeTo"></param> public void Translate(float x, float y, float z) { Space relativeTo = Space.Self; this.Translate(x, y, z, relativeTo); }
public void Rotate(float xAngle, float yAngle, float zAngle) { Space relativeTo = Space.Self; this.Rotate(xAngle, yAngle, zAngle, relativeTo); }
static int Translate(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2 && ToLua.CheckTypes(L, 1, typeof(UnityEngine.Transform), typeof(UnityEngine.Vector3))) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.ToObject(L, 1); UnityEngine.Vector3 arg0 = ToLua.ToVector3(L, 2); obj.Translate(arg0); return(0); } else if (count == 3 && ToLua.CheckTypes(L, 1, typeof(UnityEngine.Transform), typeof(UnityEngine.Vector3), typeof(UnityEngine.Transform))) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.ToObject(L, 1); UnityEngine.Vector3 arg0 = ToLua.ToVector3(L, 2); UnityEngine.Transform arg1 = (UnityEngine.Transform)ToLua.ToObject(L, 3); obj.Translate(arg0, arg1); return(0); } else if (count == 3 && ToLua.CheckTypes(L, 1, typeof(UnityEngine.Transform), typeof(UnityEngine.Vector3), typeof(UnityEngine.Space))) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.ToObject(L, 1); UnityEngine.Vector3 arg0 = ToLua.ToVector3(L, 2); UnityEngine.Space arg1 = (UnityEngine.Space)ToLua.ToObject(L, 3); obj.Translate(arg0, arg1); return(0); } else if (count == 4 && ToLua.CheckTypes(L, 1, typeof(UnityEngine.Transform), typeof(float), typeof(float), typeof(float))) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.ToObject(L, 1); float arg0 = (float)LuaDLL.lua_tonumber(L, 2); float arg1 = (float)LuaDLL.lua_tonumber(L, 3); float arg2 = (float)LuaDLL.lua_tonumber(L, 4); obj.Translate(arg0, arg1, arg2); return(0); } else if (count == 5 && ToLua.CheckTypes(L, 1, typeof(UnityEngine.Transform), typeof(float), typeof(float), typeof(float), typeof(UnityEngine.Transform))) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.ToObject(L, 1); float arg0 = (float)LuaDLL.lua_tonumber(L, 2); float arg1 = (float)LuaDLL.lua_tonumber(L, 3); float arg2 = (float)LuaDLL.lua_tonumber(L, 4); UnityEngine.Transform arg3 = (UnityEngine.Transform)ToLua.ToObject(L, 5); obj.Translate(arg0, arg1, arg2, arg3); return(0); } else if (count == 5 && ToLua.CheckTypes(L, 1, typeof(UnityEngine.Transform), typeof(float), typeof(float), typeof(float), typeof(UnityEngine.Space))) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.ToObject(L, 1); float arg0 = (float)LuaDLL.lua_tonumber(L, 2); float arg1 = (float)LuaDLL.lua_tonumber(L, 3); float arg2 = (float)LuaDLL.lua_tonumber(L, 4); UnityEngine.Space arg3 = (UnityEngine.Space)ToLua.ToObject(L, 5); obj.Translate(arg0, arg1, arg2, arg3); return(0); } else { return(LuaDLL.tolua_error(L, "invalid arguments to method: UnityEngine.Transform.Translate")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public void Test(UnityEngine.Space e) { }
// Moves the transform by /x/ along the x axis, /y/ along the y axis, and /z/ along the z axis. public void Translate(float x, float y, float z, [UnityEngine.Internal.DefaultValue("Space.Self")] Space relativeTo) { Translate(new Vector3(x, y, z), relativeTo); }
public void In( [FriendlyName("Target", "The GameObject(s) to rotate")] GameObject[] Target, [FriendlyName("X Degrees", "Rotation amount on the X axis")] float XDegrees, [FriendlyName("Y Degrees", "Rotation amount on the Y axis")] float YDegrees, [FriendlyName("Z Degrees", "Rotation amount on the Z axis")] float ZDegrees, [FriendlyName("Ignore X", "Do not apply this rotation to the X axis")] [SocketState(false, false)] bool IgnoreX, [FriendlyName("Ignore Y", "Do not apply this rotation to the Y axis")] [SocketState(false, false)] bool IgnoreY, [FriendlyName("Ignore Z", "Do not apply this rotation to the Z axis")] [SocketState(false, false)] bool IgnoreZ, [FriendlyName("Space", "Space to apply rotation")] [SocketState(false, false)] UnityEngine.Space CoordinateSystem, [FriendlyName("As Offset", "Treat this rotation as an offset of the current GameObject's rotation")] [SocketState(false, false)] bool AsOffset ) { foreach (GameObject currentTarget in Target) { Vector3 euler = Vector3.zero; if (true == AsOffset) { //if it's an offset we will concatentate our rotation //which means only fill in the axis they want to rotate on if (false == IgnoreX) { euler.x = XDegrees; } if (false == IgnoreY) { euler.y = YDegrees; } if (false == IgnoreZ) { euler.z = ZDegrees; } } else { //if it's not an offset then we want to start with //their current rotation and override only the new //specified parameters euler = currentTarget.transform.rotation.eulerAngles; if (false == IgnoreX) { euler.x = XDegrees; } if (false == IgnoreY) { euler.y = YDegrees; } if (false == IgnoreZ) { euler.z = ZDegrees; } } Quaternion eq; if (CoordinateSystem == Space.World) { eq = Quaternion.Euler(euler); } else { eq = currentTarget.transform.rotation * Quaternion.Euler(euler); } if (true == AsOffset) { //existing rotation followed by new rotation currentTarget.transform.rotation = eq * currentTarget.transform.rotation; } else { currentTarget.transform.rotation = eq; } } }
public void Rotate(Vector3 axis, float angle) { Space relativeTo = Space.Self; this.Rotate(axis, angle, relativeTo); }
/// <summary> /// <para>Applies a rotation of zAngle degrees around the z axis, xAngle degrees around the x axis, and yAngle degrees around the y axis (in that order).</para> /// </summary> /// <param name="xAngle">Degrees to rotate around the X axis.</param> /// <param name="yAngle">Degrees to rotate around the Y axis.</param> /// <param name="zAngle">Degrees to rotate around the Z axis.</param> /// <param name="relativeTo">Rotation is local to object or World.</param> public void Rotate(float xAngle, float yAngle, float zAngle, Space relativeTo) { this.Rotate(new Vector3(xAngle, yAngle, zAngle), relativeTo); }
static void Push(IntPtr L, UnityEngine.Space arg) { ToLua.Push(L, arg); }
public void In( [FriendlyName("Target", "The GameObject(s) to rotate")] GameObject[] Target, [FriendlyName("X Degrees", "Rotation amount on the X axis")] float XDegrees, [FriendlyName("Y Degrees", "Rotation amount on the Y axis")] float YDegrees, [FriendlyName("Z Degrees", "Rotation amount on the Z axis")] float ZDegrees, [FriendlyName("Ignore X", "Do not apply this rotation to the X axis")] [SocketState(false, false)] bool IgnoreX, [FriendlyName("Ignore Y", "Do not apply this rotation to the Y axis")] [SocketState(false, false)] bool IgnoreY, [FriendlyName("Ignore Z", "Do not apply this rotation to the Z axis")] [SocketState(false, false)] bool IgnoreZ, [FriendlyName("Space", "Space to apply rotation")] [SocketState(false, false)] UnityEngine.Space CoordinateSystem, [FriendlyName("As Offset", "Treat this rotation as an offset of the current GameObject's rotation")] [SocketState(false, false)] bool AsOffset ) { foreach (GameObject currentTarget in Target) { Vector3 euler = Vector3.zero; if (true == AsOffset) { //if it's an offset we will concatentate our rotation //which means only fill in the axis they want to rotate on if (false == IgnoreX) { euler.x = XDegrees; } if (false == IgnoreY) { euler.y = YDegrees; } if (false == IgnoreZ) { euler.z = ZDegrees; } } else { //if it's not an offset then we want to start with //their current rotation and override only the new //specified parameters euler = currentTarget.transform.rotation.eulerAngles; if (false == IgnoreX) { euler.x = XDegrees; } if (false == IgnoreY) { euler.y = YDegrees; } if (false == IgnoreZ) { euler.z = ZDegrees; } } Quaternion eq; if (CoordinateSystem == Space.World) { eq = Quaternion.Euler(euler); } else { //unity applies eulers as x then y then z //so i'm attempting to do the same through quaternions based on the object's local angle axis Quaternion qx = Quaternion.AngleAxis(euler.x, currentTarget.transform.right); Quaternion qy = Quaternion.AngleAxis(euler.y, currentTarget.transform.up); Quaternion qz = Quaternion.AngleAxis(euler.z, currentTarget.transform.forward); //quaternion multiplication is reversed A rotation followed by B rotation is B*A //so I was x followed by y followed by z //q = y * x (x followed by y) //q = z * q (xy followed by z) eq = qy * qx; eq = qz * eq; } if (true == AsOffset) { //existing rotation followed by new rotation currentTarget.transform.rotation = eq * currentTarget.transform.rotation; } else { currentTarget.transform.rotation = eq; } } }
//grab and set generic, neccesary iTween arguments: void RetrieveArgs(){ foreach (Hashtable item in tweens) { if((GameObject)item["target"] == gameObject){ tweenArguments=item; break; } } id=(string)tweenArguments["id"]; type=(string)tweenArguments["type"]; /* GFX47 MOD START */ _name=(string)tweenArguments["name"]; /* GFX47 MOD END */ method=(string)tweenArguments["method"]; if(tweenArguments.Contains("time")){ time=(float)tweenArguments["time"]; }else{ time=Defaults.time; } //do we need to use physics, is there a rigidbody? if(GetComponent<Rigidbody>() != null){ physics=true; } if(tweenArguments.Contains("delay")){ delay=(float)tweenArguments["delay"]; }else{ delay=Defaults.delay; } if(tweenArguments.Contains("namedcolorvalue")){ //allows namedcolorvalue to be set as either an enum(C# friendly) or a string(JS friendly), string case usage doesn't matter to further increase usability: if(tweenArguments["namedcolorvalue"].GetType() == typeof(NamedValueColor)){ namedcolorvalue=(NamedValueColor)tweenArguments["namedcolorvalue"]; }else{ try { namedcolorvalue=(NamedValueColor)Enum.Parse(typeof(NamedValueColor),(string)tweenArguments["namedcolorvalue"],true); } catch { Debug.LogWarning("iTween: Unsupported namedcolorvalue supplied! Default will be used."); namedcolorvalue = MadiTween.NamedValueColor._Color; } } }else{ namedcolorvalue=Defaults.namedColorValue; } if(tweenArguments.Contains("looptype")){ //allows loopType to be set as either an enum(C# friendly) or a string(JS friendly), string case usage doesn't matter to further increase usability: if(tweenArguments["looptype"].GetType() == typeof(LoopType)){ loopType=(LoopType)tweenArguments["looptype"]; }else{ try { loopType=(LoopType)Enum.Parse(typeof(LoopType),(string)tweenArguments["looptype"],true); } catch { Debug.LogWarning("iTween: Unsupported loopType supplied! Default will be used."); loopType = MadiTween.LoopType.none; } } }else{ loopType = MadiTween.LoopType.none; } if(tweenArguments.Contains("easetype")){ //allows easeType to be set as either an enum(C# friendly) or a string(JS friendly), string case usage doesn't matter to further increase usability: if(tweenArguments["easetype"].GetType() == typeof(EaseType)){ easeType=(EaseType)tweenArguments["easetype"]; }else{ try { easeType=(EaseType)Enum.Parse(typeof(EaseType),(string)tweenArguments["easetype"],true); } catch { Debug.LogWarning("iTween: Unsupported easeType supplied! Default will be used."); easeType=Defaults.easeType; } } }else{ easeType=Defaults.easeType; } if(tweenArguments.Contains("space")){ //allows space to be set as either an enum(C# friendly) or a string(JS friendly), string case usage doesn't matter to further increase usability: if(tweenArguments["space"].GetType() == typeof(UnityEngine.Space)){ space=(UnityEngine.Space)tweenArguments["space"]; }else{ try { space=(UnityEngine.Space)Enum.Parse(typeof(UnityEngine.Space),(string)tweenArguments["space"],true); } catch { Debug.LogWarning("iTween: Unsupported space supplied! Default will be used."); space = Defaults.space; } } }else{ space = Defaults.space; } if(tweenArguments.Contains("islocal")){ isLocal = (bool)tweenArguments["islocal"]; }else{ isLocal = Defaults.isLocal; } // Added by PressPlay if (tweenArguments.Contains("ignoretimescale")) { useRealTime = (bool)tweenArguments["ignoretimescale"]; } else { useRealTime = Defaults.useRealTime; } //instantiates a cached ease equation reference: ease = GetEasingFunction(easeType); }
static int Translate(IntPtr L) { #if UNITY_EDITOR ToluaProfiler.AddCallRecord("UnityEngine.Transform.Register"); #endif try { int count = LuaDLL.lua_gettop(L); if (count == 2) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 1); UnityEngine.Vector3 arg0 = ToLua.ToVector3(L, 2); obj.Translate(arg0); return(0); } else if (count == 3 && TypeChecker.CheckTypes <UnityEngine.Transform>(L, 3)) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 1); UnityEngine.Vector3 arg0 = ToLua.ToVector3(L, 2); UnityEngine.Transform arg1 = (UnityEngine.Transform)ToLua.ToObject(L, 3); obj.Translate(arg0, arg1); return(0); } else if (count == 3 && TypeChecker.CheckTypes <UnityEngine.Space>(L, 3)) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 1); UnityEngine.Vector3 arg0 = ToLua.ToVector3(L, 2); UnityEngine.Space arg1 = (UnityEngine.Space)ToLua.ToObject(L, 3); obj.Translate(arg0, arg1); return(0); } else if (count == 4) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 1); float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); float arg1 = (float)LuaDLL.luaL_checknumber(L, 3); float arg2 = (float)LuaDLL.luaL_checknumber(L, 4); obj.Translate(arg0, arg1, arg2); return(0); } else if (count == 5 && TypeChecker.CheckTypes <UnityEngine.Transform>(L, 5)) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 1); float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); float arg1 = (float)LuaDLL.luaL_checknumber(L, 3); float arg2 = (float)LuaDLL.luaL_checknumber(L, 4); UnityEngine.Transform arg3 = (UnityEngine.Transform)ToLua.ToObject(L, 5); obj.Translate(arg0, arg1, arg2, arg3); return(0); } else if (count == 5 && TypeChecker.CheckTypes <UnityEngine.Space>(L, 5)) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 1); float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); float arg1 = (float)LuaDLL.luaL_checknumber(L, 3); float arg2 = (float)LuaDLL.luaL_checknumber(L, 4); UnityEngine.Space arg3 = (UnityEngine.Space)ToLua.ToObject(L, 5); obj.Translate(arg0, arg1, arg2, arg3); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.Transform.Translate")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int Rotate(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 1); UnityEngine.Vector3 arg0 = ToLua.ToVector3(L, 2); obj.Rotate(arg0); return(0); } else if (count == 3 && TypeChecker.CheckTypes <float>(L, 3)) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 1); UnityEngine.Vector3 arg0 = ToLua.ToVector3(L, 2); float arg1 = (float)LuaDLL.lua_tonumber(L, 3); obj.Rotate(arg0, arg1); return(0); } else if (count == 3 && TypeChecker.CheckTypes <UnityEngine.Space>(L, 3)) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 1); UnityEngine.Vector3 arg0 = ToLua.ToVector3(L, 2); UnityEngine.Space arg1 = (UnityEngine.Space)ToLua.ToObject(L, 3); obj.Rotate(arg0, arg1); return(0); } else if (count == 4 && TypeChecker.CheckTypes <float, float, float>(L, 2)) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 1); float arg0 = (float)LuaDLL.lua_tonumber(L, 2); float arg1 = (float)LuaDLL.lua_tonumber(L, 3); float arg2 = (float)LuaDLL.lua_tonumber(L, 4); obj.Rotate(arg0, arg1, arg2); return(0); } else if (count == 4 && TypeChecker.CheckTypes <UnityEngine.Vector3, float, UnityEngine.Space>(L, 2)) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 1); UnityEngine.Vector3 arg0 = ToLua.ToVector3(L, 2); float arg1 = (float)LuaDLL.lua_tonumber(L, 3); UnityEngine.Space arg2 = (UnityEngine.Space)ToLua.ToObject(L, 4); obj.Rotate(arg0, arg1, arg2); return(0); } else if (count == 5) { UnityEngine.Transform obj = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 1); float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); float arg1 = (float)LuaDLL.luaL_checknumber(L, 3); float arg2 = (float)LuaDLL.luaL_checknumber(L, 4); UnityEngine.Space arg3 = (UnityEngine.Space)ToLua.CheckObject(L, 5, typeof(UnityEngine.Space)); obj.Rotate(arg0, arg1, arg2, arg3); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.Transform.Rotate")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
/// <summary> /// <para>Moves the transform in the direction and distance of translation.</para> /// </summary> /// <param name="translation"></param> /// <param name="relativeTo"></param> public void Translate(Vector3 translation) { Space relativeTo = Space.Self; this.Translate(translation, relativeTo); }