Ejemplo n.º 1
0
 private void OnAssetChanged(AssetItem obj, bool oldValue, bool newValue)
 {
     // Make sure we clone the item here only if it is necessary
     // Cloning the AssetItem is mandatory in order to make sure
     // the asset item won't change
     AssetChanged?.Invoke(obj.Clone(true), oldValue, newValue);
 }
Ejemplo n.º 2
0
 private void OnAssetChanged(FilePath fullPath)
 {
     if (AssetChanged != null)
     {
         AssetChanged.Invoke(fullPath);
     }
 }
Ejemplo n.º 3
0
        public void OnEnable()
        {
            var container    = this as TContainer;
            var assetPath    = AssetDatabase.GetAssetPath(this);
            var assetContent = m_AssetContent;

            if ((!string.IsNullOrEmpty(assetPath) && DeserializeFromPath(container, assetPath)) ||
                (!string.IsNullOrEmpty(assetContent) && DeserializeFromJson(container, assetContent)))
            {
                if (assetContent != m_AssetContent)
                {
                    AssetChanged?.Invoke(container);
                }
            }
        }
        public void OnEnable()
        {
            var assetPath    = AssetDatabase.GetAssetPath(this);
            var assetContent = m_AssetAsJson;

            if (!string.IsNullOrEmpty(assetPath))
            {
                assetContent = File.ReadAllText(assetPath);
            }

            if (!string.IsNullOrEmpty(assetContent))
            {
                DeserializeFromJson(this, assetContent);
                if (assetContent != m_AssetAsJson)
                {
                    m_AssetAsJson = assetContent;
                    AssetChanged?.Invoke(this);
                }
            }
        }
Ejemplo n.º 5
0
 public void TriggerAssetChanged(AssetInfo asset) => AssetChanged?.Invoke(this, new AssetChangedArgs(asset));
Ejemplo n.º 6
0
 protected void NotifyAssetChanged()
 {
     AssetChanged?.Invoke(this, EventArgs.Empty);
 }