static int set_OnPostProcessVertices(IntPtr L) { try { Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)ToLua.CheckObject(L, 1, typeof(Spine.Unity.SkeletonGraphic)); EventObject arg0 = null; if (LuaDLL.lua_isuserdata(L, 2) != 0) { arg0 = (EventObject)ToLua.ToObject(L, 2); } else { return(LuaDLL.luaL_throw(L, "The event 'Spine.Unity.SkeletonGraphic.OnPostProcessVertices' can only appear on the left hand side of += or -= when used outside of the type 'Spine.Unity.SkeletonGraphic'")); } if (arg0.op == EventOp.Add) { Spine.Unity.MeshGeneratorDelegate ev = (Spine.Unity.MeshGeneratorDelegate)arg0.func; obj.OnPostProcessVertices += ev; } else if (arg0.op == EventOp.Sub) { Spine.Unity.MeshGeneratorDelegate ev = (Spine.Unity.MeshGeneratorDelegate)arg0.func; obj.OnPostProcessVertices -= ev; } return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int Update(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 1) { Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)ToLua.CheckObject <Spine.Unity.SkeletonGraphic>(L, 1); obj.Update(); return(0); } else if (count == 2) { Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)ToLua.CheckObject <Spine.Unity.SkeletonGraphic>(L, 1); float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); obj.Update(arg0); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: Spine.Unity.SkeletonGraphic.Update")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void HandleRendererReset(SkeletonGraphic g) { if (OnReset != null) { OnReset(); } CollectBones(); }
public static SkeletonGraphic NewSkeletonGraphicGameObject(Spine.Unity.SkeletonDataAsset skeletonDataAsset, Transform parent) { SkeletonGraphic graphic = AddSkeletonGraphicComponent(new GameObject("New Spine GameObject"), skeletonDataAsset); if (parent != null) { graphic.transform.SetParent(parent, false); } return(graphic); }
public static SkeletonGraphic NewSkeletonGraphicGameObject(SkeletonDataAsset skeletonDataAsset, Transform parent) { SkeletonGraphic skeletonGraphic = AddSkeletonGraphicComponent(new GameObject("New Spine GameObject"), skeletonDataAsset); if (parent != null) { skeletonGraphic.transform.SetParent(parent, worldPositionStays: false); } return(skeletonGraphic); }
/// <summary>Create a new GameObject with a SkeletonGraphic component.</summary> /// <param name="material">Material for the canvas renderer to use. Usually, the default SkeletonGraphic material will work.</param> public static SkeletonGraphic NewSkeletonGraphicGameObject(SkeletonDataAsset skeletonDataAsset, Transform parent, Material material) { var sg = SkeletonGraphic.AddSkeletonGraphicComponent(new GameObject("New Spine GameObject"), skeletonDataAsset, material); if (parent != null) { sg.transform.SetParent(parent, false); } return(sg); }
public static SkeletonGraphic AddSkeletonGraphicComponent(GameObject gameObject, Spine.Unity.SkeletonDataAsset skeletonDataAsset) { SkeletonGraphic graphic = gameObject.AddComponent <SkeletonGraphic>(); if (skeletonDataAsset != null) { graphic.skeletonDataAsset = skeletonDataAsset; graphic.Initialize(false); } return(graphic); }
public static SkeletonGraphic AddSkeletonGraphicComponent(GameObject gameObject, SkeletonDataAsset skeletonDataAsset) { SkeletonGraphic skeletonGraphic = gameObject.AddComponent <SkeletonGraphic>(); if (skeletonDataAsset != null) { skeletonGraphic.skeletonDataAsset = skeletonDataAsset; skeletonGraphic.Initialize(overwrite: false); } return(skeletonGraphic); }
void OnEnable() { if (skeletonRenderer == null) { skeletonRenderer = GetComponent <SkeletonRenderer>(); } if (skeletonGraphic == null) { skeletonGraphic = GetComponent <SkeletonGraphic>(); } if (skeletonAnimation == null) { skeletonAnimation = skeletonRenderer != null?skeletonRenderer.GetComponent <ISkeletonAnimation>() : skeletonGraphic != null?skeletonGraphic.GetComponent <ISkeletonAnimation>() : GetComponent <ISkeletonAnimation>(); } if (skeletonComponent == null) { skeletonComponent = skeletonRenderer != null?skeletonRenderer.GetComponent <ISkeletonComponent>() : skeletonGraphic != null?skeletonGraphic.GetComponent <ISkeletonComponent>() : GetComponent <ISkeletonComponent>(); } if (skeletonRenderer != null) { skeletonRenderer.OnRebuild -= HandleRendererReset; skeletonRenderer.OnRebuild += HandleRendererReset; } else if (skeletonGraphic != null) { skeletonGraphic.OnRebuild -= HandleRendererReset; skeletonGraphic.OnRebuild += HandleRendererReset; canvas = skeletonGraphic.canvas; if (canvas == null) { canvas = skeletonGraphic.GetComponentInParent <Canvas>(); } if (canvas == null) { positionScale = 100.0f; } } if (skeletonAnimation != null) { skeletonAnimation.UpdateLocal -= UpdateLocal; skeletonAnimation.UpdateLocal += UpdateLocal; } CollectBones(); }
static bool CanvasNotSetupForTintBlack(SkeletonGraphic skeletonGraphic) { Canvas canvas = skeletonGraphic.canvas; if (!canvas) { return(false); } var requiredChannels = AdditionalCanvasShaderChannels.TexCoord1 | AdditionalCanvasShaderChannels.TexCoord2; return((canvas.additionalShaderChannels & requiredChannels) != requiredChannels); }
static int UpdateMesh(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)ToLua.CheckObject <Spine.Unity.SkeletonGraphic>(L, 1); obj.UpdateMesh(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int Rebuild(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)ToLua.CheckObject <Spine.Unity.SkeletonGraphic>(L, 1); UnityEngine.UI.CanvasUpdate arg0 = (UnityEngine.UI.CanvasUpdate)ToLua.CheckObject(L, 2, typeof(UnityEngine.UI.CanvasUpdate)); obj.Rebuild(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int Initialize(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)ToLua.CheckObject <Spine.Unity.SkeletonGraphic>(L, 1); bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.Initialize(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetLastMesh(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)ToLua.CheckObject <Spine.Unity.SkeletonGraphic>(L, 1); UnityEngine.Mesh o = obj.GetLastMesh(); ToLua.PushSealed(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int AddSkeletonGraphicComponent(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject)); Spine.Unity.SkeletonDataAsset arg1 = (Spine.Unity.SkeletonDataAsset)ToLua.CheckObject <Spine.Unity.SkeletonDataAsset>(L, 2); Spine.Unity.SkeletonGraphic o = Spine.Unity.SkeletonGraphic.AddSkeletonGraphicComponent(arg0, arg1); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int NewSkeletonGraphicGameObject(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); Spine.Unity.SkeletonDataAsset arg0 = (Spine.Unity.SkeletonDataAsset)ToLua.CheckObject <Spine.Unity.SkeletonDataAsset>(L, 1); UnityEngine.Transform arg1 = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 2); Spine.Unity.SkeletonGraphic o = Spine.Unity.SkeletonGraphic.NewSkeletonGraphicGameObject(arg0, arg1); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_startingAnimation(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)o; string ret = obj.startingAnimation; LuaDLL.lua_pushstring(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index startingAnimation on a nil value")); } }
static int set_OverrideTexture(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)o; UnityEngine.Texture arg0 = (UnityEngine.Texture)ToLua.CheckObject <UnityEngine.Texture>(L, 2); obj.OverrideTexture = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index OverrideTexture on a nil value")); } }
static int set_unscaledTime(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)o; bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.unscaledTime = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index unscaledTime on a nil value")); } }
static int get_mainTexture(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)o; UnityEngine.Texture ret = obj.mainTexture; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index mainTexture on a nil value")); } }
static int get_timeScale(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)o; float ret = obj.timeScale; LuaDLL.lua_pushnumber(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index timeScale on a nil value")); } }
// OnEnable applies the overrides at runtime, and when the editor loads. void OnEnable() { if (skeletonGraphic == null) { skeletonGraphic = GetComponent <SkeletonGraphic>(); } if (skeletonGraphic == null) { Debug.LogError("skeletonGraphic == null"); return; } skeletonGraphic.Initialize(false); SetCustomMaterialOverrides(); SetCustomTextureOverrides(); }
static int get_AnimationState(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)o; Spine.AnimationState ret = obj.AnimationState; ToLua.PushObject(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index AnimationState on a nil value")); } }
static int get_IsValid(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)o; bool ret = obj.IsValid; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index IsValid on a nil value")); } }
static int set_startingAnimation(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)o; string arg0 = ToLua.CheckString(L, 2); obj.startingAnimation = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index startingAnimation on a nil value")); } }
static int set_timeScale(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)o; float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); obj.timeScale = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index timeScale on a nil value")); } }
static int get_MeshGenerator(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)o; Spine.Unity.MeshGenerator ret = obj.MeshGenerator; ToLua.PushObject(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index MeshGenerator on a nil value")); } }
static int get_SkeletonDataAsset(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)o; Spine.Unity.SkeletonDataAsset ret = obj.SkeletonDataAsset; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index SkeletonDataAsset on a nil value")); } }
void Reset() { skeletonGraphic = GetComponent <SkeletonGraphic>(); // Populate material list if (skeletonGraphic != null && skeletonGraphic.skeletonDataAsset != null) { var atlasAssets = skeletonGraphic.skeletonDataAsset.atlasAssets; var initialAtlasMaterialOverrides = new List <AtlasMaterialOverride>(); foreach (AtlasAssetBase atlasAsset in atlasAssets) { foreach (Material atlasMaterial in atlasAsset.Materials) { var atlasMaterialOverride = new AtlasMaterialOverride { overrideEnabled = false, originalTexture = atlasMaterial.mainTexture }; initialAtlasMaterialOverrides.Add(atlasMaterialOverride); } } customMaterialOverrides = initialAtlasMaterialOverrides; } // Populate texture list if (skeletonGraphic != null && skeletonGraphic.skeletonDataAsset != null) { var atlasAssets = skeletonGraphic.skeletonDataAsset.atlasAssets; var initialAtlasTextureOverrides = new List <AtlasTextureOverride>(); foreach (AtlasAssetBase atlasAsset in atlasAssets) { foreach (Material atlasMaterial in atlasAsset.Materials) { var atlasTextureOverride = new AtlasTextureOverride { overrideEnabled = false, originalTexture = atlasMaterial.mainTexture }; initialAtlasTextureOverrides.Add(atlasTextureOverride); } } customTextureOverrides = initialAtlasTextureOverrides; } }
static int set_skeletonDataAsset(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Spine.Unity.SkeletonGraphic obj = (Spine.Unity.SkeletonGraphic)o; Spine.Unity.SkeletonDataAsset arg0 = (Spine.Unity.SkeletonDataAsset)ToLua.CheckObject <Spine.Unity.SkeletonDataAsset>(L, 2); obj.skeletonDataAsset = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index skeletonDataAsset on a nil value")); } }