Compare commits
2 Commits
d01e2cde13
...
3881ae8232
| Author | SHA1 | Date | |
|---|---|---|---|
| 3881ae8232 | |||
| 5510c1f3fe |
128
Assets/Scenes/MAIN.unity
Normal file
128
Assets/Scenes/MAIN.unity
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!29 &1
|
||||||
|
OcclusionCullingSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_OcclusionBakeSettings:
|
||||||
|
smallestOccluder: 5
|
||||||
|
smallestHole: 0.25
|
||||||
|
backfaceThreshold: 100
|
||||||
|
m_SceneGUID: 00000000000000000000000000000000
|
||||||
|
m_OcclusionCullingData: {fileID: 0}
|
||||||
|
--- !u!104 &2
|
||||||
|
RenderSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 9
|
||||||
|
m_Fog: 0
|
||||||
|
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||||
|
m_FogMode: 3
|
||||||
|
m_FogDensity: 0.01
|
||||||
|
m_LinearFogStart: 0
|
||||||
|
m_LinearFogEnd: 300
|
||||||
|
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||||
|
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||||
|
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||||
|
m_AmbientIntensity: 1
|
||||||
|
m_AmbientMode: 0
|
||||||
|
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||||
|
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_HaloStrength: 0.5
|
||||||
|
m_FlareStrength: 1
|
||||||
|
m_FlareFadeSpeed: 3
|
||||||
|
m_HaloTexture: {fileID: 0}
|
||||||
|
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
m_DefaultReflectionMode: 0
|
||||||
|
m_DefaultReflectionResolution: 128
|
||||||
|
m_ReflectionBounces: 1
|
||||||
|
m_ReflectionIntensity: 1
|
||||||
|
m_CustomReflection: {fileID: 0}
|
||||||
|
m_Sun: {fileID: 0}
|
||||||
|
m_UseRadianceAmbientProbe: 0
|
||||||
|
--- !u!157 &3
|
||||||
|
LightmapSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 12
|
||||||
|
m_GIWorkflowMode: 1
|
||||||
|
m_GISettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_BounceScale: 1
|
||||||
|
m_IndirectOutputScale: 1
|
||||||
|
m_AlbedoBoost: 1
|
||||||
|
m_EnvironmentLightingMode: 0
|
||||||
|
m_EnableBakedLightmaps: 1
|
||||||
|
m_EnableRealtimeLightmaps: 0
|
||||||
|
m_LightmapEditorSettings:
|
||||||
|
serializedVersion: 12
|
||||||
|
m_Resolution: 2
|
||||||
|
m_BakeResolution: 40
|
||||||
|
m_AtlasSize: 1024
|
||||||
|
m_AO: 0
|
||||||
|
m_AOMaxDistance: 1
|
||||||
|
m_CompAOExponent: 1
|
||||||
|
m_CompAOExponentDirect: 0
|
||||||
|
m_ExtractAmbientOcclusion: 0
|
||||||
|
m_Padding: 2
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_LightmapsBakeMode: 1
|
||||||
|
m_TextureCompression: 1
|
||||||
|
m_FinalGather: 0
|
||||||
|
m_FinalGatherFiltering: 1
|
||||||
|
m_FinalGatherRayCount: 256
|
||||||
|
m_ReflectionCompression: 2
|
||||||
|
m_MixedBakeMode: 2
|
||||||
|
m_BakeBackend: 1
|
||||||
|
m_PVRSampling: 1
|
||||||
|
m_PVRDirectSampleCount: 32
|
||||||
|
m_PVRSampleCount: 512
|
||||||
|
m_PVRBounces: 2
|
||||||
|
m_PVREnvironmentSampleCount: 256
|
||||||
|
m_PVREnvironmentReferencePointCount: 2048
|
||||||
|
m_PVRFilteringMode: 1
|
||||||
|
m_PVRDenoiserTypeDirect: 1
|
||||||
|
m_PVRDenoiserTypeIndirect: 1
|
||||||
|
m_PVRDenoiserTypeAO: 1
|
||||||
|
m_PVRFilterTypeDirect: 0
|
||||||
|
m_PVRFilterTypeIndirect: 0
|
||||||
|
m_PVRFilterTypeAO: 0
|
||||||
|
m_PVREnvironmentMIS: 1
|
||||||
|
m_PVRCulling: 1
|
||||||
|
m_PVRFilteringGaussRadiusDirect: 1
|
||||||
|
m_PVRFilteringGaussRadiusIndirect: 5
|
||||||
|
m_PVRFilteringGaussRadiusAO: 2
|
||||||
|
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||||
|
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||||
|
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||||
|
m_ExportTrainingData: 0
|
||||||
|
m_TrainingDataDestination: TrainingData
|
||||||
|
m_LightProbeSampleCountMultiplier: 4
|
||||||
|
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_LightingSettings: {fileID: 0}
|
||||||
|
--- !u!196 &4
|
||||||
|
NavMeshSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_BuildSettings:
|
||||||
|
serializedVersion: 3
|
||||||
|
agentTypeID: 0
|
||||||
|
agentRadius: 0.5
|
||||||
|
agentHeight: 2
|
||||||
|
agentSlope: 45
|
||||||
|
agentClimb: 0.4
|
||||||
|
ledgeDropHeight: 0
|
||||||
|
maxJumpAcrossDistance: 0
|
||||||
|
minRegionArea: 2
|
||||||
|
manualCellSize: 0
|
||||||
|
cellSize: 0.16666667
|
||||||
|
manualTileSize: 0
|
||||||
|
tileSize: 256
|
||||||
|
buildHeightMesh: 0
|
||||||
|
maxJobWorkers: 0
|
||||||
|
preserveTilesOutsideBounds: 0
|
||||||
|
debug:
|
||||||
|
m_Flags: 0
|
||||||
|
m_NavMeshData: {fileID: 0}
|
||||||
|
--- !u!1660057539 &9223372036854775807
|
||||||
|
SceneRoots:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_Roots: []
|
||||||
File diff suppressed because it is too large
Load Diff
@ -126,6 +126,11 @@ namespace VersionFlow.Editors
|
|||||||
EditorUtility.SetDirty(target);
|
EditorUtility.SetDirty(target);
|
||||||
patchLoader.CfgChanged(builder, builder.UploaderCfgDict.GetUploaderCfg(patchLoader.GetType()));
|
patchLoader.CfgChanged(builder, builder.UploaderCfgDict.GetUploaderCfg(patchLoader.GetType()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!patchLoader.Status)
|
||||||
|
{
|
||||||
|
EditorGUILayout.HelpBox(patchLoader.Status, MessageType.Error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawGroupItems()
|
private void DrawGroupItems()
|
||||||
|
|||||||
93
Assets/VersionFlow/Editor/MsgBool.cs
Normal file
93
Assets/VersionFlow/Editor/MsgBool.cs
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
namespace VersionFlow.Editors
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// String和Bool的缝合怪
|
||||||
|
/// </summary>
|
||||||
|
public struct MsgBool
|
||||||
|
{
|
||||||
|
public string ErrorMsg;
|
||||||
|
public bool Value;
|
||||||
|
|
||||||
|
public override readonly string ToString()
|
||||||
|
{
|
||||||
|
if (Value)
|
||||||
|
{
|
||||||
|
return true.ToString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ErrorMsg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static implicit operator MsgBool(string errorMsg)
|
||||||
|
{
|
||||||
|
return new MsgBool { Value = false, ErrorMsg = errorMsg };
|
||||||
|
}
|
||||||
|
|
||||||
|
public static implicit operator MsgBool(bool value)
|
||||||
|
{
|
||||||
|
return new MsgBool { Value = value };
|
||||||
|
}
|
||||||
|
|
||||||
|
public static implicit operator bool(MsgBool msgBool)
|
||||||
|
{
|
||||||
|
return msgBool.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static implicit operator (bool, string)(MsgBool msgBool)
|
||||||
|
{
|
||||||
|
return (msgBool.Value, msgBool.ErrorMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static implicit operator string(MsgBool msgBool)
|
||||||
|
{
|
||||||
|
return msgBool.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public struct MsgBool<T>
|
||||||
|
{
|
||||||
|
public string ErrorMsg;
|
||||||
|
public bool Value;
|
||||||
|
public T Result;
|
||||||
|
|
||||||
|
public override readonly string ToString()
|
||||||
|
{
|
||||||
|
if (Value)
|
||||||
|
{
|
||||||
|
if (Result != null) return Result.ToString();
|
||||||
|
return true.ToString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ErrorMsg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static implicit operator MsgBool<T>(string errorMsg)
|
||||||
|
{
|
||||||
|
return new MsgBool<T> { Value = false, ErrorMsg = errorMsg };
|
||||||
|
}
|
||||||
|
|
||||||
|
public static implicit operator MsgBool<T>(bool value)
|
||||||
|
{
|
||||||
|
return new MsgBool<T> { Value = value };
|
||||||
|
}
|
||||||
|
|
||||||
|
public static implicit operator MsgBool<T>(T result)
|
||||||
|
{
|
||||||
|
return new MsgBool<T> { Value = true, Result = result };
|
||||||
|
}
|
||||||
|
|
||||||
|
public static implicit operator bool(MsgBool<T> msgBool)
|
||||||
|
{
|
||||||
|
return msgBool.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static implicit operator string(MsgBool<T> msgBool)
|
||||||
|
{
|
||||||
|
return msgBool.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/VersionFlow/Editor/MsgBool.cs.meta
Normal file
11
Assets/VersionFlow/Editor/MsgBool.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d23328d75cc93354ea1a595833f504a2
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -7,6 +7,7 @@ namespace VersionFlow.Editors
|
|||||||
{
|
{
|
||||||
public abstract class PatchUploader : ScriptableObject
|
public abstract class PatchUploader : ScriptableObject
|
||||||
{
|
{
|
||||||
|
public abstract MsgBool Status { get; }
|
||||||
public PatchUploader() { }
|
public PatchUploader() { }
|
||||||
public abstract void CfgChanged(BuilderConfig builder, string cfgJson);
|
public abstract void CfgChanged(BuilderConfig builder, string cfgJson);
|
||||||
public abstract void UploadFile(string remoteFilePath, MemoryStream localfileStream);
|
public abstract void UploadFile(string remoteFilePath, MemoryStream localfileStream);
|
||||||
@ -21,17 +22,20 @@ namespace VersionFlow.Editors
|
|||||||
[SerializeField]
|
[SerializeField]
|
||||||
protected CONFIG m_cfg;
|
protected CONFIG m_cfg;
|
||||||
|
|
||||||
|
MsgBool m_status;
|
||||||
|
public override MsgBool Status => m_status;
|
||||||
|
|
||||||
public sealed override void CfgChanged(BuilderConfig builder, string cfgJson)
|
public sealed override void CfgChanged(BuilderConfig builder, string cfgJson)
|
||||||
{
|
{
|
||||||
m_builder = builder;
|
m_builder = builder;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
m_cfg = JsonUtility.FromJson<CONFIG>(cfgJson);
|
m_cfg = JsonUtility.FromJson<CONFIG>(cfgJson);
|
||||||
OnCfgChanged();
|
m_status = OnCfgChanged();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.LogError(ex);
|
m_status = ex.Message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,6 +44,6 @@ namespace VersionFlow.Editors
|
|||||||
return JsonUtility.ToJson(m_cfg);
|
return JsonUtility.ToJson(m_cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void OnCfgChanged();
|
protected abstract MsgBool OnCfgChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -23,17 +23,20 @@ namespace VersionFlow.Editors
|
|||||||
private OssClient m_ossClient;
|
private OssClient m_ossClient;
|
||||||
private Client m_cdnClient;
|
private Client m_cdnClient;
|
||||||
|
|
||||||
protected override void OnCfgChanged()
|
protected override MsgBool OnCfgChanged()
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(m_cfg.BucketName)) return "BucketName无效";
|
||||||
|
if (string.IsNullOrWhiteSpace(m_cfg.UploadPath)) return "UploadPath无效";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
m_ossClient = new OssClient(m_cfg.endPoint, m_cfg.accessKeyId, m_cfg.accessKeySecret);
|
m_ossClient = new OssClient(m_cfg.endPoint, m_cfg.accessKeyId, m_cfg.accessKeySecret);
|
||||||
m_cdnClient = new Client(new AlibabaCloud.OpenApiClient.Models.Config { AccessKeyId = m_cfg.accessKeyId, AccessKeySecret = m_cfg.accessKeySecret });
|
m_cdnClient = new Client(new AlibabaCloud.OpenApiClient.Models.Config { AccessKeyId = m_cfg.accessKeyId, AccessKeySecret = m_cfg.accessKeySecret });
|
||||||
Debug.Log("AliOSS SDK 初始化成功");
|
return true;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
Debug.LogError("AliOSS SDK 初始化失败,请检查相关参数配置");
|
return "AliOSS SDK 初始化失败,请检查相关参数配置";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,10 @@ namespace VersionFlow.Editors
|
|||||||
[Description("本地文件系统")]
|
[Description("本地文件系统")]
|
||||||
public class PatchUploader_LocalFileSystem : PatchUploader<PatchUploader_LocalFileSystem.Config>, IAsyncDownloader
|
public class PatchUploader_LocalFileSystem : PatchUploader<PatchUploader_LocalFileSystem.Config>, IAsyncDownloader
|
||||||
{
|
{
|
||||||
protected override void OnCfgChanged() { }
|
protected override MsgBool OnCfgChanged()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public override void UploadFile(string remoteFilePath, MemoryStream localfileStream)
|
public override void UploadFile(string remoteFilePath, MemoryStream localfileStream)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using UnityEditor;
|
using System;
|
||||||
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using VersionFlow.Runtime;
|
using VersionFlow.Runtime;
|
||||||
|
|
||||||
@ -32,23 +33,42 @@ namespace VersionFlow.Editors
|
|||||||
private void OnGUI()
|
private void OnGUI()
|
||||||
{
|
{
|
||||||
EditorGUILayout.BeginHorizontal();
|
EditorGUILayout.BeginHorizontal();
|
||||||
if (GUILayout.Toggle(m_currentEditor == m_builderEditor, "上传设置", GUI.skin.button))
|
|
||||||
{
|
{
|
||||||
m_currentEditor = m_builderEditor;
|
EditorGUILayout.BeginVertical(GUILayout.Width(200));
|
||||||
}
|
|
||||||
if (GUILayout.Toggle(m_currentEditor == m_settingEditor, "运行时设置", GUI.skin.button))
|
|
||||||
{
|
{
|
||||||
m_currentEditor = m_settingEditor;
|
DrawEditorTabRegion();
|
||||||
}
|
}
|
||||||
EditorGUILayout.EndVertical();
|
EditorGUILayout.EndVertical();
|
||||||
|
|
||||||
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
|
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
|
||||||
{
|
{
|
||||||
m_builderEditorScroll = EditorGUILayout.BeginScrollView(m_builderEditorScroll);
|
m_builderEditorScroll = EditorGUILayout.BeginScrollView(m_builderEditorScroll);
|
||||||
m_currentEditor.OnInspectorGUI();
|
DrawSelectEditor();
|
||||||
EditorGUILayout.EndScrollView();
|
EditorGUILayout.EndScrollView();
|
||||||
}
|
}
|
||||||
EditorGUILayout.EndVertical();
|
EditorGUILayout.EndVertical();
|
||||||
}
|
}
|
||||||
|
EditorGUILayout.EndHorizontal();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DrawSelectEditor()
|
||||||
|
{
|
||||||
|
m_currentEditor.OnInspectorGUI();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DrawEditorTabRegion()
|
||||||
|
{
|
||||||
|
DrawEditorTabItem(m_builderEditor, "上传设置");
|
||||||
|
DrawEditorTabItem(m_settingEditor, "运行时设置");
|
||||||
|
|
||||||
|
void DrawEditorTabItem(Editor targetEditor, string name)
|
||||||
|
{
|
||||||
|
if (GUILayout.Toggle(m_currentEditor == targetEditor, name, new GUIStyle(GUI.skin.button) { margin = new RectOffset() }, GUILayout.Height(40)))
|
||||||
|
{
|
||||||
|
m_currentEditor = targetEditor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user