/// <summary> /// Clone this component. /// </summary> /// <returns>Cloned copy of this component.</returns> override public BaseComponent Clone() { ModelMeshRenderer ret = new ModelMeshRenderer(_entity.Model, _entity.Mesh); CopyBasics(ret); return(ret); }
/// <summary> /// Copy basic properties to another component (helper function to help with Cloning). /// </summary> /// <param name="copyTo">Other component to copy values to.</param> /// <returns>The object we are copying properties to.</returns> protected override BaseComponent CopyBasics(BaseComponent copyTo) { ModelMeshRenderer other = copyTo as ModelMeshRenderer; other.MaterialOverride = MaterialOverride.Clone(); other._entity.SetMaterials(_entity.OverrideMaterials); return(base.CopyBasics(other)); }