示例#1
0
 public IObjectProfile(IObjectProfile source)
 {
     _id        = source._id;
     _master_id = source._master_id;
     _category  = source._category;
     _rarity    = source._rarity;
     _name      = source._name;
 }
示例#2
0
    public void Setup(IObjectProfile profile)
    {
        if (profile == null)
        {
            return;
        }

        source = profile;
        UpdateContents();
        gameObject.SetActive(true);
    }
示例#3
0
        public void AddObjectByProfile(IObjectProfile profile, IMenuHandler handler)
        {
            var lineProfile = new LineProfile()
            {
                profile
            };

            switch (profile.align)
            {
            case ObjectAlign.l:
                if (this.leftBlock == null)
                {
                    this.leftBlock = GenerateAndPrepareBlock(lineProfile, ObjectAlign.l, handler);
                }
                else
                {
                    this.leftBlock.AddElement((IMenuObject)handler.CreateRegion(profile));
                }

                break;

            case ObjectAlign.c:
                if (this.centerBlock == null)
                {
                    this.centerBlock = GenerateAndPrepareBlock(lineProfile, ObjectAlign.c, handler);
                }
                else
                {
                    this.centerBlock.AddElement((IMenuObject)handler.CreateRegion(profile));
                }

                break;

            default:
                if (this.rightBlock == null)
                {
                    this.rightBlock = GenerateAndPrepareBlock(lineProfile, ObjectAlign.r, handler);
                }
                else
                {
                    this.rightBlock.AddElement((IMenuObject)handler.CreateRegion(profile));
                }

                break;
            }

            this.Content = new List <IAlignedBlock>();
            this.Content.AddRange(new[] { this.leftBlock, this.centerBlock, this.rightBlock }.Where(b => b != null));
        }