
commit bb3be793ca5db3df43679f2d6c34c75f768047a1 Author: SAIPO <grasste0403@hotmail.com> Date: Wed Dec 22 07:46:07 2021 +0800 修改佛教Boss关卡和伊斯兰Boss关卡的粒子特效 commit 1987a63954402be8894f9cc9805545432afefa18 Author: SAIPO <grasste0403@hotmail.com> Date: Tue Dec 21 20:55:05 2021 +0800 任务:编写shader,完善数据库类 1.完善了PlayerInfo类,用以数据库功能 1) 编写GetSqlData()函数,使用多线程获取用户信息,使用前请先设置公关变量name。 2) 编写CreateUser(string username)函数,在用户表内创建一个用户。 3) 编写hasName(string _searchName)函数,判断是否存在这个用户。 4) 编写GetBoardInfo(int WorldId)函数,获取指定世界的留言板链表。 5) 编写GetDeadInfo(int WorldId)函数,获取指定世界的死亡信息链表。 6) 编写CreateDead(int WorldId, Vector2 postion)函数,创建一条死亡信息。 7) 编写CreateBoard(int WorldId, Vector2 postion,string text)函数,创建一条留言信息。 8) 编写UpdatePlayerInfo()函数,将类里储存的信息上传到数据库。 2.实装相关Shader 1)完善以撒关卡的屏幕后特效,使其可以在发怒场景发出红色辉光。 2)完善以撒鬼魂的粒子,并且颜色和发怒与否关联。 3)实装以撒关卡的窗户辉光效果。 4)实装伊斯兰Boss关卡炸弹弹反的粒子特效。 5)实装伊斯兰Boss关卡的尘土特效(需要重做) 6)实装佛教Boss关卡的敲钟声波特效。 7)实装佛教Boss关卡的钟声受击灰尘(需要重做) 3.目前发现的bug 1)当人物恰好调到角落里会卡动画。 2)伊斯兰Boss关卡,特洛伊木马吐出的炸弹落到特效小怪上会闪退。 commit c06b842382051bc260d9f509491c683a41ca2a4c Author: SAIPO <grasste0403@hotmail.com> Date: Tue Dec 21 14:08:06 2021 +0800 Squashed commit of the following: commit e7dcdec1d9913e283f42d42f72f1030f0c8b6fda Author: Roman <1325980292@qq.com> Date: Tue Dec 21 00:45:50 2021 +0800 任务:搭建前置关卡,编写演出逻辑 1.流程化游戏 (1.制作转移器,内含字典,根据玩家的静态属性“阶段”来决定到转移点后将会移动到哪一个场景 (2.制作转场器,水平方向从左到右 下班 commit 74f926815ec8d00fa051192eb3b978ff4b3c01a6 Author: Roman <1325980292@qq.com> Date: Mon Dec 20 23:33:14 2021 +0800 任务:搭建前置关卡,编写演出逻辑 1.编写基督前置关卡 (1.放置平台、怪物和男童 (2.修改男童类,外加OnSaveEvent,OnSave时若有事件则触发该Event (3.编写开幕演出,与yi前置类似 (4.编写男童解救演出 ((1.触发Fungus对话 ((2.对话结束后,开启通往上层的门 2.搭建村场景 (1.放置平台和元素 (2.为可动元素制作动画 3.为玩家添加static属性,进度。0:刚开,1进村,2通佛,3通伊,4.通基 4.制作死亡重开功能 (1.当玩家生命值降到0及以下,触发死亡事件 (2.死亡后reload当前场景,并设记录员,关闭某些事件和演出不再执行 *优化和修复 (1.尝试制作击中卡肉效果,目前打击感太弱。也可以尝试粒子效果 *至此,全部前置关卡搭建完毕,村场景搭建完毕。 *明天可以完成流程化,接下来就是填充剧情、UI、死亡标记和留言板等系统了 下班 commit f257b40d10373a13380e9c395fe94d6559a82a0f Author: Roman <1325980292@qq.com> Date: Sun Dec 19 23:57:44 2021 +0800 任务:搭建前置关卡,编写演出逻辑 1.编写佛教前置关开场演出 (*.休整地形,使得左边多出一块地面,方便演出正常运作 (*.项目后期再通过逻辑触发该演出,目前先用调试方式触发演出 (1.关闭空气墙 (2.修改玩家inputDir使玩家从屏幕外冲进到屏幕内部 (3.等待一段时间 (4.此时玩家应该走到某个合适的位置,停止玩家的inputDir (5.等待一小段时间给玩家反应 (6.修改相机offset,使其对准对话的两个小怪 (7.等待一小段时间给玩家反应 (8.触发Fungus对话 (9.Fungus对话结束后,返回标记命令演出Main继续执行 *.修改NormalEnemy,添加标识isInFoStage,在Update中判断,若是,使该怪物水平方向上追踪玩家,可以参考爱欲品的Seek (10.修改左边小怪的isInFoStage (11.开启右边小怪的Path动画,表现其慌忙逃跑 (12.Invoke一个延时,等右边小怪逃出视野后删除它 (13.触发善后和结束事件 (14.重写善后事件,重新开启空气墙 2.搭建伊斯兰前置关卡 3.创建伊斯兰前置关卡演出 (1.关闭空气墙 (2.修改玩家inputDir使玩家从屏幕外冲进到屏幕内部 (3.等待一段时间 (4.此时玩家应该走到某个合适的位置,停止玩家的inputDir (5.等待一小段时间给玩家反应 (6.触发善后与结束事件 4.创建玩家隔间触发事件 (1.是进入式触发器对象 (2.触发时Call隔间演出 5.编写隔间演出逻辑 (1.表现关门 (2.左右晃一下镜头,中心移动到左右门处,表示门被关闭 (3.镜头回到玩家处,同时压缩相机可移动范围更窄 (4.打开隔间墙壁的空气墙 (5.设置EndEvent为伊斯兰事件 6.编写召唤伊斯兰事件 (1.摘自木马的召唤攻击,稍作修改 (2.当召唤的伊斯兰全部挂了,触发隔间结束事件 7.编写隔间结束事件 (1.表现开门 (2.关闭隔间的空气墙 (3.重设相机移动范围 8.搭建基督前置关卡 *.至此,第一关、第二关前置关卡的逻辑基本开发完毕 *.明天能做完所有前置关,顺便应该能搭完村场景,后天可以开始搭建新系统,目前还差留言、死亡标记等系统等待编写 下班 commit cd22966ad7637a84c0f08c3a716d5ec549699749 Author: Roman <1325980292@qq.com> Date: Sun Dec 19 14:12:05 2021 +0800 Squashed commit of the following: commit 26aff356971bdc2c2a6a3bd444eeb50c4bf7ec14 Author: SAIPO <grasste0403@hotmail.com> Date: Sun Dec 19 02:20:44 2021 +0800 导入近期制作的一些Shader 1.合并分支 2.完成了人物描边的流动shader制作,并且可以对Bloom屏幕后处理产生反应。 3.完成了基督教boss关卡,彩色窗户辉光的shader制作,可以对Bloom产生反应。 4.完成了伊斯兰教弹反的炸弹拖尾粒子shader的制作。 5.完成了火焰粒子shader的制作(可以用在基督教的以撒鬼魂上)。 6.完成了灰尘粒子像素化的shader制作。 7.完成了边缘扭曲的shader制作,可以用在一些树木上,让画面产生动感。 明天制作敲钟的声波Shader # Conflicts: # UserSettings/EditorUserSettings.asset commit 26aff356971bdc2c2a6a3bd444eeb50c4bf7ec14 Author: SAIPO <grasste0403@hotmail.com> Date: Sun Dec 19 02:20:44 2021 +0800 导入近期制作的一些Shader 1.合并分支 2.完成了人物描边的流动shader制作,并且可以对Bloom屏幕后处理产生反应。 3.完成了基督教boss关卡,彩色窗户辉光的shader制作,可以对Bloom产生反应。 4.完成了伊斯兰教弹反的炸弹拖尾粒子shader的制作。 5.完成了火焰粒子shader的制作(可以用在基督教的以撒鬼魂上)。 6.完成了灰尘粒子像素化的shader制作。 7.完成了边缘扭曲的shader制作,可以用在一些树木上,让画面产生动感。 明天制作敲钟的声波Shader # Conflicts: # Assets/Scenes/TeLuoYiStageTest.unity # Assets/Shader/火焰粒子shader/particle.shadergraph # Assets/Shader/灰尘粒子用shader/Pixel_My.shader # Assets/Shader/灰尘粒子用shader/Unlit_Pixel_My 1.mat # Assets/Shader/灰尘粒子用shader/Unlit_Pixel_My 2.mat # Assets/Shader/灰尘粒子用shader/Unlit_Pixel_My.mat # Logs/ApiUpdaterCheck.txt # UserSettings/EditorUserSettings.asset
844 lines
29 KiB
C#
844 lines
29 KiB
C#
// Amplify Shader Editor - Visual Shader Editing Tool
|
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
|
|
|
using System;
|
|
using System.IO;
|
|
using System.Security.Cryptography;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEditor;
|
|
using System.Threading;
|
|
using UnityEditor.VersionControl;
|
|
|
|
namespace AmplifyShaderEditor
|
|
{
|
|
public enum ShaderLoadResult
|
|
{
|
|
LOADED,
|
|
TEMPLATE_LOADED,
|
|
FILE_NOT_FOUND,
|
|
ASE_INFO_NOT_FOUND,
|
|
UNITY_NATIVE_PATHS
|
|
}
|
|
|
|
public class Worker
|
|
{
|
|
public static readonly object locker = new object();
|
|
public void DoWork()
|
|
{
|
|
while ( IOUtils.ActiveThread )
|
|
{
|
|
if ( IOUtils.SaveInThreadFlag )
|
|
{
|
|
IOUtils.SaveInThreadFlag = false;
|
|
lock ( locker )
|
|
{
|
|
IOUtils.SaveInThreadShaderBody = IOUtils.ShaderCopywriteMessage + IOUtils.SaveInThreadShaderBody;
|
|
// Add checksum
|
|
string checksum = IOUtils.CreateChecksum( IOUtils.SaveInThreadShaderBody );
|
|
IOUtils.SaveInThreadShaderBody += IOUtils.CHECKSUM + IOUtils.VALUE_SEPARATOR + checksum;
|
|
|
|
// Write to disk
|
|
StreamWriter fileWriter = new StreamWriter( IOUtils.SaveInThreadPathName );
|
|
try
|
|
{
|
|
fileWriter.Write( IOUtils.SaveInThreadShaderBody );
|
|
Debug.Log( "Saving complete" );
|
|
}
|
|
catch ( Exception e )
|
|
{
|
|
Debug.LogException( e );
|
|
}
|
|
finally
|
|
{
|
|
fileWriter.Close();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Debug.Log( "Thread closed" );
|
|
}
|
|
}
|
|
|
|
public static class IOUtils
|
|
{
|
|
public delegate void OnShaderAction( Shader shader, bool isTemplate, string type );
|
|
public static OnShaderAction OnShaderSavedEvent;
|
|
public static OnShaderAction OnShaderTypeChangedEvent;
|
|
|
|
public static readonly string ShaderCopywriteMessage = "// Made with Amplify Shader Editor\n// Available at the Unity Asset Store - http://u3d.as/y3X \n";
|
|
public static readonly string GrabPassEmpty = "\t\tGrabPass{ }\n";
|
|
public static readonly string GrabPassBegin = "\t\tGrabPass{ \"";
|
|
public static readonly string GrabPassEnd = "\" }\n";
|
|
public static readonly string PropertiesBegin = "\tProperties\n\t{\n";
|
|
public static readonly string PropertiesEnd = "\t}\n";
|
|
public static readonly string PropertiesElement = "\t\t{0}\n";
|
|
public static readonly string PropertiesElementsRaw = "{0}\n";
|
|
|
|
public static readonly string PragmaTargetHeader = "\t\t#pragma target {0}\n";
|
|
public static readonly string InstancedPropertiesHeader = "multi_compile_instancing";
|
|
public static readonly string VirtualTexturePragmaHeader = "multi_compile _ _VT_SINGLE_MODE";
|
|
|
|
public static readonly string InstancedPropertiesBegin = "UNITY_INSTANCING_CBUFFER_START({0})";
|
|
public static readonly string InstancedPropertiesEnd = "UNITY_INSTANCING_CBUFFER_END";
|
|
public static readonly string InstancedPropertiesElement = "UNITY_DEFINE_INSTANCED_PROP({0}, {1})";
|
|
public static readonly string InstancedPropertiesData = "UNITY_ACCESS_INSTANCED_PROP({0})";
|
|
|
|
public static readonly string DotsInstancedPropertiesData = "\tUNITY_DOTS_INSTANCED_PROP({0}, {1})";
|
|
public static readonly string DotsInstancedDefinesData = "#define {1} UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO({0} , Metadata_{1})";
|
|
|
|
public static readonly string LWSRPInstancedPropertiesBegin = "UNITY_INSTANCING_BUFFER_START({0})";
|
|
public static readonly string LWSRPInstancedPropertiesEnd = "UNITY_INSTANCING_BUFFER_END({0})";
|
|
public static readonly string LWSRPInstancedPropertiesElement = "UNITY_DEFINE_INSTANCED_PROP({0}, {1})";
|
|
public static readonly string LWSRPInstancedPropertiesData = "UNITY_ACCESS_INSTANCED_PROP({0},{1})";
|
|
|
|
public static readonly string SRPCBufferPropertiesBegin = "CBUFFER_START( UnityPerMaterial )";//"CBUFFER_START({0})";
|
|
public static readonly string SRPCBufferPropertiesEnd = "CBUFFER_END";
|
|
|
|
|
|
public static readonly string InstancedPropertiesBeginTabs = "\t\t"+ InstancedPropertiesBegin + "\n";
|
|
public static readonly string InstancedPropertiesEndTabs = "\t\t"+ InstancedPropertiesEnd + "\n";
|
|
public static readonly string InstancedPropertiesElementTabs = "\t\t\t"+ InstancedPropertiesElement + "\n";
|
|
|
|
public static readonly string MetaBegin = "defaultTextures:";
|
|
public static readonly string MetaEnd = "userData:";
|
|
public static readonly string ShaderBodyBegin = "/*ASEBEGIN";
|
|
public static readonly string ShaderBodyEnd = "ASEEND*/";
|
|
//public static readonly float CurrentVersionFlt = 0.4f;
|
|
//public static readonly string CurrentVersionStr = "Version=" + CurrentVersionFlt;
|
|
|
|
public static readonly string CHECKSUM = "//CHKSM";
|
|
public static readonly string LAST_OPENED_OBJ_ID = "ASELASTOPENOBJID";
|
|
|
|
public static readonly string MAT_CLIPBOARD_ID = "ASEMATCLIPBRDID";
|
|
public static readonly char FIELD_SEPARATOR = ';';
|
|
public static readonly char VALUE_SEPARATOR = '=';
|
|
public static readonly char LINE_TERMINATOR = '\n';
|
|
public static readonly char VECTOR_SEPARATOR = ',';
|
|
public static readonly char FLOAT_SEPARATOR = '.';
|
|
public static readonly char CLIPBOARD_DATA_SEPARATOR = '|';
|
|
public static readonly char MATRIX_DATA_SEPARATOR = '|';
|
|
public readonly static string NO_TEXTURES = "<None>";
|
|
public static readonly string SaveShaderStr = "Please enter shader name to save";
|
|
public static readonly string FloatifyStr = ".0";
|
|
|
|
// Node parameter names
|
|
public const string NodeParam = "Node";
|
|
public const string NodePosition = "Position";
|
|
public const string NodeId = "Id";
|
|
public const string NodeType = "Type";
|
|
public const string WireConnectionParam = "WireConnection";
|
|
|
|
public static readonly uint NodeTypeId = 1;
|
|
|
|
public static readonly int InNodeId = 1;
|
|
public static readonly int InPortId = 2;
|
|
public static readonly int OutNodeId = 3;
|
|
public static readonly int OutPortId = 4;
|
|
|
|
public readonly static string DefaultASEDirtyCheckName = "__dirty";
|
|
public readonly static string DefaultASEDirtyCheckProperty = "[HideInInspector] " + DefaultASEDirtyCheckName + "( \"\", Int ) = 1";
|
|
public readonly static string DefaultASEDirtyCheckUniform = "uniform int " + DefaultASEDirtyCheckName + " = 1;";
|
|
|
|
public readonly static string MaskClipValueName = "_Cutoff";
|
|
public readonly static string MaskClipValueProperty = MaskClipValueName + "( \"{0}\", Float ) = {1}";
|
|
public readonly static string MaskClipValueUniform = "uniform float " + MaskClipValueName + " = {0};";
|
|
|
|
public readonly static string ChromaticAberrationProperty = "_ChromaticAberration";
|
|
|
|
//public static readonly string ASEFolderGUID = "daca988099666ec40aaa2cde22bb4935";
|
|
//public static string ASEResourcesPath = "/Plugins/EditorResources/";
|
|
//public static string ASEFolderPath;
|
|
|
|
//public static bool IsShaderFunctionWindow = false;
|
|
|
|
|
|
public static int DefaultASEDirtyCheckId;
|
|
|
|
// this is to be used in combination with AssetDatabase.GetAssetPath, both of these include the Assets/ path so we need to remove from one of them
|
|
public static string dataPath;
|
|
|
|
|
|
public static string EditorResourcesGUID = "0932db7ec1402c2489679c4b72eab5eb";
|
|
public static string GraphBgTextureGUID = "881c304491028ea48b5027ac6c62cf73";
|
|
public static string GraphFgTextureGUID = "8c4a7fca2884fab419769ccc0355c0c1";
|
|
public static string WireTextureGUID = "06e687f68dd96f0448c6d8217bbcf608";
|
|
public static string MasterNodeOnTextureGUID = "26c64fcee91024a49980ea2ee9d1a2fb";
|
|
public static string MasterNodeOffTextureGUID = "712aee08d999c16438e2d694f42428e8";
|
|
public static string GPUInstancedOnTextureGUID = "4b0c2926cc71c5846ae2a29652d54fb6";
|
|
public static string GPUInstancedOffTextureGUID = "486c7766baaf21b46afb63c1121ef03e";
|
|
public static string MainSkinGUID = "57482289c346f104a8162a3a79aaff9d";
|
|
|
|
public static string UpdateOutdatedGUID = "cce638be049286c41bcbd0a26c356b18";
|
|
public static string UpdateOFFGUID = "99d70ac09b4db9742b404c3f92d8564b";
|
|
public static string UpdateUpToDatedGUID = "ce30b12fbb3223746bcfef9ea82effe3";
|
|
public static string LiveOffGUID = "bb16faf366bcc6c4fbf0d7666b105354";
|
|
public static string LiveOnGUID = "6a0ae1d7892333142aeb09585572202c";
|
|
public static string LivePendingGUID = "e3182200efb67114eb5050f8955e1746";
|
|
public static string CleanupOFFGUID = "f62c0c3a5ddcd844e905fb2632fdcb15";
|
|
public static string CleanUpOnGUID = "615d853995cf2344d8641fd19cb09b5d";
|
|
public static string TakeScreenshotOFFGUID = "7587de2e3bec8bf4d973109524ccc6b1";
|
|
public static string TakeScreenshotONGUID = "7587de2e3bec8bf4d973109524ccc6b1";
|
|
public static string ShareOFFGUID = "bc5bd469748466a459badfab23915cb0";
|
|
public static string ShareONGUID = "bc5bd469748466a459badfab23915cb0";
|
|
public static string OpenSourceCodeOFFGUID = "f7e8834b42791124095a8b7f2d4daac2";
|
|
public static string OpenSourceCodeONGUID = "8b114792ff84f6546880c031eda42bc0";
|
|
public static string FocusNodeGUID = "da673e6179c67d346abb220a6935e359";
|
|
public static string FitViewGUID = "1def740f2314c6b4691529cadeee2e9c";
|
|
public static string ShowInfoWindowGUID = "77af20044e9766840a6be568806dc22e";
|
|
public static string ShowTipsWindowGUID = "066674048bbb1e64e8cdcc6c3b4abbeb";
|
|
public static string ShowConsoleWindowGUID = "9a81d7df8e62c044a9d1cada0c8a2131";
|
|
|
|
|
|
public static Dictionary<string, string> NodeTypeReplacer = new Dictionary<string, string>()
|
|
{
|
|
{"AmplifyShaderEditor.RotateAboutAxis", "AmplifyShaderEditor.RotateAboutAxisNode"},
|
|
{"GlobalArrayNode", "AmplifyShaderEditor.GlobalArrayNode"},
|
|
{"AmplifyShaderEditor.SimpleMaxOp", "AmplifyShaderEditor.SimpleMaxOpNode"},
|
|
{"AmplifyShaderEditor.SimpleMinNode", "AmplifyShaderEditor.SimpleMinOpNode"},
|
|
{"AmplifyShaderEditor.TFHCRemap", "AmplifyShaderEditor.TFHCRemapNode"},
|
|
{"AmplifyShaderEditor.TFHCPixelateUV", "AmplifyShaderEditor.TFHCPixelate"},
|
|
{"AmplifyShaderEditor.VirtualTexturePropertyNode", "AmplifyShaderEditor.VirtualTextureObject"}
|
|
};
|
|
|
|
private static readonly string AmplifyShaderEditorDefineSymbol = "AMPLIFY_SHADER_EDITOR";
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// THREAD IO UTILS
|
|
public static bool SaveInThreadFlag = false;
|
|
public static string SaveInThreadShaderBody;
|
|
public static string SaveInThreadPathName;
|
|
public static Thread SaveInThreadMainThread;
|
|
public static bool ActiveThread = true;
|
|
private static bool UseSaveThread = false;
|
|
|
|
private static bool Initialized = false;
|
|
|
|
public static bool FunctionNodeChanged = false;
|
|
|
|
public static List<AmplifyShaderEditorWindow> AllOpenedWindows = new List<AmplifyShaderEditorWindow>();
|
|
|
|
public static void StartSaveThread( string shaderBody, string pathName )
|
|
{
|
|
if( Provider.enabled && Provider.isActive )
|
|
{
|
|
Asset loadedAsset = Provider.GetAssetByPath( FileUtil.GetProjectRelativePath( pathName ) );
|
|
if( loadedAsset != null )
|
|
{
|
|
//Task statusTask = Provider.Status( loadedAsset );
|
|
//statusTask.Wait();
|
|
//if( Provider.CheckoutIsValid( statusTask.assetList[ 0 ] ) )
|
|
{
|
|
Task checkoutTask = Provider.Checkout( loadedAsset, CheckoutMode.Both );
|
|
checkoutTask.Wait();
|
|
}
|
|
}
|
|
}
|
|
|
|
if( UseSaveThread )
|
|
{
|
|
if ( !SaveInThreadFlag )
|
|
{
|
|
if ( SaveInThreadMainThread == null )
|
|
{
|
|
Worker worker = new Worker();
|
|
SaveInThreadMainThread = new Thread( worker.DoWork );
|
|
SaveInThreadMainThread.Start();
|
|
Debug.Log( "Thread created" );
|
|
}
|
|
|
|
SaveInThreadShaderBody = shaderBody;
|
|
SaveInThreadPathName = pathName;
|
|
SaveInThreadFlag = true;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SaveTextfileToDisk( shaderBody, pathName );
|
|
}
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
public static void SetAmplifyDefineSymbolOnBuildTargetGroup( BuildTargetGroup targetGroup )
|
|
{
|
|
string currData = PlayerSettings.GetScriptingDefineSymbolsForGroup( targetGroup );
|
|
if ( !currData.Contains( AmplifyShaderEditorDefineSymbol ) )
|
|
{
|
|
if ( string.IsNullOrEmpty( currData ) )
|
|
{
|
|
PlayerSettings.SetScriptingDefineSymbolsForGroup( targetGroup, AmplifyShaderEditorDefineSymbol );
|
|
}
|
|
else
|
|
{
|
|
if ( !currData[ currData.Length - 1 ].Equals( ';' ) )
|
|
{
|
|
currData += ';';
|
|
}
|
|
currData += AmplifyShaderEditorDefineSymbol;
|
|
PlayerSettings.SetScriptingDefineSymbolsForGroup( targetGroup, currData );
|
|
}
|
|
}
|
|
}
|
|
|
|
public static void RemoveAmplifyDefineSymbolOnBuildTargetGroup( BuildTargetGroup targetGroup )
|
|
{
|
|
string currData = PlayerSettings.GetScriptingDefineSymbolsForGroup( targetGroup );
|
|
if( currData.Contains( AmplifyShaderEditorDefineSymbol ) )
|
|
{
|
|
currData = currData.Replace( AmplifyShaderEditorDefineSymbol + ";", "" );
|
|
currData = currData.Replace( ";" + AmplifyShaderEditorDefineSymbol, "" );
|
|
currData = currData.Replace( AmplifyShaderEditorDefineSymbol, "" );
|
|
PlayerSettings.SetScriptingDefineSymbolsForGroup( targetGroup, currData );
|
|
}
|
|
}
|
|
|
|
public static void Init()
|
|
{
|
|
if ( !Initialized )
|
|
{
|
|
Initialized = true;
|
|
if( EditorPrefs.GetBool( Preferences.PrefDefineSymbol, true ) )
|
|
SetAmplifyDefineSymbolOnBuildTargetGroup( EditorUserBuildSettings.selectedBuildTargetGroup );
|
|
//Array BuildTargetGroupValues = Enum.GetValues( typeof( BuildTargetGroup ));
|
|
//for ( int i = 0; i < BuildTargetGroupValues.Length; i++ )
|
|
//{
|
|
// if( i != 0 && i != 15 && i != 16 )
|
|
// SetAmplifyDefineSymbolOnBuildTargetGroup( ( BuildTargetGroup ) BuildTargetGroupValues.GetValue( i ) );
|
|
//}
|
|
|
|
DefaultASEDirtyCheckId = Shader.PropertyToID( DefaultASEDirtyCheckName );
|
|
dataPath = Application.dataPath.Remove( Application.dataPath.Length - 6 );
|
|
|
|
|
|
//ASEFolderPath = AssetDatabase.GUIDToAssetPath( ASEFolderGUID );
|
|
//ASEResourcesPath = ASEFolderPath + ASEResourcesPath;
|
|
}
|
|
}
|
|
|
|
|
|
public static void DumpTemplateManagers()
|
|
{
|
|
for( int i = 0; i < AllOpenedWindows.Count; i++ )
|
|
{
|
|
if( AllOpenedWindows[ i ].TemplatesManagerInstance != null )
|
|
{
|
|
Debug.Log( AllOpenedWindows[ i ].titleContent.text + ": " + AllOpenedWindows[ i ].TemplatesManagerInstance.GetInstanceID() );
|
|
}
|
|
}
|
|
}
|
|
|
|
public static TemplatesManager FirstValidTemplatesManager
|
|
{
|
|
get
|
|
{
|
|
for( int i = 0; i < AllOpenedWindows.Count; i++ )
|
|
{
|
|
if( AllOpenedWindows[ i ].TemplatesManagerInstance != null )
|
|
{
|
|
return AllOpenedWindows[ i ].TemplatesManagerInstance;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static void UpdateSFandRefreshWindows( AmplifyShaderFunction function )
|
|
{
|
|
for( int i = 0; i < AllOpenedWindows.Count; i++ )
|
|
{
|
|
AllOpenedWindows[ i ].LateRefreshAvailableNodes();
|
|
if( AllOpenedWindows[ i ].IsShaderFunctionWindow )
|
|
{
|
|
if( AllOpenedWindows[ i ].OpenedShaderFunction == function )
|
|
{
|
|
AllOpenedWindows[ i ].UpdateTabTitle();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public static void UpdateIO()
|
|
{
|
|
int windowCount = AllOpenedWindows.Count;
|
|
if ( windowCount == 0 )
|
|
{
|
|
EditorApplication.update -= IOUtils.UpdateIO;
|
|
return;
|
|
}
|
|
|
|
for ( int i = 0; i < AllOpenedWindows.Count; i++ )
|
|
{
|
|
if ( AllOpenedWindows[i] == EditorWindow.focusedWindow )
|
|
{
|
|
UIUtils.CurrentWindow = AllOpenedWindows[ i ];
|
|
}
|
|
|
|
if( FunctionNodeChanged )
|
|
AllOpenedWindows[ i ].CheckFunctions = true;
|
|
|
|
if ( AllOpenedWindows[ i ] == null )
|
|
{
|
|
AllOpenedWindows.RemoveAt( i );
|
|
i--;
|
|
}
|
|
}
|
|
|
|
if ( FunctionNodeChanged )
|
|
FunctionNodeChanged = false;
|
|
}
|
|
|
|
public static void Destroy()
|
|
{
|
|
ActiveThread = false;
|
|
if ( SaveInThreadMainThread != null )
|
|
{
|
|
SaveInThreadMainThread.Abort();
|
|
SaveInThreadMainThread = null;
|
|
}
|
|
}
|
|
|
|
public static void GetShaderName( out string shaderName, out string fullPathname, string defaultName, string customDatapath )
|
|
{
|
|
string currDatapath = String.IsNullOrEmpty( customDatapath ) ? Application.dataPath : customDatapath;
|
|
fullPathname = EditorUtility.SaveFilePanelInProject( "Select Shader to save", defaultName, "shader", SaveShaderStr, currDatapath );
|
|
if ( !String.IsNullOrEmpty( fullPathname ) )
|
|
{
|
|
shaderName = fullPathname.Remove( fullPathname.Length - 7 ); // -7 remove .shader extension
|
|
string[] subStr = shaderName.Split( '/' );
|
|
if ( subStr.Length > 0 )
|
|
{
|
|
shaderName = subStr[ subStr.Length - 1 ]; // Remove pathname
|
|
}
|
|
}
|
|
else
|
|
{
|
|
shaderName = string.Empty;
|
|
}
|
|
}
|
|
|
|
public static void AddTypeToString( ref string myString, string typeName )
|
|
{
|
|
myString += typeName;
|
|
}
|
|
|
|
public static void AddFieldToString( ref string myString, string fieldName, object fieldValue )
|
|
{
|
|
myString += FIELD_SEPARATOR + fieldName + VALUE_SEPARATOR + fieldValue;
|
|
}
|
|
|
|
public static void AddFieldValueToString( ref string myString, object fieldValue )
|
|
{
|
|
myString += FIELD_SEPARATOR + fieldValue.ToString();
|
|
}
|
|
|
|
public static void AddLineTerminator( ref string myString )
|
|
{
|
|
myString += LINE_TERMINATOR;
|
|
}
|
|
|
|
public static string CreateChecksum( string buffer )
|
|
{
|
|
SHA1 sha1 = SHA1.Create();
|
|
byte[] buf = System.Text.Encoding.UTF8.GetBytes( buffer );
|
|
byte[] hash = sha1.ComputeHash( buf, 0, buf.Length );
|
|
string hashstr = BitConverter.ToString( hash ).Replace( "-", "" );
|
|
return hashstr;
|
|
}
|
|
|
|
public static void SaveTextfileToDisk( string shaderBody, string pathName, bool addAdditionalInfo = true )
|
|
{
|
|
|
|
if ( addAdditionalInfo )
|
|
{
|
|
shaderBody = ShaderCopywriteMessage + shaderBody;
|
|
// Add checksum
|
|
string checksum = CreateChecksum( shaderBody );
|
|
shaderBody += CHECKSUM + VALUE_SEPARATOR + checksum;
|
|
}
|
|
|
|
// Write to disk
|
|
StreamWriter fileWriter = new StreamWriter( pathName );
|
|
try
|
|
{
|
|
fileWriter.Write( shaderBody );
|
|
}
|
|
catch ( Exception e )
|
|
{
|
|
Debug.LogException( e );
|
|
}
|
|
finally
|
|
{
|
|
fileWriter.Close();
|
|
}
|
|
}
|
|
|
|
public static string AddAdditionalInfo( string shaderBody )
|
|
{
|
|
shaderBody = ShaderCopywriteMessage + shaderBody;
|
|
string checksum = CreateChecksum( shaderBody );
|
|
shaderBody += CHECKSUM + VALUE_SEPARATOR + checksum;
|
|
return shaderBody;
|
|
}
|
|
|
|
public static string LoadTextFileFromDisk( string pathName )
|
|
{
|
|
string result = string.Empty;
|
|
if ( !string.IsNullOrEmpty( pathName ) && File.Exists( pathName ) )
|
|
{
|
|
|
|
StreamReader fileReader = null;
|
|
try
|
|
{
|
|
fileReader = new StreamReader( pathName );
|
|
result = fileReader.ReadToEnd();
|
|
}
|
|
catch ( Exception e )
|
|
{
|
|
Debug.LogException( e );
|
|
}
|
|
finally
|
|
{
|
|
if( fileReader != null)
|
|
fileReader.Close();
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public static bool IsASEShader( Shader shader )
|
|
{
|
|
string datapath = AssetDatabase.GetAssetPath( shader );
|
|
if ( UIUtils.IsUnityNativeShader( datapath ) )
|
|
{
|
|
return false;
|
|
}
|
|
|
|
string buffer = LoadTextFileFromDisk( datapath );
|
|
if ( String.IsNullOrEmpty( buffer ) || !IOUtils.HasValidShaderBody( ref buffer ) )
|
|
{
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public static bool IsShaderFunction( string functionInfo )
|
|
{
|
|
string buffer = functionInfo;
|
|
if ( String.IsNullOrEmpty( buffer ) || !IOUtils.HasValidShaderBody( ref buffer ) )
|
|
{
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public static bool HasValidShaderBody( ref string shaderBody )
|
|
{
|
|
int shaderBodyBeginId = shaderBody.IndexOf( ShaderBodyBegin );
|
|
if ( shaderBodyBeginId > -1 )
|
|
{
|
|
int shaderBodyEndId = shaderBody.IndexOf( ShaderBodyEnd );
|
|
return ( shaderBodyEndId > -1 && shaderBodyEndId > shaderBodyBeginId );
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public static int[] AllIndexesOf( this string str, string substr, bool ignoreCase = false )
|
|
{
|
|
if ( string.IsNullOrEmpty( str ) || string.IsNullOrEmpty( substr ) )
|
|
{
|
|
throw new ArgumentException( "String or substring is not specified." );
|
|
}
|
|
|
|
List<int> indexes = new List<int>();
|
|
int index = 0;
|
|
|
|
while ( ( index = str.IndexOf( substr, index, ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal ) ) != -1 )
|
|
{
|
|
indexes.Add( index++ );
|
|
}
|
|
|
|
return indexes.ToArray();
|
|
}
|
|
|
|
public static void AddFunctionHeader( ref string function, string header )
|
|
{
|
|
function += "\t\t" + header + "\n\t\t{\n";
|
|
}
|
|
|
|
public static void AddSingleLineFunction( ref string function, string header )
|
|
{
|
|
function += "\t\t" + header;
|
|
}
|
|
|
|
public static void AddFunctionLine( ref string function, string line )
|
|
{
|
|
function += "\t\t\t" + line + "\n";
|
|
}
|
|
|
|
public static void CloseFunctionBody( ref string function )
|
|
{
|
|
function += "\t\t}\n";
|
|
}
|
|
|
|
public static string CreateFullFunction( string header, params string[] functionLines )
|
|
{
|
|
string result = string.Empty;
|
|
AddFunctionHeader( ref result, header );
|
|
for ( int i = 0; i > functionLines.Length; i++ )
|
|
{
|
|
AddFunctionLine( ref result, functionLines[ i ] );
|
|
}
|
|
CloseFunctionBody( ref result );
|
|
return result;
|
|
}
|
|
|
|
public static string CreateCodeComments( bool forceForwardSlash, params string[] comments )
|
|
{
|
|
string finalComment = string.Empty;
|
|
if ( comments.Length == 1 )
|
|
{
|
|
finalComment = "//" + comments[ 0 ];
|
|
}
|
|
else
|
|
{
|
|
if ( forceForwardSlash )
|
|
{
|
|
for ( int i = 0; i < comments.Length; i++ )
|
|
{
|
|
finalComment += "//" + comments[ i ];
|
|
if ( i < comments.Length - 1 )
|
|
{
|
|
finalComment += "\n\t\t\t";
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
finalComment = "/*";
|
|
for ( int i = 0; i < comments.Length; i++ )
|
|
{
|
|
if ( i != 0 )
|
|
finalComment += "\t\t\t";
|
|
finalComment += comments[ i ];
|
|
if ( i < comments.Length - 1 )
|
|
finalComment += "\n";
|
|
}
|
|
finalComment += "*/";
|
|
}
|
|
}
|
|
return finalComment;
|
|
}
|
|
|
|
public static string GetUVChannelDeclaration( string uvName, int channelId, int set )
|
|
{
|
|
string uvSetStr = ( set == 0 ) ? "uv" : "uv" + Constants.AvailableUVSetsStr[ set ];
|
|
return "float2 " + uvSetStr + uvName /*+ " : TEXCOORD" + channelId*/;
|
|
}
|
|
|
|
public static string GetUVChannelName( string uvName, int set )
|
|
{
|
|
string uvSetStr = ( set == 0 ) ? "uv" : "uv" + Constants.AvailableUVSetsStr[ set ];
|
|
return uvSetStr + uvName;
|
|
}
|
|
|
|
public static string GetVertexUVChannelName( int set )
|
|
{
|
|
string uvSetStr = ( set == 0 ) ? "texcoord" : ( "texcoord" + set.ToString() );
|
|
return uvSetStr;
|
|
}
|
|
|
|
public static string Floatify( float value )
|
|
{
|
|
return ( value % 1 ) != 0 ? value.ToString() : ( value.ToString() + FloatifyStr );
|
|
}
|
|
|
|
public static string Vector2ToString( Vector2 data )
|
|
{
|
|
return data.x.ToString() + VECTOR_SEPARATOR + data.y.ToString();
|
|
}
|
|
|
|
public static string Vector3ToString( Vector3 data )
|
|
{
|
|
return data.x.ToString() + VECTOR_SEPARATOR + data.y.ToString() + VECTOR_SEPARATOR + data.z.ToString();
|
|
}
|
|
|
|
public static string Vector4ToString( Vector4 data )
|
|
{
|
|
return data.x.ToString() + VECTOR_SEPARATOR + data.y.ToString() + VECTOR_SEPARATOR + data.z.ToString() + VECTOR_SEPARATOR + data.w.ToString();
|
|
}
|
|
|
|
public static string ColorToString( Color data )
|
|
{
|
|
return data.r.ToString() + VECTOR_SEPARATOR + data.g.ToString() + VECTOR_SEPARATOR + data.b.ToString() + VECTOR_SEPARATOR + data.a.ToString();
|
|
}
|
|
|
|
public static string Matrix3x3ToString( Matrix4x4 matrix )
|
|
{
|
|
return matrix[ 0, 0 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 0, 1 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 0, 2 ].ToString() + IOUtils.VECTOR_SEPARATOR +
|
|
matrix[ 1, 0 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 1, 1 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 1, 2 ].ToString() + IOUtils.VECTOR_SEPARATOR +
|
|
matrix[ 2, 0 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 2, 1 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 2, 2 ].ToString();
|
|
}
|
|
|
|
public static string Matrix4x4ToString( Matrix4x4 matrix )
|
|
{
|
|
return matrix[ 0, 0 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 0, 1 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 0, 2 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 0, 3 ].ToString() + IOUtils.VECTOR_SEPARATOR +
|
|
matrix[ 1, 0 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 1, 1 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 1, 2 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 1, 3 ].ToString() + IOUtils.VECTOR_SEPARATOR +
|
|
matrix[ 2, 0 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 2, 1 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 2, 2 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 2, 3 ].ToString() + IOUtils.VECTOR_SEPARATOR +
|
|
matrix[ 3, 0 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 3, 1 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 3, 2 ].ToString() + IOUtils.VECTOR_SEPARATOR + matrix[ 3, 3 ].ToString();
|
|
}
|
|
|
|
public static Vector2 StringToVector2( string data )
|
|
{
|
|
string[] parsedData = data.Split( VECTOR_SEPARATOR );
|
|
if ( parsedData.Length >= 2 )
|
|
{
|
|
return new Vector2( Convert.ToSingle( parsedData[ 0 ] ),
|
|
Convert.ToSingle( parsedData[ 1 ] ) );
|
|
}
|
|
return Vector2.zero;
|
|
}
|
|
|
|
public static Vector3 StringToVector3( string data )
|
|
{
|
|
string[] parsedData = data.Split( VECTOR_SEPARATOR );
|
|
if ( parsedData.Length >= 3 )
|
|
{
|
|
return new Vector3( Convert.ToSingle( parsedData[ 0 ] ),
|
|
Convert.ToSingle( parsedData[ 1 ] ),
|
|
Convert.ToSingle( parsedData[ 2 ] ) );
|
|
}
|
|
return Vector3.zero;
|
|
}
|
|
|
|
public static Vector4 StringToVector4( string data )
|
|
{
|
|
string[] parsedData = data.Split( VECTOR_SEPARATOR );
|
|
if ( parsedData.Length >= 4 )
|
|
{
|
|
return new Vector4( Convert.ToSingle( parsedData[ 0 ] ),
|
|
Convert.ToSingle( parsedData[ 1 ] ),
|
|
Convert.ToSingle( parsedData[ 2 ] ),
|
|
Convert.ToSingle( parsedData[ 3 ] ) );
|
|
}
|
|
return Vector4.zero;
|
|
}
|
|
|
|
public static Color StringToColor( string data )
|
|
{
|
|
string[] parsedData = data.Split( VECTOR_SEPARATOR );
|
|
if ( parsedData.Length >= 4 )
|
|
{
|
|
return new Color( Convert.ToSingle( parsedData[ 0 ] ),
|
|
Convert.ToSingle( parsedData[ 1 ] ),
|
|
Convert.ToSingle( parsedData[ 2 ] ),
|
|
Convert.ToSingle( parsedData[ 3 ] ) );
|
|
}
|
|
return Color.white;
|
|
}
|
|
|
|
public static Matrix4x4 StringToMatrix3x3( string data )
|
|
{
|
|
string[] parsedData = data.Split( VECTOR_SEPARATOR );
|
|
if ( parsedData.Length == 9 )
|
|
{
|
|
Matrix4x4 matrix = new Matrix4x4();
|
|
matrix[ 0, 0 ] = Convert.ToSingle( parsedData[ 0 ] );
|
|
matrix[ 0, 1 ] = Convert.ToSingle( parsedData[ 1 ] );
|
|
matrix[ 0, 2 ] = Convert.ToSingle( parsedData[ 2 ] );
|
|
|
|
matrix[ 1, 0 ] = Convert.ToSingle( parsedData[ 3 ] );
|
|
matrix[ 1, 1 ] = Convert.ToSingle( parsedData[ 4 ] );
|
|
matrix[ 1, 2 ] = Convert.ToSingle( parsedData[ 5 ] );
|
|
|
|
matrix[ 2, 0 ] = Convert.ToSingle( parsedData[ 6 ] );
|
|
matrix[ 2, 1 ] = Convert.ToSingle( parsedData[ 7 ] );
|
|
matrix[ 2, 2 ] = Convert.ToSingle( parsedData[ 8 ] );
|
|
return matrix;
|
|
}
|
|
return Matrix4x4.identity;
|
|
}
|
|
|
|
public static Matrix4x4 StringToMatrix4x4( string data )
|
|
{
|
|
string[] parsedData = data.Split( VECTOR_SEPARATOR );
|
|
if ( parsedData.Length == 16 )
|
|
{
|
|
Matrix4x4 matrix = new Matrix4x4();
|
|
matrix[ 0, 0 ] = Convert.ToSingle( parsedData[ 0 ] );
|
|
matrix[ 0, 1 ] = Convert.ToSingle( parsedData[ 1 ] );
|
|
matrix[ 0, 2 ] = Convert.ToSingle( parsedData[ 2 ] );
|
|
matrix[ 0, 3 ] = Convert.ToSingle( parsedData[ 3 ] );
|
|
|
|
matrix[ 1, 0 ] = Convert.ToSingle( parsedData[ 4 ] );
|
|
matrix[ 1, 1 ] = Convert.ToSingle( parsedData[ 5 ] );
|
|
matrix[ 1, 2 ] = Convert.ToSingle( parsedData[ 6 ] );
|
|
matrix[ 1, 3 ] = Convert.ToSingle( parsedData[ 7 ] );
|
|
|
|
matrix[ 2, 0 ] = Convert.ToSingle( parsedData[ 8 ] );
|
|
matrix[ 2, 1 ] = Convert.ToSingle( parsedData[ 9 ] );
|
|
matrix[ 2, 2 ] = Convert.ToSingle( parsedData[ 10 ] );
|
|
matrix[ 2, 3 ] = Convert.ToSingle( parsedData[ 11 ] );
|
|
|
|
matrix[ 3, 0 ] = Convert.ToSingle( parsedData[ 12 ] );
|
|
matrix[ 3, 1 ] = Convert.ToSingle( parsedData[ 13 ] );
|
|
matrix[ 3, 2 ] = Convert.ToSingle( parsedData[ 14 ] );
|
|
matrix[ 3, 3 ] = Convert.ToSingle( parsedData[ 15 ] );
|
|
return matrix;
|
|
}
|
|
return Matrix4x4.identity;
|
|
}
|
|
|
|
public static void SaveTextureToDisk( Texture2D tex, string pathname )
|
|
{
|
|
byte[] rawData = tex.GetRawTextureData();
|
|
Texture2D newTex = new Texture2D( tex.width, tex.height, tex.format, tex.mipmapCount > 1, false );
|
|
newTex.LoadRawTextureData( rawData );
|
|
newTex.Apply();
|
|
byte[] pngData = newTex.EncodeToPNG();
|
|
File.WriteAllBytes( pathname, pngData );
|
|
}
|
|
|
|
//public static void SaveObjToList( string newObj )
|
|
//{
|
|
// Debug.Log( UIUtils.CurrentWindow.Lastpath );
|
|
// UIUtils.CurrentWindow.Lastpath = newObj;
|
|
// string lastOpenedObj = EditorPrefs.GetString( IOUtils.LAST_OPENED_OBJ_ID );
|
|
// string[] allLocations = lastOpenedObj.Split( ':' );
|
|
|
|
// string lastLocation = allLocations[ allLocations.Length - 1 ];
|
|
|
|
// string resave = string.Empty;
|
|
// for ( int i = 0; i < allLocations.Length; i++ )
|
|
// {
|
|
// if ( string.IsNullOrEmpty( allLocations[ i ] ) )
|
|
// continue;
|
|
|
|
// resave += allLocations[ i ];
|
|
// resave += ":";
|
|
// }
|
|
|
|
// resave += newObj;
|
|
// EditorPrefs.SetString( IOUtils.LAST_OPENED_OBJ_ID, resave );
|
|
//}
|
|
|
|
//public static void DeleteObjFromList( string newObj )
|
|
//{
|
|
// string lastOpenedObj = EditorPrefs.GetString( IOUtils.LAST_OPENED_OBJ_ID );
|
|
// string[] allLocations = lastOpenedObj.Split( ':' );
|
|
|
|
// string resave = string.Empty;
|
|
// for ( int i = 0; i < allLocations.Length; i++ )
|
|
// {
|
|
// if ( string.IsNullOrEmpty( allLocations[ i ] ) || newObj.Equals( allLocations[ i ] ) )
|
|
// continue;
|
|
|
|
// resave += allLocations[ i ];
|
|
// if ( i < allLocations.Length - 1 )
|
|
// resave += ":";
|
|
// }
|
|
|
|
// EditorPrefs.SetString( IOUtils.LAST_OPENED_OBJ_ID, resave );
|
|
//}
|
|
}
|
|
}
|