Example #1
0
    virtual protected void Update()
    {
        if (this.m_currentLayer != this.gameObject.layer)
        {
            this.m_currentLayer = this.gameObject.layer;
            if (this.m_currentLayer == GameUtil.HideLayer)
            {
                this.OnDisable();
            }
            else
            {
                if (this.m_table == null)
                {
                    if (!string.IsNullOrEmpty(m_LuaClassName))
                    {
                        DoFile(m_LuaClassName);
                    }
                }
                this.OnEnable();
            }
        }

        if (this.m_currentLayer != GameUtil.HideLayer)
        {
#if UNITY_EDITOR
            GameUtil.BeginMarkTime();
            UnityEngine.Profiling.Profiler.BeginSample(this.LuaClassName);
#endif
            CallMethod(LuaMonoMethod.Update);
#if UNITY_EDITOR
            UnityEngine.Profiling.Profiler.EndSample();
            GameUtil.EndMarkTime(this.LuaClassName, 5);
#endif
        }
    }