496 lines
18 KiB
C#
Raw Normal View History

Squashed commit of the following: 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
2021-12-22 10:01:30 +08:00
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
using UnityEngine;
using UnityEditor;
using System;
using UnityEngine.Networking;
using System.Collections;
namespace AmplifyShaderEditor
{
public class ASEStartScreen : EditorWindow
{
[MenuItem( "Window/Amplify Shader Editor/Start Screen", false, 1999 )]
public static void Init()
{
ASEStartScreen window = (ASEStartScreen)GetWindow( typeof( ASEStartScreen ), true, "Amplify Shader Editor Start Screen" );
window.minSize = new Vector2( 650, 500 );
window.maxSize = new Vector2( 650, 500 );
window.Show();
}
private static readonly string ChangeLogGUID = "580cccd3e608b7f4cac35ea46d62d429";
private static readonly string ResourcesGUID = "c0a0a980c9ba86345bc15411db88d34f";
private static readonly string BuiltInGUID = "e00e6f90ab8233e46a41c5e33917c642";
private static readonly string UniversalGUID = "a9d68dd8913f05d4d9ce75e7b40c6044";
private static readonly string HighDefinitionGUID = "d1c0b77896049554fa4b635531caf741";
private static readonly string OLDHighDefinitionGUID = "dff05fea7446d7b4e9029bfab77455d2";
private static readonly string LightWeightGUID = "6ecbfd0a046659943a69328c98ff0442";
private static readonly string OLDLightWeightGUID = "f7c4e22642de60d448f4e4809190f7b1";
private static readonly string IconGUID = "2c6536772776dd84f872779990273bfc";
public static readonly string ChangelogURL = "http://amplify.pt/Banner/ASEchangelog.json";
private static readonly string ManualURL = "http://wiki.amplify.pt/index.php?title=Unity_Products:Amplify_Shader_Editor/Manual";
private static readonly string BasicURL = "http://wiki.amplify.pt/index.php?title=Unity_Products:Amplify_Shader_Editor/Tutorials#Official_-_Basics";
private static readonly string BeginnerURL = "http://wiki.amplify.pt/index.php?title=Unity_Products:Amplify_Shader_Editor/Tutorials#Official_-_Beginner_Series";
private static readonly string NodesURL = "http://wiki.amplify.pt/index.php?title=Unity_Products:Amplify_Shader_Editor/Nodes";
private static readonly string SRPURL = "http://wiki.amplify.pt/index.php?title=Unity_Products:Amplify_Shader_Editor/Scriptable_Rendering_Pipeline";
private static readonly string FunctionsURL = "http://wiki.amplify.pt/index.php?title=Unity_Products:Amplify_Shader_Editor/Manual#Shader_Functions";
private static readonly string TemplatesURL = "http://wiki.amplify.pt/index.php?title=Unity_Products:Amplify_Shader_Editor/Templates";
private static readonly string APIURL = "http://wiki.amplify.pt/index.php?title=Unity_Products:Amplify_Shader_Editor/API";
private static readonly string DiscordURL = "https://discordapp.com/invite/EdrVAP5";
private static readonly string ForumURL = "https://forum.unity.com/threads/best-tool-asset-store-award-amplify-shader-editor-node-based-shader-creation-tool.430959/";
private static readonly string SiteURL = "http://amplify.pt/download/";
private static readonly string StoreURL = "https://assetstore.unity.com/packages/tools/visual-scripting/amplify-shader-editor-68570";
private static readonly GUIContent SamplesTitle = new GUIContent( "Shader Samples", "Import samples according to you project rendering pipeline" );
private static readonly GUIContent ResourcesTitle = new GUIContent( "Learning Resources", "Check the online wiki for various topics about how to use ASE with node examples and explanations" );
private static readonly GUIContent CommunityTitle = new GUIContent( "Community", "Need help? Reach us through our discord server or the offitial support Unity forum" );
private static readonly GUIContent UpdateTitle = new GUIContent( "Latest Update", "Check the lastest additions, improvements and bug fixes done to ASE" );
private static readonly GUIContent ASETitle = new GUIContent( "Amplify Shader Editor", "Are you using the latest version? Now you know" );
private static readonly string DownArrow = "\u25BC";
#if UNITY_2019_3_OR_NEWER
private int DownButtonSize = 22;
#else
private int DownButtonSize = 21;
#endif
Vector2 m_scrollPosition = Vector2.zero;
Preferences.ShowOption m_startup = Preferences.ShowOption.Never;
bool m_showLWRP = false;
bool m_showHDRP = false;
[NonSerialized]
Texture packageIcon = null;
[NonSerialized]
Texture textIcon = null;
[NonSerialized]
Texture webIcon = null;
GUIContent HDRPbutton = null;
GUIContent HDRPOLDbutton = null;
GUIContent URPbutton = null;
GUIContent LWRPbutton = null;
GUIContent LWRPOLDbutton = null;
GUIContent BuiltInbutton = null;
GUIContent Manualbutton = null;
GUIContent Basicbutton = null;
GUIContent Beginnerbutton = null;
GUIContent Nodesbutton = null;
GUIContent SRPusebutton = null;
GUIContent Functionsbutton = null;
GUIContent Templatesbutton = null;
GUIContent APIbutton = null;
GUIContent DiscordButton = null;
GUIContent ForumButton = null;
GUIContent ASEIcon = null;
RenderTexture rt;
[NonSerialized]
GUIStyle m_buttonStyle = null;
[NonSerialized]
GUIStyle m_buttonLeftStyle = null;
[NonSerialized]
GUIStyle m_buttonRightStyle = null;
[NonSerialized]
GUIStyle m_minibuttonStyle = null;
[NonSerialized]
GUIStyle m_labelStyle = null;
[NonSerialized]
GUIStyle m_linkStyle = null;
private ChangeLogInfo m_changeLog;
private bool m_infoDownloaded = false;
private string m_newVersion = string.Empty;
private void OnEnable()
{
rt = new RenderTexture( 16, 16, 0 );
rt.Create();
m_startup = (Preferences.ShowOption)EditorPrefs.GetInt( Preferences.PrefStartUp, 0 );
if( textIcon == null )
{
Texture icon = EditorGUIUtility.IconContent( "TextAsset Icon" ).image;
var cache = RenderTexture.active;
RenderTexture.active = rt;
Graphics.Blit( icon, rt );
RenderTexture.active = cache;
textIcon = rt;
Manualbutton = new GUIContent( " Manual", textIcon );
Basicbutton = new GUIContent( " Basic use tutorials", textIcon );
Beginnerbutton = new GUIContent( " Beginner Series", textIcon );
Nodesbutton = new GUIContent( " Node List", textIcon );
SRPusebutton = new GUIContent( " SRP HD/URP/LW use", textIcon );
Functionsbutton = new GUIContent( " Shader Functions", textIcon );
Templatesbutton = new GUIContent( " Shader Templates", textIcon );
APIbutton = new GUIContent( " Node API", textIcon );
}
if( packageIcon == null )
{
packageIcon = EditorGUIUtility.IconContent( "BuildSettings.Editor.Small" ).image;
HDRPbutton = new GUIContent( " HDRP Samples", packageIcon );
HDRPOLDbutton = new GUIContent( " HDRP Samples 6.X.X", packageIcon );
URPbutton = new GUIContent( " URP Samples", packageIcon );
LWRPbutton = new GUIContent( " LWRP Samples 6.X.X", packageIcon );
LWRPOLDbutton = new GUIContent( " LWRP Samples 3.X.X", packageIcon );
BuiltInbutton = new GUIContent( " Built-In Samples", packageIcon );
}
if( webIcon == null )
{
webIcon = EditorGUIUtility.IconContent( "BuildSettings.Web.Small" ).image;
DiscordButton = new GUIContent( " Discord", webIcon );
ForumButton = new GUIContent( " Unity Forum", webIcon );
}
if( m_changeLog == null )
{
var changelog = AssetDatabase.LoadAssetAtPath<TextAsset>( AssetDatabase.GUIDToAssetPath( ChangeLogGUID ) );
string lastUpdate = string.Empty;
if(changelog != null )
{
lastUpdate = changelog.text.Substring( 0, changelog.text.IndexOf( "\nv", 50 ) );// + "\n...";
lastUpdate = lastUpdate.Replace( " *", " \u25CB" );
lastUpdate = lastUpdate.Replace( "* ", "\u2022 " );
}
m_changeLog = new ChangeLogInfo( VersionInfo.FullNumber, lastUpdate );
}
if( ASEIcon == null )
{
ASEIcon = new GUIContent( AssetDatabase.LoadAssetAtPath<Texture2D>( AssetDatabase.GUIDToAssetPath( IconGUID ) ) );
}
}
private void OnDisable()
{
if( rt != null )
{
rt.Release();
DestroyImmediate( rt );
}
}
public void OnGUI()
{
if( !m_infoDownloaded )
{
m_infoDownloaded = true;
StartBackgroundTask( StartRequest( ChangelogURL, () =>
{
var temp = ChangeLogInfo.CreateFromJSON( www.downloadHandler.text );
if( temp != null && temp.Version >= m_changeLog.Version )
{
m_changeLog = temp;
}
// improve this later
int major = m_changeLog.Version / 10000;
int minor = ( m_changeLog.Version / 1000 ) - major * 10;
int release = ( m_changeLog.Version / 100 ) - major * 100 - minor * 10;
int revision = ( ( m_changeLog.Version / 10 ) - major * 1000 - minor * 100 - release * 10 ) + ( m_changeLog.Version - major * 10000 - minor * 1000 - release * 100 );
m_newVersion = major + "." + minor + "." + release + "r" + revision;
Repaint();
} ) );
}
if( m_buttonStyle == null )
{
m_buttonStyle = new GUIStyle( GUI.skin.button );
m_buttonStyle.alignment = TextAnchor.MiddleLeft;
}
if( m_buttonLeftStyle == null )
{
m_buttonLeftStyle = new GUIStyle( "ButtonLeft" );
m_buttonLeftStyle.alignment = TextAnchor.MiddleLeft;
m_buttonLeftStyle.margin = m_buttonStyle.margin;
m_buttonLeftStyle.margin.right = 0;
}
if( m_buttonRightStyle == null )
{
m_buttonRightStyle = new GUIStyle( "ButtonRight" );
m_buttonRightStyle.alignment = TextAnchor.MiddleLeft;
m_buttonRightStyle.margin = m_buttonStyle.margin;
m_buttonRightStyle.margin.left = 0;
}
if( m_minibuttonStyle == null )
{
m_minibuttonStyle = new GUIStyle( "MiniButton" );
m_minibuttonStyle.alignment = TextAnchor.MiddleLeft;
m_minibuttonStyle.margin = m_buttonStyle.margin;
m_minibuttonStyle.margin.left = 20;
m_minibuttonStyle.normal.textColor = m_buttonStyle.normal.textColor;
m_minibuttonStyle.hover.textColor = m_buttonStyle.hover.textColor;
}
if( m_labelStyle == null )
{
m_labelStyle = new GUIStyle( "BoldLabel" );
m_labelStyle.margin = new RectOffset( 4, 4, 4, 4 );
m_labelStyle.padding = new RectOffset( 2, 2, 2, 2 );
m_labelStyle.fontSize = 13;
}
if( m_linkStyle == null )
{
var inv = AssetDatabase.LoadAssetAtPath<Texture2D>( AssetDatabase.GUIDToAssetPath( "1004d06b4b28f5943abdf2313a22790a" ) ); // find a better solution for transparent buttons
m_linkStyle = new GUIStyle();
m_linkStyle.normal.textColor = new Color( 0.2980392f, 0.4901961f, 1f );
m_linkStyle.hover.textColor = Color.white;
m_linkStyle.active.textColor = Color.grey;
m_linkStyle.margin.top = 3;
m_linkStyle.margin.bottom = 2;
m_linkStyle.hover.background = inv;
m_linkStyle.active.background = inv;
}
EditorGUILayout.BeginHorizontal( GUIStyle.none, GUILayout.ExpandWidth( true ) );
{
// left column
EditorGUILayout.BeginVertical( GUILayout.Width( 175 ) );
{
GUILayout.Label( SamplesTitle, m_labelStyle );
EditorGUILayout.BeginHorizontal();
if( GUILayout.Button( HDRPbutton, m_buttonLeftStyle ) )
ImportSample( HDRPbutton.text, HighDefinitionGUID );
if( GUILayout.Button( DownArrow, m_buttonRightStyle, GUILayout.Width( DownButtonSize ), GUILayout.Height( DownButtonSize ) ) )
{
m_showHDRP = !m_showHDRP;
m_showLWRP = false;
}
EditorGUILayout.EndHorizontal();
if( m_showHDRP )
{
if( GUILayout.Button( HDRPOLDbutton, m_minibuttonStyle ) )
ImportSample( HDRPOLDbutton.text, OLDHighDefinitionGUID );
}
EditorGUILayout.BeginHorizontal();
if( GUILayout.Button( URPbutton, m_buttonLeftStyle ) )
ImportSample( URPbutton.text, UniversalGUID );
if( GUILayout.Button( DownArrow, m_buttonRightStyle, GUILayout.Width( DownButtonSize ), GUILayout.Height( DownButtonSize ) ) )
{
m_showLWRP = !m_showLWRP;
m_showHDRP = false;
}
EditorGUILayout.EndHorizontal();
if( m_showLWRP )
{
EditorGUILayout.BeginVertical();
if( GUILayout.Button( LWRPbutton, m_minibuttonStyle ) )
ImportSample( LWRPbutton.text, LightWeightGUID );
if( GUILayout.Button( LWRPOLDbutton, m_minibuttonStyle ) )
ImportSample( LWRPOLDbutton.text, OLDLightWeightGUID );
EditorGUILayout.EndVertical();
}
if( GUILayout.Button( BuiltInbutton, m_buttonStyle ) )
ImportSample( BuiltInbutton.text, BuiltInGUID );
GUILayout.Space( 10 );
GUILayout.Label( ResourcesTitle, m_labelStyle );
if( GUILayout.Button( Manualbutton, m_buttonStyle ) )
Application.OpenURL( ManualURL );
if( GUILayout.Button( Basicbutton, m_buttonStyle ) )
Application.OpenURL( BasicURL );
if( GUILayout.Button( Beginnerbutton, m_buttonStyle ) )
Application.OpenURL( BeginnerURL );
if( GUILayout.Button( Nodesbutton, m_buttonStyle ) )
Application.OpenURL( NodesURL );
if( GUILayout.Button( SRPusebutton, m_buttonStyle ) )
Application.OpenURL( SRPURL );
if( GUILayout.Button( Functionsbutton, m_buttonStyle ) )
Application.OpenURL( FunctionsURL );
if( GUILayout.Button( Templatesbutton, m_buttonStyle ) )
Application.OpenURL( TemplatesURL );
if( GUILayout.Button( APIbutton, m_buttonStyle ) )
Application.OpenURL( APIURL );
}
EditorGUILayout.EndVertical();
// right column
EditorGUILayout.BeginVertical( GUILayout.Width( 650 - 175 - 9 ), GUILayout.ExpandHeight( true ) );
{
GUILayout.Label( CommunityTitle, m_labelStyle );
EditorGUILayout.BeginHorizontal( GUILayout.ExpandWidth( true ) );
{
if( GUILayout.Button( DiscordButton, GUILayout.ExpandWidth( true ) ) )
{
Application.OpenURL( DiscordURL );
}
if( GUILayout.Button( ForumButton, GUILayout.ExpandWidth( true ) ) )
{
Application.OpenURL( ForumURL );
}
}
EditorGUILayout.EndHorizontal();
GUILayout.Label( UpdateTitle, m_labelStyle );
m_scrollPosition = GUILayout.BeginScrollView( m_scrollPosition, "ProgressBarBack", GUILayout.ExpandHeight( true ), GUILayout.ExpandWidth( true ) );
GUILayout.Label( m_changeLog.LastUpdate, "WordWrappedMiniLabel", GUILayout.ExpandHeight( true ) );
GUILayout.EndScrollView();
EditorGUILayout.BeginHorizontal( GUILayout.ExpandWidth( true ) );
{
EditorGUILayout.BeginVertical();
GUILayout.Label( ASETitle, m_labelStyle );
GUILayout.Label( "Installed Version: " + VersionInfo.StaticToString() );
if( m_changeLog.Version > VersionInfo.FullNumber )
{
var cache = GUI.color;
GUI.color = Color.red;
GUILayout.Label( "New version available: " + m_newVersion, "BoldLabel" );
GUI.color = cache;
}
else
{
var cache = GUI.color;
GUI.color = Color.green;
GUILayout.Label( "You are using the latest version", "BoldLabel" );
GUI.color = cache;
}
EditorGUILayout.BeginHorizontal();
GUILayout.Label( "Download links:" );
if( GUILayout.Button( "Amplify", m_linkStyle ) )
Application.OpenURL( SiteURL );
GUILayout.Label( "-" );
if( GUILayout.Button( "Asset Store", m_linkStyle ) )
Application.OpenURL( StoreURL );
EditorGUILayout.EndHorizontal();
GUILayout.Space( 7 );
EditorGUILayout.EndVertical();
GUILayout.FlexibleSpace();
EditorGUILayout.BeginVertical();
GUILayout.Space( 7 );
GUILayout.Label( ASEIcon );
EditorGUILayout.EndVertical();
}
EditorGUILayout.EndHorizontal();
}
EditorGUILayout.EndVertical();
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.BeginHorizontal( "ProjectBrowserBottomBarBg", GUILayout.ExpandWidth( true ), GUILayout.Height(22) );
{
GUILayout.FlexibleSpace();
EditorGUI.BeginChangeCheck();
var cache = EditorGUIUtility.labelWidth;
EditorGUIUtility.labelWidth = 100;
m_startup = (Preferences.ShowOption)EditorGUILayout.EnumPopup( "Show At Startup", m_startup, GUILayout.Width( 220 ) );
EditorGUIUtility.labelWidth = cache;
if( EditorGUI.EndChangeCheck() )
{
EditorPrefs.SetInt( Preferences.PrefStartUp, (int)m_startup );
}
}
EditorGUILayout.EndHorizontal();
// Find a better way to update link buttons without repainting the window
Repaint();
}
void ImportSample( string pipeline, string guid )
{
if( EditorUtility.DisplayDialog( "Import Sample", "This will import the samples for" + pipeline.Replace( " Samples", "" ) + ", please make sure the pipeline is properly installed and/or selected before importing the samples.\n\nContinue?", "Yes", "No" ) )
{
AssetDatabase.ImportPackage( AssetDatabase.GUIDToAssetPath( ResourcesGUID ), false );
AssetDatabase.ImportPackage( AssetDatabase.GUIDToAssetPath( guid ), false );
}
}
UnityWebRequest www;
IEnumerator StartRequest( string url, Action success = null )
{
using( www = UnityWebRequest.Get( url ) )
{
#if UNITY_2017_2_OR_NEWER
yield return www.SendWebRequest();
#else
yield return www.Send();
#endif
while( www.isDone == false )
yield return null;
if( success != null )
success();
}
}
public static void StartBackgroundTask( IEnumerator update, Action end = null )
{
EditorApplication.CallbackFunction closureCallback = null;
closureCallback = () =>
{
try
{
if( update.MoveNext() == false )
{
if( end != null )
end();
EditorApplication.update -= closureCallback;
}
}
catch( Exception ex )
{
if( end != null )
end();
Debug.LogException( ex );
EditorApplication.update -= closureCallback;
}
};
EditorApplication.update += closureCallback;
}
}
[Serializable]
internal class ChangeLogInfo
{
public int Version;
public string LastUpdate;
public static ChangeLogInfo CreateFromJSON( string jsonString )
{
return JsonUtility.FromJson<ChangeLogInfo>( jsonString );
}
public ChangeLogInfo( int version, string lastUpdate )
{
Version = version;
LastUpdate = lastUpdate;
}
}
}