示例#1
0
    public void ShowAnim()
    {
        AnimSystem.UguiMove(gameObject, null, transform.position + positionOffset, 0.2f);
        AnimSystem.Scale(gameObject, Vector3.zero, ScaleTmp, 0.2f, InterpType.Default);
        AnimSystem.Scale(gameObject, ScaleTmp, Vector3.one, 0.1f, InterpType.Default, delayTime: 0.2f);

        AnimSystem.CustomMethodToFloat(SetAlpha, 0, 1, 0.2f);
        AnimSystem.CustomMethodToFloat(SetAlpha, 1, 0.3f, 0.5f, 0.3f);

        Timer.DelayCallBack(0.6f, DestroyThis);
    }
    static int CustomMethodToFloat(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 11);
            AnimCustomMethodFloat arg0 = null;
            LuaTypes funcType1         = LuaDLL.lua_type(L, 1);

            if (funcType1 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (AnimCustomMethodFloat)ToLua.CheckObject(L, 1, typeof(AnimCustomMethodFloat));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 1);
                arg0 = DelegateFactory.CreateDelegate(typeof(AnimCustomMethodFloat), func) as AnimCustomMethodFloat;
            }

            float        arg1       = (float)LuaDLL.luaL_checknumber(L, 2);
            float        arg2       = (float)LuaDLL.luaL_checknumber(L, 3);
            float        arg3       = (float)LuaDLL.luaL_checknumber(L, 4);
            float        arg4       = (float)LuaDLL.luaL_checknumber(L, 5);
            InterpType   arg5       = (InterpType)ToLua.CheckObject(L, 6, typeof(InterpType));
            bool         arg6       = LuaDLL.luaL_checkboolean(L, 7);
            RepeatType   arg7       = (RepeatType)ToLua.CheckObject(L, 8, typeof(RepeatType));
            int          arg8       = (int)LuaDLL.luaL_checknumber(L, 9);
            AnimCallBack arg9       = null;
            LuaTypes     funcType10 = LuaDLL.lua_type(L, 10);

            if (funcType10 != LuaTypes.LUA_TFUNCTION)
            {
                arg9 = (AnimCallBack)ToLua.CheckObject(L, 10, typeof(AnimCallBack));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 10);
                arg9 = DelegateFactory.CreateDelegate(typeof(AnimCallBack), func) as AnimCallBack;
            }

            object[] arg10 = ToLua.CheckObjectArray(L, 11);
            AnimData o     = AnimSystem.CustomMethodToFloat(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
            ToLua.PushObject(L, o);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
示例#3
0
    /// <summary>
    /// 更新血条(受伤时)
    /// </summary>
    /// <param name="新生命值的百分比"></param>
    public void UpdateLifeSlider(float l_n_newLifeRatio)
    {
        //容错处理
        if (l_n_newLifeRatio < 0)
        {
            l_n_newLifeRatio = 0;
        }

        bloodIsFull = l_n_newLifeRatio >= 1?true:false;

        m_newLifeRatio = l_n_newLifeRatio;
        //即时血条更新
        SetLifeSliderValue(l_n_newLifeRatio);

        //动画血条更新
        AnimSystem.CustomMethodToFloat(LifeSliderAni, n_oldLifeRatio, l_n_newLifeRatio, n_sliderAniTime, 0, InterpType.InCubic, callBack: UpdateSliderAnim);
    }
示例#4
0
    /// <summary>
    /// 更新血条(回复时)
    /// </summary>
    /// <param name="新生命值的百分比"></param>
    public void UpdateLifeSliderRecover(float l_n_newLifeRatio)
    {
        //容错处理
        if (l_n_newLifeRatio < 0)
        {
            l_n_newLifeRatio = 0;
        }

        ////即时(暗色)血条更新
        //SetLifeSliderAniValue(l_n_newLifeRatio);

        AnimSystem.CustomMethodToFloat(LifeSliderAni, n_oldLifeRatio, l_n_newLifeRatio, n_sliderAniTime, 0, InterpType.InCubic);

        //动画血条更新
        AnimSystem.CustomMethodToFloat(LifeSlider, n_oldLifeRatio, l_n_newLifeRatio, n_sliderAniTime, 0, InterpType.InCubic, callBack: (o) =>
        {
            SetOldLifeRatio(l_n_newLifeRatio);
        });
    }