static int _s_set_onCullStateChanged(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.UI.MaskableGraphic gen_to_be_invoked = (UnityEngine.UI.MaskableGraphic)translator.FastGetCSObj(L, 1); gen_to_be_invoked.onCullStateChanged = (UnityEngine.UI.MaskableGraphic.CullStateChangedEvent)translator.GetObject(L, 2, typeof(UnityEngine.UI.MaskableGraphic.CullStateChangedEvent)); } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(0); }
static int _s_set_maskable(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.UI.MaskableGraphic gen_to_be_invoked = (UnityEngine.UI.MaskableGraphic)translator.FastGetCSObj(L, 1); gen_to_be_invoked.maskable = LuaAPI.lua_toboolean(L, 2); } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(0); }
static int _g_get_isMaskingGraphic(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.UI.MaskableGraphic gen_to_be_invoked = (UnityEngine.UI.MaskableGraphic)translator.FastGetCSObj(L, 1); LuaAPI.lua_pushboolean(L, gen_to_be_invoked.isMaskingGraphic); } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(1); }
static int _g_get_onCullStateChanged(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); try { UnityEngine.UI.MaskableGraphic __cl_gen_to_be_invoked = (UnityEngine.UI.MaskableGraphic)translator.FastGetCSObj(L, 1); translator.Push(L, __cl_gen_to_be_invoked.onCullStateChanged); } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } return(1); }
static StackObject *RecalculateMasking_8(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); UnityEngine.UI.MaskableGraphic instance_of_this_method = (UnityEngine.UI.MaskableGraphic) typeof(UnityEngine.UI.MaskableGraphic).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); instance_of_this_method.RecalculateMasking(); return(__ret); }
static StackObject *get_maskable_2(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); UnityEngine.UI.MaskableGraphic instance_of_this_method = (UnityEngine.UI.MaskableGraphic) typeof(UnityEngine.UI.MaskableGraphic).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.maskable; __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method ? 1 : 0; return(__ret + 1); }
static StackObject *set_maskable_3(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Boolean @value = ptr_of_this_method->Value == 1; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); UnityEngine.UI.MaskableGraphic instance_of_this_method = (UnityEngine.UI.MaskableGraphic) typeof(UnityEngine.UI.MaskableGraphic).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); instance_of_this_method.maskable = value; return(__ret); }
static StackObject *set_onCullStateChanged_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); UnityEngine.UI.MaskableGraphic.CullStateChangedEvent @value = (UnityEngine.UI.MaskableGraphic.CullStateChangedEvent) typeof(UnityEngine.UI.MaskableGraphic.CullStateChangedEvent).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); UnityEngine.UI.MaskableGraphic instance_of_this_method = (UnityEngine.UI.MaskableGraphic) typeof(UnityEngine.UI.MaskableGraphic).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); instance_of_this_method.onCullStateChanged = value; return(__ret); }
static StackObject *get_onCullStateChanged_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); UnityEngine.UI.MaskableGraphic instance_of_this_method = (UnityEngine.UI.MaskableGraphic) typeof(UnityEngine.UI.MaskableGraphic).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.onCullStateChanged; object obj_result_of_this_method = result_of_this_method; if (obj_result_of_this_method is CrossBindingAdaptorType) { return(ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance)); } return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method)); }
static int _m_RecalculateMasking(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.UI.MaskableGraphic __cl_gen_to_be_invoked = (UnityEngine.UI.MaskableGraphic)translator.FastGetCSObj(L, 1); try { { __cl_gen_to_be_invoked.RecalculateMasking( ); return(0); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } }
static int _m_SetClipSoftness(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.UI.MaskableGraphic gen_to_be_invoked = (UnityEngine.UI.MaskableGraphic)translator.FastGetCSObj(L, 1); { UnityEngine.Vector2 _clipSoftness; translator.Get(L, 2, out _clipSoftness); gen_to_be_invoked.SetClipSoftness(_clipSoftness); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
static int _m_Cull(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.UI.MaskableGraphic __cl_gen_to_be_invoked = (UnityEngine.UI.MaskableGraphic)translator.FastGetCSObj(L, 1); try { { UnityEngine.Rect clipRect; translator.Get(L, 2, out clipRect); bool validRect = LuaAPI.lua_toboolean(L, 3); __cl_gen_to_be_invoked.Cull(clipRect, validRect); return(0); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } }
static int _m_GetModifiedMaterial(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.UI.MaskableGraphic __cl_gen_to_be_invoked = (UnityEngine.UI.MaskableGraphic)translator.FastGetCSObj(L, 1); try { { UnityEngine.Material baseMaterial = (UnityEngine.Material)translator.GetObject(L, 2, typeof(UnityEngine.Material)); UnityEngine.Material __cl_gen_ret = __cl_gen_to_be_invoked.GetModifiedMaterial(baseMaterial); translator.Push(L, __cl_gen_ret); return(1); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } }
static int _m_SetClipRect(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.UI.MaskableGraphic gen_to_be_invoked = (UnityEngine.UI.MaskableGraphic)translator.FastGetCSObj(L, 1); { UnityEngine.Rect _clipRect; translator.Get(L, 2, out _clipRect); bool _validRect = LuaAPI.lua_toboolean(L, 3); gen_to_be_invoked.SetClipRect(_clipRect, _validRect); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); if (um.vertControlTrans != null && um.vertControlTrans.Length > 0) { foreach (Transform child in um.vertControlTrans) { if (um.isEdit) { if (child.gameObject.activeSelf) { break; } else { child.gameObject.SetActive(true); } } else { if (!child.gameObject.activeSelf) { break; } else { child.gameObject.SetActive(false); } } } } //Modify bindPose by hand if (um.bindposes != null && um.bindposes.Length > 0) { GUILayout.Space(20f); GUILayout.Label("Press shift to speed up"); GUILayout.BeginHorizontal(); if (GUILayout.Button("BindPose Left Move")) { for (int i = 0; i < um.bindposes.Length; ++i) { Matrix4x4 m = um.bindposes[i]; m.m03 -= Event.current.shift ? 0.1f:0.01f; um.bindposes[i] = m; } um.UpdateSkinnedMesh(); if (!Application.isPlaying) { UnityEditor.EditorUtility.SetDirty(um); } } if (GUILayout.Button("BindPose Right Move")) { for (int i = 0; i < um.bindposes.Length; ++i) { Matrix4x4 m = um.bindposes[i]; m.m03 += Event.current.shift ? 0.1f:0.01f; um.bindposes[i] = m; } um.UpdateSkinnedMesh(); if (!Application.isPlaying) { UnityEditor.EditorUtility.SetDirty(um); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("BindPose Up Move")) { for (int i = 0; i < um.bindposes.Length; ++i) { Matrix4x4 m = um.bindposes[i]; m.m13 += Event.current.shift ? 0.1f:0.01f; um.bindposes[i] = m; } um.UpdateSkinnedMesh(); if (!Application.isPlaying) { UnityEditor.EditorUtility.SetDirty(um); } } if (GUILayout.Button("BindPose Down Move")) { for (int i = 0; i < um.bindposes.Length; ++i) { Matrix4x4 m = um.bindposes[i]; m.m13 -= Event.current.shift ? 0.1f:0.01f; um.bindposes[i] = m; } um.UpdateSkinnedMesh(); if (!Application.isPlaying) { UnityEditor.EditorUtility.SetDirty(um); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("BindPose Rotate +")) { Matrix4x4 rotate = Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(0, 0, Event.current.shift ? 1f:0.1f), Vector3.one); for (int i = 0; i < um.bindposes.Length; ++i) { Matrix4x4 m = um.bindposes[i]; um.bindposes[i] = m * rotate; } um.UpdateSkinnedMesh(); if (!Application.isPlaying) { UnityEditor.EditorUtility.SetDirty(um); } } if (GUILayout.Button("BindPose Rotate -")) { Matrix4x4 rotate = Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(0, 0, -(Event.current.shift ? 1f:0.1f)), Vector3.one); for (int i = 0; i < um.bindposes.Length; ++i) { Matrix4x4 m = um.bindposes[i]; um.bindposes[i] = m * rotate; } um.UpdateSkinnedMesh(); if (!Application.isPlaying) { UnityEditor.EditorUtility.SetDirty(um); } } GUILayout.EndHorizontal(); } if (!Application.isPlaying && um.isEdit) { GUILayout.Space(5); if (GUILayout.Button("Save To Pose")) { Armature armature = um.GetComponentInParent <Armature> (); if (armature && armature.poseData) { for (int i = 0; i < armature.uiAttachments.Length; ++i) { UnityEngine.UI.MaskableGraphic render = armature.uiAttachments [i]; if (um.gameObject == render.gameObject) { PoseData.DisplayData dd = armature.poseData.displayDatas [i]; dd.color = um.color; dd.vertex = (Vector3[])um.vertices.Clone(); armature.poseData.displayDatas [i] = dd; AssetDatabase.Refresh(); EditorUtility.SetDirty(armature.poseData); AssetDatabase.SaveAssets(); break; } } } } } }
//init public void InitShow() { DragonBoneShowArmature.AddBones(this); DragonBoneShowArmature.AddSlot(this); DragonBoneShowArmature.ShowBones(this); DragonBoneShowArmature.ShowSlots(this); DragonBoneShowArmature.ShowSkins(this); DragonBoneShowArmature.SetIKs(this); DragonBoneAnimFile.CreateAnimFile(this); Armature armature = _armature.GetComponent <Armature>(); m_prefabs.Add(_armature.gameObject); armature.textureFrames = m_TextureFrames; //update slot display for (int s = 0; s < m_slots.Count; ++s) { m_slots[s].displayIndex = m_slots[s].displayIndex; } if (armature.isUGUI) { UnityEngine.UI.MaskableGraphic[] renders = _armature.GetComponentsInChildren <UnityEngine.UI.MaskableGraphic>(true); armature.uiAttachments = renders; armature.attachments = new Renderer[0]; } else { Renderer[] renders = _armature.GetComponentsInChildren <Renderer>(true); armature.attachments = renders; armature.uiAttachments = new UnityEngine.UI.MaskableGraphic[0]; } armature.slots = m_slots.ToArray(); armature.bones = m_bones.ToArray(); armature.zSpace = zoffset; armature.sonArmatures = m_sonArmature.ToArray(); if (armatureAnimList.ContainsKey(armature.name)) { armature.anims = armatureAnimList[armature.name].ToArray(); } armature.ResetSlotZOrder(); string path = AssetDatabase.GetAssetPath(animTextAsset); path = path.Substring(0, path.LastIndexOf('/')) + "/" + _armature.name; //create pose data PoseData poseData = AssetDatabase.LoadAssetAtPath <PoseData>(path + "_Pose.asset"); if (poseData == null) { poseData = ScriptableObject.CreateInstance <PoseData>(); AssetDatabase.CreateAsset(poseData, path + "_Pose.asset"); } poseData.slotDatas = new PoseData.SlotData[armature.slots.Length]; for (int i = 0; i < armature.slots.Length; ++i) { poseData.slotDatas[i] = new PoseData.SlotData(); poseData.slotDatas[i].color = armature.slots[i].color; poseData.slotDatas[i].displayIndex = armature.slots[i].displayIndex; poseData.slotDatas[i].zorder = armature.slots[i].z; armature.slots[i].SendMessage("UpdateSlotByInheritSlot", SendMessageOptions.DontRequireReceiver); } poseData.boneDatas = new PoseData.TransformData[armature.bones.Length]; for (int i = 0; i < armature.bones.Length; ++i) { poseData.boneDatas[i] = new PoseData.TransformData(); poseData.boneDatas[i].x = armature.bones[i].localPosition.x; poseData.boneDatas[i].y = armature.bones[i].localPosition.y; poseData.boneDatas[i].sx = armature.bones[i].localScale.x; poseData.boneDatas[i].sy = armature.bones[i].localScale.y; poseData.boneDatas[i].rotation = armature.bones[i].localEulerAngles.z; } if (isUGUI) { poseData.displayDatas = new PoseData.DisplayData[armature.uiAttachments.Length]; for (int i = 0; i < armature.uiAttachments.Length; ++i) { poseData.displayDatas[i] = new PoseData.DisplayData(); UnityEngine.UI.MaskableGraphic render = armature.uiAttachments[i]; UIFrame sf = render.GetComponent <UIFrame>(); if (sf) { poseData.displayDatas[i].type = PoseData.AttachmentType.IMG; poseData.displayDatas[i].color = sf.color; } else { UIMesh sm = render.GetComponent <UIMesh>(); if (sm) { poseData.displayDatas[i].type = PoseData.AttachmentType.MESH; poseData.displayDatas[i].color = sm.color; poseData.displayDatas[i].vertex = (Vector3[])sm.vertices.Clone(); if (sm.weights == null || sm.weights.Length == 0) { for (int k = 0; k < poseData.displayDatas[i].vertex.Length; ++k) { poseData.displayDatas[i].vertex[k] /= 100f; } } } else { UnityEngine.UI.Image sr = render.GetComponent <UnityEngine.UI.Image>(); if (sr) { poseData.displayDatas[i].type = PoseData.AttachmentType.IMG; poseData.displayDatas[i].color = sr.color; } else { poseData.displayDatas[i].type = PoseData.AttachmentType.BOX; } } } poseData.displayDatas[i].transform = new PoseData.TransformData(); poseData.displayDatas[i].transform.x = render.transform.localPosition.x; poseData.displayDatas[i].transform.y = render.transform.localPosition.y; poseData.displayDatas[i].transform.sx = render.transform.localScale.x; poseData.displayDatas[i].transform.sy = render.transform.localScale.y; poseData.displayDatas[i].transform.rotation = render.transform.localEulerAngles.z; render.transform.localScale *= unit; } } else { poseData.displayDatas = new PoseData.DisplayData[armature.attachments.Length]; for (int i = 0; i < armature.attachments.Length; ++i) { poseData.displayDatas[i] = new PoseData.DisplayData(); Renderer render = armature.attachments[i]; SpriteFrame sf = render.GetComponent <SpriteFrame>(); if (sf) { poseData.displayDatas[i].type = PoseData.AttachmentType.IMG; poseData.displayDatas[i].color = sf.color; } else { SpriteMesh sm = render.GetComponent <SpriteMesh>(); if (sm) { poseData.displayDatas[i].type = PoseData.AttachmentType.MESH; poseData.displayDatas[i].color = sm.color; poseData.displayDatas[i].vertex = (Vector3[])sm.vertices.Clone(); } else { SpriteRenderer sr = render.GetComponent <SpriteRenderer>(); if (sr) { poseData.displayDatas[i].type = PoseData.AttachmentType.IMG; poseData.displayDatas[i].color = sr.color; } else { poseData.displayDatas[i].type = PoseData.AttachmentType.BOX; } } } poseData.displayDatas[i].transform = new PoseData.TransformData(); poseData.displayDatas[i].transform.x = render.transform.localPosition.x; poseData.displayDatas[i].transform.y = render.transform.localPosition.y; poseData.displayDatas[i].transform.sx = render.transform.localScale.x; poseData.displayDatas[i].transform.sy = render.transform.localScale.y; poseData.displayDatas[i].transform.rotation = render.transform.localEulerAngles.z; } } armature.poseData = poseData; AssetDatabase.Refresh(); EditorUtility.SetDirty(poseData); AssetDatabase.SaveAssets(); if (armature.textureFrames && armature.textureFrames.materials != null && armature.textureFrames.materials.Length > 0) { armature.preMultiplyAlpha = armature.textureFrames.materials[0].GetFloat("_BlendSrc") == (int)UnityEngine.Rendering.BlendMode.One; } else { armature.preMultiplyAlpha = true; } if (armature.isUGUI) { GameObject canvas = GameObject.Find("/Canvas"); if (canvas) { _armature.SetParent(canvas.transform); _armature.localScale = Vector3.one / unit; _armature.localPosition = Vector3.zero; } } if (genPrefab) { string prefabPath = path + ".prefab"; GameObject prefab = AssetDatabase.LoadAssetAtPath <GameObject>(prefabPath); if (!prefab) { PrefabUtility.CreatePrefab(prefabPath, _armature.gameObject, ReplacePrefabOptions.ConnectToPrefab); } else { PrefabUtility.ReplacePrefab(_armature.gameObject, prefab, ReplacePrefabOptions.ConnectToPrefab); } } }