Borodar.RainbowFolders.Editor.Settings.RainbowFolder.CopyFrom C# (CSharp) Method

CopyFrom() public method

public CopyFrom ( RainbowFolder target ) : void
target RainbowFolder
return void
        public void CopyFrom(RainbowFolder target)
        {
            Type = target.Type;
            Key = target.Key;
            SmallIcon = target.SmallIcon;
            LargeIcon = target.LargeIcon;
        }

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        /// Searches for a folder config that has the same type and key, and updates
        /// its other fields with provided value, if found; creates new folder config otherwise.
        /// </summary>
        public void UpdateFolder(RainbowFolder match, RainbowFolder value)
        {
            Undo.RecordObject(this, "Modify Rainbow Folder Settings");

            RainbowFolder existingFolder = GetFolder(match);

            if (existingFolder != null)
            {
                if (value.HasAtLeastOneIcon())
                {
                    existingFolder.CopyFrom(value);
                }
                else
                {
                    RemoveAll(match);
                }
            }
            else
            {
                if (value.HasAtLeastOneIcon())
                {
                    AddFolder(value);
                }
            }

            EditorUtility.SetDirty(this);
        }
All Usage Examples Of Borodar.RainbowFolders.Editor.Settings.RainbowFolder::CopyFrom