Exemplo n.º 1
0
        public LuaBaseUI(LuaTable LuaEntity)
            : base(UIDepthMode.Normal, 0)
        {
            Entity_ = LuaEntity;
            Entity_.SetInPath("_CSEntity_", this);
            OnOpen_  = LuaEntity.GetInPath <Action <LuaTable> >("OnOpen");
            OnClose_ = LuaEntity.GetInPath <Action <LuaTable> >("OnClose");
            OnShow_  = LuaEntity.GetInPath <Action <LuaTable> >("OnShow");
            OnHide_  = LuaEntity.GetInPath <Action <LuaTable> >("OnHide");
            OnTick_  = LuaEntity.GetInPath <Action <LuaTable, float> >("OnTick");

            if (LuaEntity.Exists <string>("Name"))
            {
                Name = LuaEntity.GetInPath <string>("Name");
            }

            if (LuaEntity.Exists <UIDepthMode>("DepthMode"))
            {
                DepthMode = LuaEntity.GetInPath <UIDepthMode>("DepthMode");
            }

            if (LuaEntity.Exists <int>("DepthIndex"))
            {
                DepthIndex = LuaEntity.GetInPath <int>("DepthIndex");
            }

            if (LuaEntity.Exists <bool>("Cached"))
            {
                Cached = LuaEntity.GetInPath <bool>("Cached");
            }
        }