From 3e017e806b8a8404969ea5177485a18d175de738 Mon Sep 17 00:00:00 2001 From: Toru Date: Sat, 20 Aug 2016 18:48:24 +0900 Subject: [PATCH] RenderTexture modifier added. --- .../Base/Integrated/IntegratedGUIModifier.cs | 154 ++++++++++------ .../RenderTextureOperator.cs | 116 ------------ .../OperatorBase.cs} | 0 .../OperatorBase.cs.meta} | 4 +- .../RenderTextureOperator.cs | 168 ++++++++++++++++++ .../RenderTextureOperator.cs.meta | 0 .../AssetBundleGraphPrivate/TypeBinder.cs | 2 +- .../Editor/GUI/AssetBundleGraph.cs | 4 +- 8 files changed, 269 insertions(+), 179 deletions(-) delete mode 100644 Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierIOperationDataDefinition/RenderTextureOperator.cs rename Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/{ModifierIOperationDataDefinition/BaseOperator.cs => ModifierOperators/OperatorBase.cs} (100%) rename Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/{ModifierIOperationDataDefinition/BaseOperator.cs.meta => ModifierOperators/OperatorBase.cs.meta} (75%) create mode 100644 Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierOperators/RenderTextureOperator.cs rename Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/{ModifierIOperationDataDefinition => ModifierOperators}/RenderTextureOperator.cs.meta (100%) diff --git a/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/IntegratedGUIModifier.cs b/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/IntegratedGUIModifier.cs index 56b411286..9d5442d39 100644 --- a/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/IntegratedGUIModifier.cs +++ b/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/IntegratedGUIModifier.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Collections.Generic; using System.IO; -using System.Reflection; namespace AssetBundleGraph { public class IntegratedGUIModifier : INodeBase { @@ -14,7 +13,7 @@ public void Setup (string nodeName, string nodeId, string connectionIdToNextNode return; } - // ImportSetting merges multiple incoming groups into one. why -> see IntegratedGUIImporterSetting. same behaviour preferred. + // Modifier merges multiple incoming groups into one. if (1 < groupedSources.Keys.Count) { Debug.LogWarning(nodeName + " Modifier merges incoming group into \"" + groupedSources.Keys.ToList()[0]); } @@ -66,11 +65,11 @@ public void Setup (string nodeName, string nodeId, string connectionIdToNextNode var opDataPath = FileController.PathCombine(opDataFolderPath, AssetBundleGraphSettings.MODIFIER_OPERATION_DATA_NANE); if (!File.Exists(opDataPath)) { // type is already assumed. - if (!TypeBinder.SupportedModifierOperationTarget.ContainsKey(modifierType)) { + if (!TypeBinder.SupportedModifierOperationDefinition.ContainsKey(modifierType)) { throw new NodeException("unsupported ModifierOperation Type:" + modifierType, nodeId); } - var operatorType = TypeBinder.SupportedModifierOperationTarget[modifierType]; + var operatorType = TypeBinder.SupportedModifierOperationDefinition[modifierType]; var operatorInstance = Activator.CreateInstance(operatorType) as ModifierOperators.OperatorBase; @@ -80,8 +79,7 @@ public void Setup (string nodeName, string nodeId, string connectionIdToNextNode generated json data is typed as supported ModifierOperation type. */ var jsonData = JsonUtility.ToJson(defaultRenderTextureOp); - - using (var sw = new StreamWriter(opDataPath, true)) { + using (var sw = new StreamWriter(opDataPath)) { sw.WriteLine(jsonData); } } @@ -100,28 +98,77 @@ generated json data is typed as supported ModifierOperation type. var outputSources = new List(); - // /* - // all assets types are same and do nothing to assets in setup. - // */ - // foreach (var inputSource in inputSources) { - // var modifyTargetAssetPath = inputSource.importedPath; + /* + all assets types are same and do nothing to assets in setup. + */ + foreach (var inputSource in inputSources) { + var modifyTargetAssetPath = inputSource.importedPath; - // var newData = InternalAssetData.InternalAssetDataByImporterOrModifier( - // inputSource.traceId, - // inputSource.absoluteSourcePath, - // inputSource.sourceBasePath, - // inputSource.fileNameAndExtension, - // inputSource.pathUnderSourceBase, - // inputSource.importedPath, - // null, - // inputSource.assetType - // ); - - // outputSources.Add(newData); - // } - - // 実行時のブロック - // 実行時には、データ生成とかはしないが内容の有無のチェックとかはする。エラーで吹っ飛ばす専門。 + var newData = InternalAssetData.InternalAssetDataByImporterOrModifier( + inputSource.traceId, + inputSource.absoluteSourcePath, + inputSource.sourceBasePath, + inputSource.fileNameAndExtension, + inputSource.pathUnderSourceBase, + inputSource.importedPath, + null, + inputSource.assetType + ); + + outputSources.Add(newData); + } + + var outputDict = new Dictionary>(); + outputDict[groupMergeKey] = outputSources; + + Output(nodeId, connectionIdToNextNode, outputDict, new List()); + } + + + public void Run (string nodeName, string nodeId, string connectionIdToNextNode, Dictionary> groupedSources, List alreadyCached, Action>, List> Output) { + if (groupedSources.Keys.Count == 0) { + return; + } + + // Modifier merges multiple incoming groups into one. + if (1 < groupedSources.Keys.Count) { + Debug.LogWarning(nodeName + " Modifier merges incoming group into \"" + groupedSources.Keys.ToList()[0]); + } + + var groupMergeKey = groupedSources.Keys.ToList()[0]; + + // merge all assets into single list. + var inputSources = new List(); + foreach (var groupKey in groupedSources.Keys) { + inputSources.AddRange(groupedSources[groupKey]); + } + + if (!inputSources.Any()) { + return; + } + + // load type from 1st asset of flow. + var modifierType = TypeBinder.AssumeTypeOfAsset(inputSources[0].importedPath).ToString(); + + // modifierType is fixed. + + var modifierOperationDataFolderPath = AssetBundleGraphSettings.MODIFIER_OPERATION_DATAS_PLACE; + var opDataFolderPath = FileController.PathCombine(modifierOperationDataFolderPath, nodeId); + var opDataPath = FileController.PathCombine(opDataFolderPath, AssetBundleGraphSettings.MODIFIER_OPERATION_DATA_NANE); + + // validate saved data. + ValidateModifiyOperationData( + nodeId, + () => { + throw new NodeException("このノードのOperationDataがないのでSetupしてね", nodeId); + }, + () => { + /*do nothing.*/ + } + ); + + var outputSources = new List(); + var loadedModifierOperationData = string.Empty; using (var sr = new StreamReader(opDataPath)) { loadedModifierOperationData = sr.ReadLine(); @@ -133,14 +180,14 @@ generated json data is typed as supported ModifierOperation type. var deserializedDataObject = JsonUtility.FromJson(loadedModifierOperationData); var dataTypeString = deserializedDataObject.dataType; - if (!TypeBinder.SupportedModifierOperationTarget.ContainsKey(dataTypeString)) { + if (!TypeBinder.SupportedModifierOperationDefinition.ContainsKey(dataTypeString)) { throw new NodeException("unsupported ModifierOperation Type:" + modifierType, nodeId); } - var modifyOperatorType = TypeBinder.SupportedModifierOperationTarget[dataTypeString]; + var modifyOperatorType = TypeBinder.SupportedModifierOperationDefinition[dataTypeString]; /* - make generic method as desired typed. + make generic method for genearte desired typed ModifierOperator instance. */ var modifyOperatorInstance = typeof(IntegratedGUIModifier) .GetMethod("FromJson") @@ -151,9 +198,9 @@ make generic method as desired typed. foreach (var inputSource in inputSources) { var modifyTargetAssetPath = inputSource.importedPath; - var asset = AssetDatabase.LoadAssetAtPath(modifyTargetAssetPath); + var modifyOperationTargetAsset = AssetDatabase.LoadAssetAtPath(modifyTargetAssetPath); - if (!modifyOperatorInstance.IsChanged(asset)) { + if (!modifyOperatorInstance.IsChanged(modifyOperationTargetAsset)) { var notChangedData = InternalAssetData.InternalAssetDataGeneratedByImporterOrModifierOrPrefabricator( inputSource.importedPath, AssetDatabase.AssetPathToGUID(inputSource.importedPath), @@ -165,22 +212,23 @@ make generic method as desired typed. continue; } - // isChanged = true; - // modifyOperatorInstance.Modify(modifyTargetAssetPath); + isChanged = true; + modifyOperatorInstance.Modify(modifyOperationTargetAsset); - // var newData = InternalAssetData.InternalAssetDataGeneratedByImporterOrModifierOrPrefabricator( - // inputSource.importedPath, - // AssetDatabase.AssetPathToGUID(inputSource.importedPath), - // AssetBundleGraphInternalFunctions.GetAssetType(inputSource.importedPath), - // true,// marked as changed. - // false - // ); + var newData = InternalAssetData.InternalAssetDataGeneratedByImporterOrModifierOrPrefabricator( + inputSource.importedPath, + AssetDatabase.AssetPathToGUID(inputSource.importedPath), + AssetBundleGraphInternalFunctions.GetAssetType(inputSource.importedPath), + true,// marked as changed. + false + ); - // outputSources.Add(newData); + outputSources.Add(newData); } if (isChanged) { - AssetDatabase.Refresh();// 変更を加えたAssetの設定をデータベースに反映させないといけない。 + // apply asset setting changes to AssetDatabase. + AssetDatabase.Refresh(); } var outputDict = new Dictionary>(); @@ -189,15 +237,15 @@ make generic method as desired typed. Output(nodeId, connectionIdToNextNode, outputDict, new List()); } + /** + caution. + do not delete this method. + this method is called through reflection for adopt Generic type in Runtime. + */ public T FromJson (string source) { return JsonUtility.FromJson(source); } - public void Run (string nodeName, string nodeId, string connectionIdToNextNode, Dictionary> groupedSources, List alreadyCached, Action>, List> Output) { - - } - - /** 限定的なチェックが出来る。 ・nodeに対応したファイルが存在するかどうか @@ -222,14 +270,4 @@ Action validAssetOperationDataFound validAssetOperationDataFound(); } } - - public class ModifierOperation where T : UnityEngine.Object { - public bool IsChanged (string modifyTargetAssetPath) { - throw new NotImplementedException(); - } - - public void Modify (string modifyTargetAssetPath) { - throw new NotImplementedException(); - } - } } diff --git a/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierIOperationDataDefinition/RenderTextureOperator.cs b/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierIOperationDataDefinition/RenderTextureOperator.cs deleted file mode 100644 index 7ffac3b01..000000000 --- a/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierIOperationDataDefinition/RenderTextureOperator.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System; -using UnityEngine; - -namespace AssetBundleGraph.ModifierOperators { - /* - paramter definitions for RenderTexture. - - 定数定義とかについて考えてあること: - ・パラメータ名はInspector準拠 - 例えばRenderTextureの場合、Inspector上でColor Formatって書いてあるパラメータは、実際のAssetではformatって名前になってます。 - どっちに合わせようか悩んだんですが、Inspectorに合わせるようにしました。 - IsChangedやModifyメソッド内ではその辺を加味して突き合せる根性が必要です。 - - ・閾値のあるパラメータについて - - */ - [Serializable] public class RenderTextureOperator : OperatorBase { - [SerializeField] public Int32 width, height; - - public enum AntiAliasing : int { - None = 1, - _2 = 2, - _4 = 4, - _8 = 8 - } - [SerializeField] public AntiAliasing antiAliasing;// 1, 2, 4, 8. 4type. - - [SerializeField] public UnityEngine.RenderTextureFormat colorFormat; - - public enum DepthBuffer : int { - NoDepthBuffer = 0, - _16bitDepth = 16, - _24bitDepth = 24 - } - [SerializeField] public DepthBuffer depthBuffer;// 0, 16, 24. 3type. - - [SerializeField] public UnityEngine.TextureWrapMode wrapMode; - - [SerializeField] public UnityEngine.FilterMode filterMode; - - [SerializeField] public int anisoLevel;// limit to 16. - - - - public RenderTextureOperator () {} - - private RenderTextureOperator ( - Int32 width, Int32 height, - AntiAliasing antiAliasing, - UnityEngine.RenderTextureFormat colorFormat, - DepthBuffer depthBuffer, - UnityEngine.TextureWrapMode wrapMode, - UnityEngine.FilterMode filterMode, - Int32 anisoLevel - ) { - this.dataType = "UnityEngine.RenderTexture"; - this.width = width; - this.height = height; - this.antiAliasing = antiAliasing; - this.colorFormat = colorFormat; - this.depthBuffer = depthBuffer; - this.wrapMode = wrapMode; - this.filterMode = filterMode; - this.anisoLevel = anisoLevel; - } - - /* - constructor for default data setting. - */ - public override OperatorBase DefaultSetting () { - return new RenderTextureOperator( - 256, 256, - AntiAliasing.None, - UnityEngine.RenderTextureFormat.ARGB32, - DepthBuffer._16bitDepth, - UnityEngine.TextureWrapMode.Clamp, - UnityEngine.FilterMode.Bilinear, - 0 - ); - } - - public override bool IsChanged (T asset) { - var t = asset as RenderTexture; - - // Inspector上の項目名 / 値(パラメータ名すらすれ違うがまあ、、) - // Debug.LogError("t.width:" + t.width.GetType()); - // Debug.LogError("t.height:" + t.height); - // Debug.LogError("t.antiAliasing:" + t.antiAliasing);// 1 = None, 2 = 2samples, 4 = 4samples, 8 = 8samples. GUIマッピングが露骨な例。 - // Debug.LogError("t.ColorFormat:" + t.format.GetType());// - // Debug.LogError("t.DepthBuffer:" + t.depth);// 0, 16, 24, - // Debug.LogError("t.WrapMode:" + t.wrapMode);// - // Debug.LogError("t.FilterMode:" + t.filterMode);// なんか定数が返ってくる。UnityEngine.FilterMode。 - - var changed = false; - if (t.width != this.width) changed = true; - if (t.height != this.height) changed = true; - if (t.antiAliasing != (int)this.antiAliasing) changed = true; - if (t.format != this.colorFormat) changed = true; - if (t.depth != (int)this.depthBuffer) changed = true; - if (t.wrapMode != this.wrapMode) changed = true; - if (t.depth != (int)this.depthBuffer) changed = true; - if (t.filterMode != this.filterMode) changed = true; - if (t.anisoLevel != this.anisoLevel) changed = true; - return changed; - } - - public override void Modify (T asset) { - var t = asset as RenderTexture; - - - - t.anisoLevel = this.anisoLevel; - } - } - -} \ No newline at end of file diff --git a/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierIOperationDataDefinition/BaseOperator.cs b/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierOperators/OperatorBase.cs similarity index 100% rename from Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierIOperationDataDefinition/BaseOperator.cs rename to Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierOperators/OperatorBase.cs diff --git a/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierIOperationDataDefinition/BaseOperator.cs.meta b/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierOperators/OperatorBase.cs.meta similarity index 75% rename from Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierIOperationDataDefinition/BaseOperator.cs.meta rename to Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierOperators/OperatorBase.cs.meta index 0f9e2aa00..4a8983084 100644 --- a/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierIOperationDataDefinition/BaseOperator.cs.meta +++ b/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierOperators/OperatorBase.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 38d3d7aae1efe4901afb7e01a9979f97 -timeCreated: 1471682512 +guid: 8ad03d9254cd64e3aa516eaceb951d61 +timeCreated: 1471683036 licenseType: Pro MonoImporter: serializedVersion: 2 diff --git a/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierOperators/RenderTextureOperator.cs b/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierOperators/RenderTextureOperator.cs new file mode 100644 index 000000000..d54dcaf16 --- /dev/null +++ b/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierOperators/RenderTextureOperator.cs @@ -0,0 +1,168 @@ +using System; +using UnityEngine; + +namespace AssetBundleGraph.ModifierOperators { + /* + paramter definitions for RenderTexture. + + このクラスの設定方法と役割 + 0.TypeBinder.csのSupportedModifierOperationDefinitionに、 + サポートしたいAsset型をGetType().ToString()した文字列をkey、このクラスのTypeをvalueとして設定する。 + + 例:RenderTextureのModify処理をこのクラスで対応するようにしたい場合、 + {"UnityEngine.RenderTexture", typeof(ModifierOperators.RenderTextureOperator)} + とか書く。 + + 1.このクラスに対象Assetの型のModifierとしての処理を記述する + DefaultSetting, IsChanged, Modifyの三つのメソッドをoverrideして実装してもらう想定。 + + 2.このクラスのデータ型の定義を使ってModifierOperationData(ModifierNodeごとに作成されるjson)のデータを吐き出す + 保存したい設定データに[Serializable]とか[SerializeField]のアノテーションつけるの忘れないように。 + + 3.データ型の定義を持ち、Inspector表示時にそのenumを使って内容を表示することができる + インスペクタ部分まだちゃんと作ってないですが、型に応じて作る想定。 + + + 定数定義とかについて考えてあること: + ・変更できるパラメータの選別について + オリジナルのAssetのInspector上で扱えるパラメータのみを対象に変更できるようにしようと思ってます。 + 例えばRenderTextureであれば、RenderTexture型のAssetのInspectorで表示されるパラメータのみを対象に、 + 調整とか変更が出来るようにしようと思っています。 + + ・パラメータ名はInspector準拠 + 例えばRenderTextureの場合、Inspector上でColor Formatって書いてあるパラメータは、実際のAssetではformatって名前になってます。 + + API上:renderTexture.format + Inspector上:Color Format + + で、保存するパラメータ名をAPIとInspectorのどっちに合わせようか悩んだんですが、 + + Inspectorで表示されてる変更可能なパラメータ数 < APIで扱える変更可能なパラメータ数 という前提がまあ自明であるので、 + より強い制約を作り出しているInspectorに準拠しようと思ってます。 + + IsChangedやModifyメソッド内では、その辺を加味してAPIとInspector上の名前の違いを突き合せる根性が必要です。 + その代わりInspector上での値とパラメータ名のマッチングが楽です。 + + ・閾値とEnumが定義されているパラメータについて + 例えばRenderTextureのwrapModeは、Enum UnityEngine.TextureWrapModeを使っています。 + で、すでに定義されているEnumがある場合は、極力そのEnumを使うと、データ化や反映が楽なんで、 + この型でもUnityEngine.TextureWrapModeを保持して互換性を大事にしようと思ってます。 + + ・閾値はあるんだけどEnumのないパラメータについて + RenderTextureのantiAliasingのように、int値かつ特定の値のみを持ち、 + EnumではなくInt32とかを使っていて、 + + なおかつInspector上で[None]とか[2 samples]とか + そういう表記になっているパラメータは、この型でEnumを作成して制約をつけています。 + + ここで定義したEnumに関しては、データ型としてのRead/Writeはもちろん、Inspector上からも参照する想定です。 + + ・Inspector上の設定はあるんだけど実際にコードから変更しようとすると変更できないパラメータについて + ImportSetting作ってる時もあったんですが、 + API上は読めて書いてできるように見えるんだけど実際には変更できない(実行時にエラーが出る)パラメータが多々あります。 + RenderTextureの場合は、widthとかheight、colorFormat, depthあたりが「実際には変更不可」でした。 + + 本物のInspectorからは変更できるんですが、ユーザーが扱えるレベルのMainThreadのコードでは変更不可っぽいです。 + Assetの作り直しとかを強制的にやればいけるのかもしれませんが、GUID変わりそう。 + + */ + [Serializable] public class RenderTextureOperator : OperatorBase { + [SerializeField] public Int32 width, height; + + public enum AntiAliasing : int { + None = 1, + _2_Samples = 2, + _4_Samples = 4, + _8_Samples = 8 + } + [SerializeField] public AntiAliasing antiAliasing;// 1, 2, 4, 8. 4type. + + [SerializeField] public UnityEngine.RenderTextureFormat colorFormat; + + public enum DepthBuffer : int { + NoDepthBuffer = 0, + _16bitDepth = 16, + _24bitDepth = 24 + } + [SerializeField] public DepthBuffer depthBuffer;// 0, 16, 24. 3type. + + [SerializeField] public UnityEngine.TextureWrapMode wrapMode; + + [SerializeField] public UnityEngine.FilterMode filterMode; + + [SerializeField] public int anisoLevel;// limit to 16. + + + + public RenderTextureOperator () {} + + private RenderTextureOperator ( + Int32 width, Int32 height, + AntiAliasing antiAliasing, + UnityEngine.RenderTextureFormat colorFormat, + DepthBuffer depthBuffer, + UnityEngine.TextureWrapMode wrapMode, + UnityEngine.FilterMode filterMode, + Int32 anisoLevel + ) { + this.dataType = "UnityEngine.RenderTexture"; + this.width = width; + this.height = height; + this.antiAliasing = antiAliasing; + this.colorFormat = colorFormat; + this.depthBuffer = depthBuffer; + this.wrapMode = wrapMode; + this.filterMode = filterMode; + this.anisoLevel = anisoLevel; + } + + /* + constructor for default data setting. + */ + public override OperatorBase DefaultSetting () { + return new RenderTextureOperator( + 256, 256, + AntiAliasing.None, + UnityEngine.RenderTextureFormat.ARGB32, + DepthBuffer._16bitDepth, + UnityEngine.TextureWrapMode.Clamp, + UnityEngine.FilterMode.Bilinear, + 0 + ); + } + + public override bool IsChanged (T asset) { + var t = asset as RenderTexture; + + var changed = false; + + // if (t.width != this.width) changed = true; + // if (t.height != this.height) changed = true; + if (t.antiAliasing != (int)this.antiAliasing) changed = true; + // if (t.format != this.colorFormat) changed = true; + // if (t.depth != (int)this.depthBuffer) changed = true; + if (t.wrapMode != this.wrapMode) changed = true; + if (t.filterMode != this.filterMode) changed = true; + if (t.anisoLevel != this.anisoLevel) changed = true; + + return changed; + } + + public override void Modify (T asset) { + var t = asset as RenderTexture; + + // コメントアウトしてあるパラメータは指定、変更できなかった、、、(Setting depth format of already created render texture is not supported!)とか出る + // 哀しい話ですが、変更できないパラメータはSerializeとかInspectorで表示しないでもいいかも、、 + + // t.width = this.width; + // t.height = this.height; + t.antiAliasing = (int)this.antiAliasing; + // t.format = this.colorFormat; + // t.depth = (int)this.depthBuffer; + t.wrapMode = this.wrapMode; + t.filterMode = this.filterMode; + t.anisoLevel = this.anisoLevel; + } + } + +} \ No newline at end of file diff --git a/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierIOperationDataDefinition/RenderTextureOperator.cs.meta b/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierOperators/RenderTextureOperator.cs.meta similarity index 100% rename from Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierIOperationDataDefinition/RenderTextureOperator.cs.meta rename to Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/Base/Integrated/ModifierOperators/RenderTextureOperator.cs.meta diff --git a/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/TypeBinder.cs b/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/TypeBinder.cs index 528b49786..4f1e4e4a7 100644 --- a/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/TypeBinder.cs +++ b/Assets/AssetBundleGraph/Editor/AssetBundleGraphPrivate/TypeBinder.cs @@ -104,7 +104,7 @@ public static Type AssumeTypeOfAsset (string assetPath) { /** 明示的に対応している ModifierOperator の型を記述する。 */ - public static Dictionary SupportedModifierOperationTarget = new Dictionary { + public static Dictionary SupportedModifierOperationDefinition = new Dictionary { {"UnityEngine.RenderTexture", typeof(ModifierOperators.RenderTextureOperator)} }; } diff --git a/Assets/AssetBundleGraph/Editor/GUI/AssetBundleGraph.cs b/Assets/AssetBundleGraph/Editor/GUI/AssetBundleGraph.cs index d4f4793aa..b1680d298 100644 --- a/Assets/AssetBundleGraph/Editor/GUI/AssetBundleGraph.cs +++ b/Assets/AssetBundleGraph/Editor/GUI/AssetBundleGraph.cs @@ -1770,7 +1770,7 @@ private void DrawStraightLineFromCurrentEventSourcePointTo (Vector2 to, OnNodeEv Handles.DrawLine(new Vector3(p.x, p.y, 0f), new Vector3(to.x, to.y, 0f)); } - private static string Prettify (string sourceJson) { + public static string PrettifyJson (string sourceJson) { var lines = sourceJson .Replace("{", "{\n").Replace("}", "\n}") .Replace("[", "[\n").Replace("]", "\n]") @@ -1811,7 +1811,7 @@ adopt indent. private static void UpdateGraphData (Dictionary data) { var dataStr = Json.Serialize(data); - var prettified = Prettify(dataStr); + var prettified = PrettifyJson(dataStr); var basePath = FileController.PathCombine(Application.dataPath, AssetBundleGraphSettings.ASSETNBUNDLEGRAPH_DATA_PATH); var graphDataPath = FileController.PathCombine(basePath, AssetBundleGraphSettings.ASSETBUNDLEGRAPH_DATA_NAME);