public void SetAssetGUID(string guidStr) { var newRef = new WeakAssetReference(guidStr); if (!newRef.Equals(guid)) { guid = newRef; EditorUtility.SetDirty(this); } }
public bool SetAssetGUID(string guidStr) { var guid = new WeakAssetReference(guidStr); var val = Value; var currentGuid = val.assetGuid; if (!guid.Equals(currentGuid)) { val.assetGuid = guid; Value = val; PrefabUtility.SavePrefabAsset(gameObject); return(true); } return(false); }