示例#1
0
        /// <summary>
        ///初始化
        /// </summary>
        public override void Init()
        {
            if (MainLayer != null)
            {
                Debug.LogError("已经执行过Awake");
                return;
            }
            base.Init();
            //

            MainLayer = this.AddLayer();
            //
            foreach (var classData in  this.ClassDataMap.Values)
            {
                var attr = classData.Attribute as ScreenViewAttribute;

                var sv = CreateInstance <IScreenView>(attr.Tag);
                //设置name属性
                var t = sv.GetType();
                t.GetProperty("Name").SetValue(sv, attr.Tag, null);
                MainLayer.RegScreen(sv);
                //
                Debugger.Log("创建screen:" + attr.Tag, "green");
                //
                if (attr.IsDefault)
                {
                    defaultScreenName = attr.Tag;
                }
            }
        }
示例#2
0
        public ScreenViewLayer AddLayer()
        {
            ScreenViewLayer layer = null;

            layer = new ScreenViewLayer(this.screenViewList.Count);
            this.screenViewList.Add(layer);
            return(layer);
        }