Esempio n. 1
0
    public void SetAssetGUID(string guidStr)
    {
        var newRef = new WeakAssetReference(guidStr);

        if (!newRef.Equals(guid))
        {
            guid = newRef;
            EditorUtility.SetDirty(this);
        }
    }
Esempio n. 2
0
    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);
    }