Esempio n. 1
0
 public static void RefreshEditor()
 {
     if (VariableMaterial.updates.GetInvocationList().Length > 1)
     {
         ProxyEditor.StartAssetEditing();
         VariableMaterial.writes();
         ProxyEditor.StopAssetEditing();
         //ProxyEditor.SaveAssets();
         ProxyEditor.RefreshAssets();
         File.Refresh();
         VariableMaterial.updates();
     }
     VariableMaterial.updates = () => {};
     VariableMaterial.writes  = () => {};
     VariableMaterial.dirty   = true;
     VariableMaterial.delay   = false;
     ProxyEditor.RebuildInspectors();
 }
Esempio n. 2
0
        public static void Unflatten(params UnityObject[] targets)
        {
            string shaderName = "";

            foreach (var target in targets)
            {
                var      material   = (Material)target;
                FileData shaderFile = VariableMaterial.GetParentShader(target);
                if (shaderFile.IsNull())
                {
                    continue;
                }
                shaderName      = shaderFile.fullName;
                material.shader = shaderFile.GetAsset <Shader>();
            }
            VariableMaterial.dirty = true;
            if (VariableMaterial.debug)
            {
                Log.Show("[VariableMaterial] " + shaderName + " -- " + targets.Length + " Unflattened.");
            }
            ProxyEditor.RebuildInspectors();
        }