static int PlayActionLoop(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 4)
            {
                WCG.RenderObj obj  = (WCG.RenderObj)ToLua.CheckObject <WCG.RenderObj>(L, 1);
                string        arg0 = ToLua.CheckString(L, 2);
                float         arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
                float         arg2 = (float)LuaDLL.luaL_checknumber(L, 4);
                obj.PlayActionLoop(arg0, arg1, arg2);
                return(0);
            }
            else if (count == 5)
            {
                WCG.RenderObj obj  = (WCG.RenderObj)ToLua.CheckObject <WCG.RenderObj>(L, 1);
                string        arg0 = ToLua.CheckString(L, 2);
                float         arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
                float         arg2 = (float)LuaDLL.luaL_checknumber(L, 4);
                string        arg3 = ToLua.CheckString(L, 5);
                obj.PlayActionLoop(arg0, arg1, arg2, arg3);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: WCG.RenderObj.PlayActionLoop"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Beispiel #2
0
        public void OnAniEvent(int para)
        {
            if (null == m_renderObj)
            {
                m_renderObj = gameObject.GetComponent <RenderObj>();
            }

            if (null != m_renderObj)
            {
                m_renderObj.OnAniEvent();
            }
        }
 static int OnAniEvent(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         WCG.RenderObj obj = (WCG.RenderObj)ToLua.CheckObject <WCG.RenderObj>(L, 1);
         obj.OnAniEvent();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int UnBindEquip(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         WCG.RenderObj          obj  = (WCG.RenderObj)ToLua.CheckObject <WCG.RenderObj>(L, 1);
         UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 2, typeof(UnityEngine.GameObject));
         obj.UnBindEquip(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int RemoveEffect(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         WCG.RenderObj obj  = (WCG.RenderObj)ToLua.CheckObject <WCG.RenderObj>(L, 1);
         int           arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         obj.RemoveEffect(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #6
0
 static int SetGraphicChar(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         WCG.OnHead    obj  = (WCG.OnHead)ToLua.CheckObject <WCG.OnHead>(L, 1);
         WCG.RenderObj arg0 = (WCG.RenderObj)ToLua.CheckObject <WCG.RenderObj>(L, 2);
         obj.SetGraphicChar(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int SetEquipFrozen(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         WCG.RenderObj obj  = (WCG.RenderObj)ToLua.CheckObject <WCG.RenderObj>(L, 1);
         bool          arg0 = LuaDLL.luaL_checkboolean(L, 2);
         obj.SetEquipFrozen(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int SetAniEvent(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         WCG.RenderObj obj  = (WCG.RenderObj)ToLua.CheckObject <WCG.RenderObj>(L, 1);
         LuaFunction   arg0 = ToLua.CheckLuaFunction(L, 2);
         obj.SetAniEvent(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int SetModelZoomRate(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         WCG.RenderObj obj  = (WCG.RenderObj)ToLua.CheckObject <WCG.RenderObj>(L, 1);
         float         arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         obj.SetModelZoomRate(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int GetDummyFromCache(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         WCG.RenderObj         obj  = (WCG.RenderObj)ToLua.CheckObject <WCG.RenderObj>(L, 1);
         string                arg0 = ToLua.CheckString(L, 2);
         UnityEngine.Transform o    = obj.GetDummyFromCache(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int HasAniAciton(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         WCG.RenderObj obj  = (WCG.RenderObj)ToLua.CheckObject <WCG.RenderObj>(L, 1);
         string        arg0 = ToLua.CheckString(L, 2);
         bool          o    = obj.HasAniAciton(arg0);
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int get_m_FrozenTexture(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            WCG.RenderObj       obj = (WCG.RenderObj)o;
            UnityEngine.Texture ret = obj.m_FrozenTexture;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index m_FrozenTexture on a nil value"));
        }
    }
    static int set_m_FrozenTexture(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            WCG.RenderObj       obj  = (WCG.RenderObj)o;
            UnityEngine.Texture arg0 = (UnityEngine.Texture)ToLua.CheckObject <UnityEngine.Texture>(L, 2);
            obj.m_FrozenTexture = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index m_FrozenTexture on a nil value"));
        }
    }
    static int set_m_FrozenShader(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            WCG.RenderObj      obj  = (WCG.RenderObj)o;
            UnityEngine.Shader arg0 = (UnityEngine.Shader)ToLua.CheckObject(L, 2, typeof(UnityEngine.Shader));
            obj.m_FrozenShader = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index m_FrozenShader on a nil value"));
        }
    }
 static int Play3DSound(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         WCG.RenderObj obj  = (WCG.RenderObj)ToLua.CheckObject <WCG.RenderObj>(L, 1);
         string        arg0 = ToLua.CheckString(L, 2);
         bool          arg1 = LuaDLL.luaL_checkboolean(L, 3);
         float         o    = obj.Play3DSound(arg0, arg1);
         LuaDLL.lua_pushnumber(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int PlayOutLight(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 5);
         WCG.RenderObj obj  = (WCG.RenderObj)ToLua.CheckObject <WCG.RenderObj>(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);
         float         arg3 = (float)LuaDLL.luaL_checknumber(L, 5);
         obj.PlayOutLight(arg0, arg1, arg2, arg3);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #17
0
 public void SetGraphicChar(RenderObj oGraphicChar)
 {
     if (oGraphicChar != null)
     {
         enabled   = true;
         m_trDummy = oGraphicChar.GetDummyFromCache("Dummy_top2");
         if (m_trDummy == null)
         {
             m_trDummy = oGraphicChar.transform;
         }
         UpdateUIPos();
     }
     else
     {
         enabled   = false;
         m_trDummy = null;
     }
 }
 static int BindEquip(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 4);
         WCG.RenderObj          obj  = (WCG.RenderObj)ToLua.CheckObject <WCG.RenderObj>(L, 1);
         string                 arg0 = ToLua.CheckString(L, 2);
         string                 arg1 = ToLua.CheckString(L, 3);
         string                 arg2 = ToLua.CheckString(L, 4);
         UnityEngine.GameObject o    = obj.BindEquip(arg0, arg1, arg2);
         ToLua.PushSealed(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int BindLineEffect(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 6);
         WCG.RenderObj          obj  = (WCG.RenderObj)ToLua.CheckObject <WCG.RenderObj>(L, 1);
         string                 arg0 = ToLua.CheckString(L, 2);
         UnityEngine.GameObject arg1 = (UnityEngine.GameObject)ToLua.CheckObject(L, 3, typeof(UnityEngine.GameObject));
         string                 arg2 = ToLua.CheckString(L, 4);
         string                 arg3 = ToLua.CheckString(L, 5);
         float arg4 = (float)LuaDLL.luaL_checknumber(L, 6);
         UnityEngine.GameObject o = obj.BindLineEffect(arg0, arg1, arg2, arg3, arg4);
         ToLua.PushSealed(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
        public GameObject BindLineEffect(string sEffect, GameObject oTarget, string sSelfDummy, string sTarDummy, float nEffTime)
        {
            RenderObj oTarRenObj = oTarget.GetComponent <RenderObj>();

            if (!oTarRenObj)
            {
                DebugMsg("Target is NOT a Character:" + oTarget.name);
                return(null);
            }

            Transform oTarDummy = oTarRenObj.GetDummyFromCache(sTarDummy);

            if (!oTarDummy)
            {
                DebugMsg("BindLineEffect wrong sDummyTarget:" + m_sName + "," + sTarDummy);
                return(null);
            }

            Transform oSelfDummy = GetDummyFromCache(sSelfDummy);

            if (!oSelfDummy)
            {
                DebugMsg("BindLineEffect wrong sDummySelf:" + m_sName + "," + sSelfDummy);
                return(null);
            }

            GameObject oLineObj = ResourceMgr.LoadAssetEx(sEffect, true);

            if (!oLineObj)
            {
                DebugMsg("BindLineEffect wrong sEffect:" + sEffect);
                return(null);
            }

            oLineObj.SetActive(false);
            Transform trTempDy = transform.Find("Temp_Dummy");

            if (!trTempDy)
            {
                GameObject goTempDy = new GameObject("Temp_Dummy");
                trTempDy = goTempDy.transform;
                trTempDy.SetParent(transform);
            }
            trTempDy.transform.position = oSelfDummy.position;

            Transform oLineTrans = oLineObj.transform;

            oLineTrans.position = oTarDummy.position;
            float   fOffsetY = transform.InverseTransformPoint(oSelfDummy.position).y;
            Vector3 v3Offset = fOffsetY * transform.up.normalized;

            UIMgr.Instance.SetAllLineRenderer(oLineObj, 1 / 10);
            oLineTrans.LookAt(trTempDy.transform.position);
            oLineTrans.SetParent(trTempDy.transform);
            oLineObj.SetActive(true);

            EffectObj oEffObj = new EffectObj(oLineTrans, transform, trTempDy, oTarDummy, v3Offset, nEffTime / 1000);

            m_tEffectObj.Add(oLineObj.GetInstanceID(), oEffObj);
            return(oLineObj);
        }