Ejemplo n.º 1
0
 public void Release()
 {
     if (eod != null)
     {
         eod = null;
     }
     _render = null;
 }
Ejemplo n.º 2
0
 static int GetDes(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         EffectRenderObj        obj = (EffectRenderObj)ToLua.CheckObject(L, 1, typeof(EffectRenderObj));
         EffectObjectDescriptor o   = obj.GetDes();
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 3
0
    private void reStartEffect(EffectRenderObj obj)
    {
        if (obj == null)
        {
            return;
        }

        EffectObjectDescriptor eod = obj.GetDes();

        if (eod != null)
        {
            eod.reStart();
        }
        obj.setStart(true);
    }
Ejemplo n.º 4
0
    private void resetEffect(EffectRenderObj gameObject)
    {
        if (gameObject == null)
        {
            return;
        }
        EffectObjectDescriptor eod = gameObject.GetDes();

        if (eod != null)
        {
            eod.setDisable();
        }
        gameObject.resetState();
        gameObject.setStart(false);
    }
Ejemplo n.º 5
0
    static int set_eod(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            EffectController       obj  = (EffectController)o;
            EffectObjectDescriptor arg0 = (EffectObjectDescriptor)ToLua.CheckObject(L, 2, typeof(EffectObjectDescriptor));
            obj.eod = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index eod on a nil value" : e.Message));
        }
    }
Ejemplo n.º 6
0
    static int get_eod(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            EffectController       obj = (EffectController)o;
            EffectObjectDescriptor ret = obj.eod;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index eod on a nil value" : e.Message));
        }
    }
Ejemplo n.º 7
0
    private void effectCallBack(Object[] obj)
    {
        if (obj == null || obj[0] == null)
        {
            return;
        }
        Object prefab = obj[0];

        if (prefab == null)
        {
            return;
        }
//         GetTransForm().localPosition = Vector3.zero;
//         GetTransForm().localScale = Vector3.one;
        _effectObj                         = GameObject.Instantiate(prefab) as GameObject;
        _effectObj.name                    = _effctName;
        _effectObj.transform.parent        = GetTransForm();
        _effectObj.transform.localScale    = Vector3.one;
        _effectObj.transform.localPosition = Vector3.zero;
        _effectObj.transform.localRotation = Quaternion.Euler(Vector3.zero);
        des = new EffectObjectDescriptor();
        des.Init(this.GetTransForm().gameObject);
        des.RecordState();

        if (_setStart)
        {
            des.reStart();
        }
        else
        {
            des.setDisable();
        }
        efCtrl = new EffectController(this);
        //以下有顺序...不能乱..
        if (_compareLife)
        {
            compareLife();
        }
        if (_size != 1)
        {
            setSize(_size);
        }
        if (_speed != 1)
        {
            setSpeed(_speed);
        }

        if (_resize)
        {
            reSize();
        }

        if (_isStop)
        {
            stop();
        }
        if (_setLife)
        {
            setLife(_liftTime);
        }
        if (m_LoadComCallBack != null)
        {
            m_LoadComCallBack(this);
        }
    }
Ejemplo n.º 8
0
 public EffectController(EffectRenderObj render)
 {
     _render = render;
     eod     = _render.GetDes();
     //           eod.RecordState();
 }