示例#1
0
        public static FixedUpdateListener Get(GameObject go, string listenerTag = null)
        {
            FixedUpdateListener[] listeners = go.GetComponents <FixedUpdateListener>();
            FixedUpdateListener   listener  = FindListener(listeners, listenerTag);

            if (listener == null)
            {
                listener             = go.AddComponent <FixedUpdateListener>();
                listener.listenerTag = listenerTag;
            }
            return(listener);
        }
        private void AddFixedUpdateListener()
        {
            Action <LuaTable> luaFixedUpdate = m_LuaTable.Get <Action <LuaTable> >("FixedUpdate");

            if (luaFixedUpdate != null)
            {
                FixedUpdateListener listener = FixedUpdateListener.Get(this);
                listener.fixedUpdate = luaFixedUpdate;
                if (!m_BehaviourListenerSet.Contains(listener))
                {
                    m_BehaviourListenerSet.Add(listener);
                }
            }
        }