示例#1
0
        public void OnDropUnit()
        {
            if (ResourceBrowser.DragedObject == null || ResourceBrowser.DragedObject.ContentType != ResourceObject.ContentTypes.Unit)
            {
                return;
            }

            SelectedUnit            = UnitBrowser.GetDragUnit();
            SelectedUnitSource      = new SaveLua.Army.Unit();
            SelectedUnitSource.Name = SelectedUnit.CodeName;
            SelectedUnitSource.type = SelectedUnit.CodeName;

            UnitTitle.text = SelectedUnit.CodeName;
            UnitDesc.text  = UnitBrowser.SortDescription(SelectedUnit);

            UnitBg.texture   = UnitBrowser.IconBackgrounds[SelectedUnit.Icon];
            UnitIcon.texture = UnitBrowser.GetDragUnitIcon();
            UnitIcon.enabled = UnitIcon.texture != Texture2D.whiteTexture;
        }