【m】
@@ -111,7 +111,6 @@ namespace Stary.Evo.Editor
|
||||
|
||||
public static void AddMarkAll(List<OneKeyBuildEntity> oneKeyBUildEntities)
|
||||
{
|
||||
YooAsset.Editor.AssetBundleCollectorSettingData.ClearAll();
|
||||
foreach (var oneKeyBUildEntity in oneKeyBUildEntities)
|
||||
{
|
||||
if (oneKeyBUildEntity.isRaw)
|
||||
@@ -121,6 +120,20 @@ namespace Stary.Evo.Editor
|
||||
DomainConfig domainConfig =
|
||||
AssetDatabase.LoadAssetAtPath<DomainConfig>(configPath);
|
||||
_packageName = domainConfig.domain;
|
||||
// //清空主包旧数据
|
||||
AssetBundleCollectorPackage assetBundleCollectorPackage = null;
|
||||
foreach (var package in AssetBundleCollectorSettingData.Setting.Packages)
|
||||
{
|
||||
if (package.PackageName == _packageName)
|
||||
{
|
||||
assetBundleCollectorPackage = package;
|
||||
}
|
||||
}
|
||||
|
||||
if (assetBundleCollectorPackage != null)
|
||||
{
|
||||
YooAsset.Editor.AssetBundleCollectorSettingData.RemovePackage(assetBundleCollectorPackage);
|
||||
}
|
||||
Mark();
|
||||
|
||||
CreateRes(_packageName,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "com.staryevo.main",
|
||||
"version": "2.0.2",
|
||||
"version": "2.0.3",
|
||||
"displayName": "00.StaryEvo",
|
||||
"description": "This is an Framework package(后台服务器版本,端口9527)",
|
||||
"unity": "2021.3",
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace Stary.Evo
|
||||
|
||||
private async UniTask EDITOR_SIMULATEMODE(ResourcePackage package)
|
||||
{
|
||||
var initParams=YooAssetFileSystem.EditorSimulateInitializeParameter();
|
||||
var initParams=YooAssetFileSystem.EditorSimulateInitializeParameter(package.PackageName);
|
||||
var initialization = package.InitializeAsync(initParams);
|
||||
await initialization;
|
||||
if (initialization.Status == EOperationStatus.Succeed)
|
||||
|
||||
@@ -22,9 +22,9 @@ namespace Stary.Evo
|
||||
initParameters.BuildinFileSystemParameters = buildinFileSystemParams;
|
||||
return initParameters;
|
||||
}
|
||||
public static InitializeParameters EditorSimulateInitializeParameter()
|
||||
public static InitializeParameters EditorSimulateInitializeParameter(string packageName)
|
||||
{
|
||||
var buildResult = EditorSimulateModeHelper.SimulateBuild(AppConfig.PackageDomainName);
|
||||
var buildResult = EditorSimulateModeHelper.SimulateBuild(packageName);
|
||||
var packageRoot = buildResult.PackageRootDirectory;
|
||||
var editorFileSystemParameters = FileSystemParameters.CreateDefaultEditorFileSystemParameters(packageRoot);
|
||||
var initParams = new EditorSimulateModeParameters();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "com.staryevo.tools",
|
||||
"version": "1.0.7",
|
||||
"version": "1.0.8",
|
||||
"displayName": "00.StaryEvo.Tools",
|
||||
"description": "This is an Framework package(后台服务器版本,端口9527)",
|
||||
"unity": "2021.3",
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace Stary.Evo.RKTools
|
||||
[HideInInspector]
|
||||
public Transform trackedTransform;
|
||||
|
||||
public bool isStartTrackedImage=false;
|
||||
public void Awake()
|
||||
{
|
||||
if (trackedTransform == null)
|
||||
@@ -20,15 +21,33 @@ namespace Stary.Evo.RKTools
|
||||
trackedTransform=this.transform;
|
||||
Debug.Log("StaryEvo:TrackedImageEvoObj: trackedTransform 未赋值,以自动赋值为自身");
|
||||
}
|
||||
OnARTrackedImageAdded.AddListener(OnARTrackedImageAddedEvent); ;
|
||||
OnARTrackedImageAdded.AddListener(OnARTrackedImageAddedEvent);
|
||||
OnARTrackedImageUpdated.AddListener(OnARTrackedImageUpdateEvent);
|
||||
OnARTrackedImageRemoved.AddListener(OnARTrackedImageRemovedEvent);
|
||||
}
|
||||
|
||||
private void OnARTrackedImageAddedEvent(ARTrackedImageObj obj)
|
||||
{
|
||||
TrackedImageEvoManager trackedImageEvoManager = ARTrackedImageManager.Instance as TrackedImageEvoManager;
|
||||
trackedImageEvoManager.SetTrackedImageEvoData(trackedImageIndex,domain,trackedTransform);
|
||||
isStartTrackedImage = true;
|
||||
}
|
||||
private void OnARTrackedImageUpdateEvent(ARTrackedImageObj obj)
|
||||
{
|
||||
if (isStartTrackedImage)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
private void OnARTrackedImageRemovedEvent(ARTrackedImageObj obj)
|
||||
{
|
||||
isStartTrackedImage = false;
|
||||
|
||||
}
|
||||
public void OnDestroy()
|
||||
{
|
||||
OnARTrackedImageAdded.RemoveListener(OnARTrackedImageAddedEvent);
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Stary.Evo.RKTools
|
||||
|
||||
private void Start()
|
||||
{
|
||||
//TrackedImages = new List<TarkedImageEvoData>();
|
||||
TrackedImages = new List<TarkedImageEvoData>();
|
||||
}
|
||||
|
||||
public TarkedImageEvoData GetTrackedImageEvoData(int imageIndex)
|
||||
@@ -30,6 +30,7 @@ namespace Stary.Evo.RKTools
|
||||
|
||||
public void SetTrackedImageEvoData(int imageIndex,string domain, Transform transform)
|
||||
{
|
||||
bool isExit=false;
|
||||
foreach (var imageEvoData in TrackedImages)
|
||||
{
|
||||
if (imageEvoData.imageIndex == imageIndex)
|
||||
@@ -37,8 +38,21 @@ namespace Stary.Evo.RKTools
|
||||
imageEvoData.position = transform.position;
|
||||
imageEvoData.rotation = transform.eulerAngles;
|
||||
imageEvoData.scale = transform.localScale;
|
||||
isExit=true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isExit)
|
||||
{
|
||||
TrackedImages.Add(new TarkedImageEvoData()
|
||||
{
|
||||
imageIndex = imageIndex,
|
||||
domain = domain,
|
||||
position = transform.position,
|
||||
rotation = transform.eulerAngles,
|
||||
scale = transform.localScale
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public TarkedImageEvoData GetTrackedImageEvoData(string domain)
|
||||
@@ -53,19 +67,6 @@ namespace Stary.Evo.RKTools
|
||||
Debug.LogError($"StaryEvo:未找到对应的domain的id数据,请检查是否进行前置识别 domain:{domain}");
|
||||
return null;
|
||||
}
|
||||
|
||||
public void SetTrackedImageEvoData(string domain, Transform transform)
|
||||
{
|
||||
foreach (var imageEvoData in TrackedImages)
|
||||
{
|
||||
if (imageEvoData.domain == domain)
|
||||
{
|
||||
imageEvoData.position = transform.position;
|
||||
imageEvoData.rotation = transform.eulerAngles;
|
||||
imageEvoData.scale = transform.localScale;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 52d66146caaa4114ba0f4258e240277d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,127 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6884082665aabe549ae4c6d9a142298d
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,127 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51b888818cbd7184b81f6f9643135c0e
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,127 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da055a807e845d14bb514ded002fc676
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,127 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51132773839ee5b45b08ac9ad19a8b38
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,127 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 606cac99b2a6e27418aa01e7eaae56a0
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,127 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8495279a91ea6114eba1ca274b91af74
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,127 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 303410e7f835f984595c60510bf4b9a2
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,127 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 90a94cbc0cd73e446807e4ef2d405b1d
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,127 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a056d76ac19f13841ad836bae9f6c3c2
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,96 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!74 &7400000
|
||||
AnimationClip:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Loading_ani
|
||||
serializedVersion: 7
|
||||
m_Legacy: 0
|
||||
m_Compressed: 0
|
||||
m_UseHighQualityCurve: 1
|
||||
m_RotationCurves: []
|
||||
m_CompressedRotationCurves: []
|
||||
m_EulerCurves: []
|
||||
m_PositionCurves: []
|
||||
m_ScaleCurves: []
|
||||
m_FloatCurves: []
|
||||
m_PPtrCurves:
|
||||
- serializedVersion: 2
|
||||
curve:
|
||||
- time: 0
|
||||
value: {fileID: 21300000, guid: 6884082665aabe549ae4c6d9a142298d, type: 3}
|
||||
- time: 0.083333336
|
||||
value: {fileID: 21300000, guid: 51b888818cbd7184b81f6f9643135c0e, type: 3}
|
||||
- time: 0.16666667
|
||||
value: {fileID: 21300000, guid: da055a807e845d14bb514ded002fc676, type: 3}
|
||||
- time: 0.25
|
||||
value: {fileID: 21300000, guid: 51132773839ee5b45b08ac9ad19a8b38, type: 3}
|
||||
- time: 0.33333334
|
||||
value: {fileID: 21300000, guid: 606cac99b2a6e27418aa01e7eaae56a0, type: 3}
|
||||
- time: 0.41666666
|
||||
value: {fileID: 21300000, guid: 8495279a91ea6114eba1ca274b91af74, type: 3}
|
||||
- time: 0.5
|
||||
value: {fileID: 21300000, guid: 303410e7f835f984595c60510bf4b9a2, type: 3}
|
||||
- time: 0.5833333
|
||||
value: {fileID: 21300000, guid: 90a94cbc0cd73e446807e4ef2d405b1d, type: 3}
|
||||
- time: 0.6666667
|
||||
value: {fileID: 21300000, guid: a056d76ac19f13841ad836bae9f6c3c2, type: 3}
|
||||
attribute: m_Sprite
|
||||
path:
|
||||
classID: 114
|
||||
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
flags: 2
|
||||
m_SampleRate: 12
|
||||
m_WrapMode: 0
|
||||
m_Bounds:
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
m_Extent: {x: 0, y: 0, z: 0}
|
||||
m_ClipBindingConstant:
|
||||
genericBindings:
|
||||
- serializedVersion: 2
|
||||
path: 0
|
||||
attribute: 2015549526
|
||||
script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
typeID: 114
|
||||
customType: 0
|
||||
isPPtrCurve: 1
|
||||
isIntCurve: 0
|
||||
isSerializeReferenceCurve: 0
|
||||
pptrCurveMapping:
|
||||
- {fileID: 21300000, guid: 6884082665aabe549ae4c6d9a142298d, type: 3}
|
||||
- {fileID: 21300000, guid: 51b888818cbd7184b81f6f9643135c0e, type: 3}
|
||||
- {fileID: 21300000, guid: da055a807e845d14bb514ded002fc676, type: 3}
|
||||
- {fileID: 21300000, guid: 51132773839ee5b45b08ac9ad19a8b38, type: 3}
|
||||
- {fileID: 21300000, guid: 606cac99b2a6e27418aa01e7eaae56a0, type: 3}
|
||||
- {fileID: 21300000, guid: 8495279a91ea6114eba1ca274b91af74, type: 3}
|
||||
- {fileID: 21300000, guid: 303410e7f835f984595c60510bf4b9a2, type: 3}
|
||||
- {fileID: 21300000, guid: 90a94cbc0cd73e446807e4ef2d405b1d, type: 3}
|
||||
- {fileID: 21300000, guid: a056d76ac19f13841ad836bae9f6c3c2, type: 3}
|
||||
m_AnimationClipSettings:
|
||||
serializedVersion: 2
|
||||
m_AdditiveReferencePoseClip: {fileID: 0}
|
||||
m_AdditiveReferencePoseTime: 0
|
||||
m_StartTime: 0
|
||||
m_StopTime: 0.75
|
||||
m_OrientationOffsetY: 0
|
||||
m_Level: 0
|
||||
m_CycleOffset: 0
|
||||
m_HasAdditiveReferencePose: 0
|
||||
m_LoopTime: 1
|
||||
m_LoopBlend: 0
|
||||
m_LoopBlendOrientation: 0
|
||||
m_LoopBlendPositionY: 0
|
||||
m_LoopBlendPositionXZ: 0
|
||||
m_KeepOriginalOrientation: 0
|
||||
m_KeepOriginalPositionY: 1
|
||||
m_KeepOriginalPositionXZ: 0
|
||||
m_HeightFromFeet: 0
|
||||
m_Mirror: 0
|
||||
m_EditorCurves: []
|
||||
m_EulerEditorCurves: []
|
||||
m_HasGenericRootTransform: 0
|
||||
m_HasMotionFloatCurves: 0
|
||||
m_Events: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8488f417302cba24fa328f9796d39402
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,72 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!91 &9100000
|
||||
AnimatorController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: anim
|
||||
serializedVersion: 5
|
||||
m_AnimatorParameters: []
|
||||
m_AnimatorLayers:
|
||||
- serializedVersion: 5
|
||||
m_Name: Base Layer
|
||||
m_StateMachine: {fileID: 4470429071992645539}
|
||||
m_Mask: {fileID: 0}
|
||||
m_Motions: []
|
||||
m_Behaviours: []
|
||||
m_BlendingMode: 0
|
||||
m_SyncedLayerIndex: -1
|
||||
m_DefaultWeight: 0
|
||||
m_IKPass: 0
|
||||
m_SyncedLayerAffectsTiming: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
--- !u!1102 &4177064496324344577
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Loading_ani
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_TimeParameterActive: 0
|
||||
m_Motion: {fileID: 7400000, guid: 8488f417302cba24fa328f9796d39402, type: 2}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1107 &4470429071992645539
|
||||
AnimatorStateMachine:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Base Layer
|
||||
m_ChildStates:
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 4177064496324344577}
|
||||
m_Position: {x: 200, y: 0, z: 0}
|
||||
m_ChildStateMachines: []
|
||||
m_AnyStateTransitions: []
|
||||
m_EntryTransitions: []
|
||||
m_StateMachineTransitions: {}
|
||||
m_StateMachineBehaviours: []
|
||||
m_AnyStatePosition: {x: 50, y: 20, z: 0}
|
||||
m_EntryPosition: {x: 50, y: 120, z: 0}
|
||||
m_ExitPosition: {x: 800, y: 120, z: 0}
|
||||
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
|
||||
m_DefaultState: {fileID: 4177064496324344577}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b32973ea88fca53489cd40f95b13c25f
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 9100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e5b8278e736a7de4eae406fa54b87dc7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,608 @@
|
||||
%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: 705507994}
|
||||
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
|
||||
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: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 500
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 2
|
||||
m_PVRDenoiserTypeDirect: 0
|
||||
m_PVRDenoiserTypeIndirect: 0
|
||||
m_PVRDenoiserTypeAO: 0
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 0
|
||||
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: 0}
|
||||
m_LightingSettings: {fileID: 0}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
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
|
||||
accuratePlacement: 0
|
||||
maxJobWorkers: 0
|
||||
preserveTilesOutsideBounds: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &212485936
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 212485937}
|
||||
- component: {fileID: 212485939}
|
||||
- component: {fileID: 212485938}
|
||||
m_Layer: 5
|
||||
m_Name: SplashImg
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &212485937
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 212485936}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1072993626}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &212485938
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 212485936}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &212485939
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 212485936}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &705507993
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 705507995}
|
||||
- component: {fileID: 705507994}
|
||||
m_Layer: 0
|
||||
m_Name: Directional Light
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!108 &705507994
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 705507993}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 10
|
||||
m_Type: 1
|
||||
m_Shape: 0
|
||||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_InnerSpotAngle: 21.80208
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_CullingMatrixOverride:
|
||||
e00: 1
|
||||
e01: 0
|
||||
e02: 0
|
||||
e03: 0
|
||||
e10: 0
|
||||
e11: 1
|
||||
e12: 0
|
||||
e13: 0
|
||||
e20: 0
|
||||
e21: 0
|
||||
e22: 1
|
||||
e23: 0
|
||||
e30: 0
|
||||
e31: 0
|
||||
e32: 0
|
||||
e33: 1
|
||||
m_UseCullingMatrixOverride: 0
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingLayerMask: 1
|
||||
m_Lightmapping: 1
|
||||
m_LightShadowCasterMode: 0
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_UseBoundingSphereOverride: 0
|
||||
m_UseViewFrustumForShadowCasterCull: 1
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &705507995
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 705507993}
|
||||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||
--- !u!1 &712712064
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 712712067}
|
||||
- component: {fileID: 712712066}
|
||||
- component: {fileID: 712712065}
|
||||
m_Layer: 0
|
||||
m_Name: EventSystem
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &712712065
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 712712064}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalAxis: Horizontal
|
||||
m_VerticalAxis: Vertical
|
||||
m_SubmitButton: Submit
|
||||
m_CancelButton: Cancel
|
||||
m_InputActionsPerSecond: 10
|
||||
m_RepeatDelay: 0.5
|
||||
m_ForceModuleActive: 0
|
||||
--- !u!114 &712712066
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 712712064}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_FirstSelected: {fileID: 0}
|
||||
m_sendNavigationEvents: 1
|
||||
m_DragThreshold: 10
|
||||
--- !u!4 &712712067
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 712712064}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &963194225
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 963194228}
|
||||
- component: {fileID: 963194227}
|
||||
- component: {fileID: 963194226}
|
||||
m_Layer: 0
|
||||
m_Name: MainCamera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &963194226
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 963194225}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &963194227
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 963194225}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 2147483647
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &963194228
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 963194225}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1072993622
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1072993626}
|
||||
- component: {fileID: 1072993625}
|
||||
- component: {fileID: 1072993624}
|
||||
- component: {fileID: 1072993623}
|
||||
m_Layer: 5
|
||||
m_Name: Splash
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1072993623
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1072993622}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreReversedGraphics: 1
|
||||
m_BlockingObjects: 0
|
||||
m_BlockingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
--- !u!114 &1072993624
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1072993622}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_UiScaleMode: 0
|
||||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 1080, y: 1920}
|
||||
m_ScreenMatchMode: 1
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_PresetInfoIsWorld: 0
|
||||
--- !u!223 &1072993625
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1072993622}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_RenderMode: 0
|
||||
m_Camera: {fileID: 963194227}
|
||||
m_PlaneDistance: 83.38
|
||||
m_PixelPerfect: 0
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
--- !u!224 &1072993626
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1072993622}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 212485937}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0, y: 0}
|
||||
--- !u!1 &1382820515
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1382820517}
|
||||
- component: {fileID: 1382820516}
|
||||
- component: {fileID: 1382820518}
|
||||
m_Layer: 0
|
||||
m_Name: Launcher
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1382820516
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1382820515}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 65f866947dd129249bcabba14c4a3ab2, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Splash: {fileID: 1072993622}
|
||||
--- !u!4 &1382820517
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1382820515}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 1.3929863, y: 2.0667238, z: -2.8396873}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1382820518
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1382820515}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 8cfcbc4a9d8ab3b4caf6a62eae0704e9, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
width: 1080
|
||||
height: 1920
|
||||
uiBlackType: 3
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4a737a10d2663394099a09a391ae0a49
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,53 @@
|
||||
using SkierFramework;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
public class Launcher : MonoBehaviour
|
||||
{
|
||||
public GameObject Splash;
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (Splash == null)
|
||||
{
|
||||
Splash = GameObject.Find(nameof(Splash));
|
||||
}
|
||||
|
||||
StartCor();
|
||||
}
|
||||
|
||||
private async void StartCor()
|
||||
{
|
||||
var resourceCore = ResourceManager.Instance.GetResourceCore(UIConfig.UIPackageName);
|
||||
|
||||
await resourceCore.InitializeAsync(UIConfig.UIPackageName);
|
||||
|
||||
await UIManager.Instance.InitUIConfig();
|
||||
|
||||
await UIManager.Instance.Preload<UILoadingView>();
|
||||
|
||||
Loading.Instance.StartLoading(EnterGameCor);
|
||||
|
||||
if (Splash != null)
|
||||
{
|
||||
Splash.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator EnterGameCor(Action<float, string> loadingRefresh)
|
||||
{
|
||||
loadingRefresh?.Invoke(0.3f, "loading..........1");
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
|
||||
loadingRefresh?.Invoke(0.6f, "loading..........2");
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
|
||||
loadingRefresh?.Invoke(1, "loading..........3");
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
|
||||
UIManager.Instance.Open<UILoginView>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65f866947dd129249bcabba14c4a3ab2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ee43589b3cf66b94a8b652f86560e9e3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6dfc2278343e60244b14072cb9d82107
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 248dd1fd11fe15a4695d69cb2d9e4950
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SkierFramework
|
||||
{
|
||||
public class LoadingData
|
||||
{
|
||||
public LoadingFunc loadingFunc;
|
||||
public bool isCleanupAsset = false;
|
||||
}
|
||||
|
||||
public delegate IEnumerator LoadingFunc(Action<float, string> loadingRefresh);
|
||||
|
||||
/// <summary>
|
||||
/// 实际游戏中的loading
|
||||
/// </summary>
|
||||
public class Loading : SingletonMono<Loading>
|
||||
{
|
||||
private LoadingData _loadingData;
|
||||
private Coroutine _cor;
|
||||
|
||||
public void StartLoading(LoadingFunc loadingFunc, bool isCleanupAsset = false)
|
||||
{
|
||||
StartLoading(new LoadingData { loadingFunc = loadingFunc, isCleanupAsset = isCleanupAsset });
|
||||
}
|
||||
|
||||
private void StartLoading(LoadingData loadingData)
|
||||
{
|
||||
//开启UI
|
||||
UIManager.Instance.Open<UILoadingView>();
|
||||
|
||||
if (loadingData.loadingFunc != null)
|
||||
{
|
||||
_loadingData = loadingData;
|
||||
|
||||
if (_cor != null)
|
||||
{
|
||||
StopCoroutine(_cor);
|
||||
}
|
||||
_cor = StartCoroutine(CorLoading());
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("加载错误,没有参数LoadingData!");
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator CorLoading()
|
||||
{
|
||||
yield return StartCoroutine(_loadingData.loadingFunc(RefreshLoading));
|
||||
|
||||
// if (_loadingData != null && _loadingData.isCleanupAsset)
|
||||
// {
|
||||
// yield return ResourceManager.Instance.GetResourceCore(UIConfig.UIPackageName).CleanupAsync();
|
||||
// yield return Resources.UnloadUnusedAssets();
|
||||
// }
|
||||
|
||||
// Pool.ReleaseAll();
|
||||
// yield return null;
|
||||
|
||||
GC.Collect();
|
||||
yield return null;
|
||||
|
||||
Exit();
|
||||
|
||||
_cor = null;
|
||||
}
|
||||
|
||||
private void RefreshLoading(float loading, string desc)
|
||||
{
|
||||
// 刷新
|
||||
var view = UIManager.Instance.GetView<UILoadingView>();
|
||||
if (view != null)
|
||||
{
|
||||
view.SetLoading(loading, desc);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(desc))
|
||||
{
|
||||
Debug.Log(desc);
|
||||
}
|
||||
}
|
||||
|
||||
private void Exit()
|
||||
{
|
||||
// 关闭UI
|
||||
UIManager.Instance.Close<UILoadingView>();
|
||||
|
||||
ObjectPool<LoadingData>.Release(_loadingData);
|
||||
_loadingData = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 713b44a81c68b61488afc7bb065ca96a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SkierFramework
|
||||
{
|
||||
public enum UIEvent
|
||||
{
|
||||
None,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e8e3dcb8d2c6dd349927abfcb3361078
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,46 @@
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SkierFramework
|
||||
{
|
||||
public class UILoadingView : UIView
|
||||
{
|
||||
#region 控件绑定变量声明,自动生成请勿手改
|
||||
#pragma warning disable 0649
|
||||
[ControlBinding]
|
||||
private TextMeshProUGUI TextDes;
|
||||
[ControlBinding]
|
||||
private Image Aniloading;
|
||||
|
||||
#pragma warning restore 0649
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
public override void OnOpen(object userData)
|
||||
{
|
||||
base.OnOpen(userData);
|
||||
Reset();
|
||||
}
|
||||
|
||||
public void SetLoading(float value, string desc)
|
||||
{
|
||||
TextDes.text = $"{desc} {value * 100:F0}%";
|
||||
}
|
||||
|
||||
public override void OnClose()
|
||||
{
|
||||
base.OnClose();
|
||||
Reset();
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
|
||||
TextDes.text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9958976e3e375d148b96f791743cc13a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,106 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using System.Collections;
|
||||
|
||||
namespace SkierFramework
|
||||
{
|
||||
public class UITestItem : UILoopItem
|
||||
{
|
||||
#region 控件绑定变量声明,自动生成请勿手改
|
||||
|
||||
#pragma warning disable 0649
|
||||
[ControlBinding] private TextMeshProUGUI Text;
|
||||
[ControlBinding] private Button Button;
|
||||
[ControlBinding] private GameObject Select;
|
||||
|
||||
#pragma warning restore 0649
|
||||
|
||||
#endregion
|
||||
|
||||
public override void OnInit()
|
||||
{
|
||||
base.OnInit();
|
||||
Button.AddClick(() => { UIScrollView.Select(Index); });
|
||||
}
|
||||
|
||||
public override void CheckSelect(int index)
|
||||
{
|
||||
base.CheckSelect(index);
|
||||
Select.SetActive(index == Index);
|
||||
}
|
||||
|
||||
protected override void OnUpdateData(IList dataList, int index, object userData)
|
||||
{
|
||||
base.OnUpdateData(dataList, index, userData);
|
||||
|
||||
Text.text = dataList[index].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public class UILoginView : UIView
|
||||
{
|
||||
#region 控件绑定变量声明,自动生成请勿手改
|
||||
|
||||
#pragma warning disable 0649
|
||||
[ControlBinding] private Button ButtonStart;
|
||||
[ControlBinding] private Button ButtonSetting;
|
||||
[ControlBinding] private UIScrollView UIScrollView;
|
||||
[ControlBinding] private GameObject Item;
|
||||
[ControlBinding] private RawImage RawImage;
|
||||
|
||||
#pragma warning restore 0649
|
||||
|
||||
#endregion
|
||||
|
||||
public override void OnInit(UIControlData uIControlData, UIViewController controller)
|
||||
{
|
||||
base.OnInit(uIControlData, controller);
|
||||
|
||||
ButtonStart.AddClick(() =>
|
||||
{
|
||||
UIManager.Instance.Open<UIMessageBoxView>(ObjectPool<MessageBoxData>.Get()
|
||||
.Set("提示", "测试弹窗。", () => { Debug.Log("确认"); }));
|
||||
});
|
||||
ButtonSetting.AddClick(() => { UIManager.Instance.Open<UITestView>(); });
|
||||
|
||||
UIScrollView.OnSelectChanged += (index) => { Debug.Log("选中了:" + index); };
|
||||
}
|
||||
|
||||
public override void OnOpen(object userData)
|
||||
{
|
||||
base.OnOpen(userData);
|
||||
|
||||
// 模拟100个数据
|
||||
List<int> list = new List<int>();
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
list.Add(i);
|
||||
}
|
||||
|
||||
UIScrollView.UpdateList(list, Item, typeof(UITestItem));
|
||||
UIScrollView.Select(10);
|
||||
|
||||
UIModelManager.Instance.LoadModelToRawImage("Assets/UI/UISystemPackage/TestModel.prefab", RawImage,
|
||||
scale: Vector3.one * 6, isOrth: false, orthSizeOrFOV: 60);
|
||||
}
|
||||
|
||||
public override void OnAddListener()
|
||||
{
|
||||
base.OnAddListener();
|
||||
}
|
||||
|
||||
public override void OnRemoveListener()
|
||||
{
|
||||
base.OnRemoveListener();
|
||||
}
|
||||
|
||||
public override void OnClose()
|
||||
{
|
||||
base.OnClose();
|
||||
UIModelManager.Instance.UnLoadModelByRawImage(RawImage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 767534c58c67230489467f81f1bfd94b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,127 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
|
||||
namespace SkierFramework
|
||||
{
|
||||
public enum MessageBoxType
|
||||
{
|
||||
TwoButton,
|
||||
OneButton,
|
||||
}
|
||||
|
||||
public class MessageBoxData
|
||||
{
|
||||
const string DefaultConfirmName = "确认";
|
||||
const string DefaultCancelName = "取消";
|
||||
|
||||
public string title;
|
||||
public string content;
|
||||
public Action confirm;
|
||||
public Action cancel;
|
||||
public string confirmName;
|
||||
public string cancelName;
|
||||
public MessageBoxType type;
|
||||
|
||||
public MessageBoxData Set(string title, string content, Action confirm, Action cancel = null
|
||||
, string confirmName = DefaultConfirmName, string cancelName = DefaultCancelName)
|
||||
{
|
||||
this.title = title;
|
||||
this.content = content;
|
||||
this.confirm = confirm;
|
||||
this.cancel = cancel;
|
||||
this.confirmName = confirmName;
|
||||
this.cancelName = cancelName;
|
||||
this.type = MessageBoxType.TwoButton;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MessageBoxData SetOneButton(string title, string content, Action confirm, Action cancel = null
|
||||
, string confirmName = DefaultConfirmName)
|
||||
{
|
||||
this.title = title;
|
||||
this.content = content;
|
||||
this.confirm = confirm;
|
||||
this.cancel = cancel;
|
||||
this.confirmName = confirmName;
|
||||
this.cancelName = null;
|
||||
this.type = MessageBoxType.OneButton;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public class UIMessageBoxView : UIView
|
||||
{
|
||||
#region 控件绑定变量声明,自动生成请勿手改
|
||||
#pragma warning disable 0649
|
||||
[ControlBinding]
|
||||
protected Button ButtonConfirm;
|
||||
[ControlBinding]
|
||||
protected TextMeshProUGUI TextTitle;
|
||||
[ControlBinding]
|
||||
protected TextMeshProUGUI TextContent;
|
||||
[ControlBinding]
|
||||
protected Button[] ButtonCloses;
|
||||
[ControlBinding]
|
||||
protected TextMeshProUGUI TextConfirm;
|
||||
[ControlBinding]
|
||||
protected TextMeshProUGUI TextCancel;
|
||||
|
||||
#pragma warning restore 0649
|
||||
#endregion
|
||||
|
||||
MessageBoxData data;
|
||||
|
||||
public override void OnInit(UIControlData uIControlData, UIViewController controller)
|
||||
{
|
||||
base.OnInit(uIControlData, controller);
|
||||
|
||||
foreach (var button in ButtonCloses)
|
||||
{
|
||||
button.AddClick(() =>
|
||||
{
|
||||
data.cancel?.Invoke();
|
||||
UIManager.Instance.Close(this);
|
||||
});
|
||||
}
|
||||
ButtonConfirm.AddClick(() =>
|
||||
{
|
||||
data.confirm?.Invoke();
|
||||
UIManager.Instance.Close(this);
|
||||
});
|
||||
}
|
||||
|
||||
public override void OnOpen(object userData)
|
||||
{
|
||||
base.OnOpen(userData);
|
||||
data = userData as MessageBoxData;
|
||||
|
||||
TextTitle.text = data.title;
|
||||
TextContent.text = data.content;
|
||||
TextConfirm.text = data.confirmName;
|
||||
TextCancel.text = data.cancelName;
|
||||
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(TextContent.rectTransform);
|
||||
|
||||
ButtonCloses[1].gameObject.SetActive(data.type == MessageBoxType.TwoButton);
|
||||
}
|
||||
|
||||
public override void OnAddListener()
|
||||
{
|
||||
base.OnAddListener();
|
||||
}
|
||||
|
||||
public override void OnRemoveListener()
|
||||
{
|
||||
base.OnRemoveListener();
|
||||
}
|
||||
|
||||
public override void OnClose()
|
||||
{
|
||||
base.OnClose();
|
||||
ObjectPool<MessageBoxData>.Release(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 05f58bedeae24be49a48df8fbdf016f6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
|
||||
namespace SkierFramework
|
||||
{
|
||||
public class UITestView : UIView
|
||||
{
|
||||
#region 控件绑定变量声明,自动生成请勿手改
|
||||
#pragma warning disable 0649
|
||||
[ControlBinding]
|
||||
private Button ButtonClose;
|
||||
|
||||
#pragma warning restore 0649
|
||||
#endregion
|
||||
|
||||
public override void OnInit(UIControlData uIControlData, UIViewController controller)
|
||||
{
|
||||
base.OnInit(uIControlData, controller);
|
||||
|
||||
ButtonClose.AddClick(() =>
|
||||
{
|
||||
UIManager.Instance.Close(this);
|
||||
});
|
||||
}
|
||||
|
||||
public override void OnOpen(object userData)
|
||||
{
|
||||
base.OnOpen(userData);
|
||||
}
|
||||
|
||||
public override void OnAddListener()
|
||||
{
|
||||
base.OnAddListener();
|
||||
}
|
||||
|
||||
public override void OnRemoveListener()
|
||||
{
|
||||
base.OnRemoveListener();
|
||||
}
|
||||
|
||||
public override void OnClose()
|
||||
{
|
||||
base.OnClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1da5d512acbd21a458b830596dc3fb29
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9c06dd7c57ad1314eae1902d6cdb444f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dfe5d63d6291646498e52273c1322822
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,292 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.U2D;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SkierFramework
|
||||
{
|
||||
/* 获取内置图片
|
||||
* AssetDatabase.GetBuiltinExtraResource
|
||||
* "UI/Skin/UISprite.psd"
|
||||
"UI/Skin/Background.psd"
|
||||
"UI/Skin/InputFieldBackground.psd"
|
||||
"UI/Skin/Knob.psd"
|
||||
"UI/Skin/Checkmark.psd"
|
||||
"UI/Skin/DropdownArrow.psd"
|
||||
"UI/Skin/UIMask.psd"
|
||||
*/
|
||||
public class OverrideUICreate
|
||||
{
|
||||
[MenuItem("GameObject/UI/Image", true)]
|
||||
public static void IgnoreImage()
|
||||
{
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/UI/Image.")]
|
||||
public static void CreateImage()
|
||||
{
|
||||
var image = Create<Image>();
|
||||
image.raycastTarget = false;
|
||||
image.maskable = image.GetComponentInParent<RectMask2D>() != null || image.GetComponentInParent<Mask>() != null;
|
||||
image.gameObject.SetLayerRecursively(Layer.UI);
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/UI/Raw Image", true)]
|
||||
public static void IgnoreRawImage()
|
||||
{
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/UI/RawImage")]
|
||||
public static void CreateRawImage()
|
||||
{
|
||||
var image = Create<RawImage>();
|
||||
image.raycastTarget = false;
|
||||
image.maskable = image.GetComponentInParent<RectMask2D>() != null || image.GetComponentInParent<Mask>() != null;
|
||||
image.gameObject.SetLayerRecursively(Layer.UI);
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/UI/Button")]
|
||||
public static void CreateButton()
|
||||
{
|
||||
var image = Create<Image>("Button");
|
||||
var button = image.AddComponent<Button>();
|
||||
image.maskable = image.GetComponentInParent<RectMask2D>() != null || image.GetComponentInParent<Mask>() != null;
|
||||
image.rectTransform.sizeDelta = new Vector2(160, 30);
|
||||
image.gameObject.SetLayerRecursively(Layer.UI);
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/UI/Text - TextMeshPro", true)]
|
||||
public static void IgnoreTextMeshPro()
|
||||
{
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/UI/Text - TextMeshPro")]
|
||||
public static void CreateTextMeshPro()
|
||||
{
|
||||
var textMeshPro = Create<TextMeshProUGUI>("Text");
|
||||
textMeshPro.raycastTarget = false;
|
||||
textMeshPro.color = Color.black;
|
||||
textMeshPro.maskable = textMeshPro.GetComponentInParent<RectMask2D>() != null || textMeshPro.GetComponentInParent<Mask>() != null;
|
||||
textMeshPro.gameObject.SetLayerRecursively(Layer.UI);
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/UI/Button - TextMeshPro", true)]
|
||||
public static void IgnoreButtonTextMeshPro()
|
||||
{
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/UI/Button - TextMeshPro")]
|
||||
public static void CreateButtonTextMeshPro()
|
||||
{
|
||||
var image = Create<Image>("Button");
|
||||
var button = image.AddComponent<Button>();
|
||||
var textMeshPro = Create<TextMeshProUGUI>("Text", button.transform);
|
||||
textMeshPro.raycastTarget = false;
|
||||
textMeshPro.maskable = textMeshPro.GetComponentInParent<RectMask2D>() != null || textMeshPro.GetComponentInParent<Mask>() != null;
|
||||
textMeshPro.text = "Button";
|
||||
textMeshPro.alignment = TextAlignmentOptions.Center;
|
||||
textMeshPro.alignment = TextAlignmentOptions.Midline;
|
||||
|
||||
textMeshPro.rectTransform.anchorMin = Vector3.zero;
|
||||
textMeshPro.rectTransform.anchorMax = Vector3.one;
|
||||
textMeshPro.rectTransform.sizeDelta = Vector2.zero;
|
||||
textMeshPro.color = Color.black;
|
||||
textMeshPro.fontSize = 24;
|
||||
|
||||
image.maskable = textMeshPro.maskable;
|
||||
image.rectTransform.sizeDelta = new Vector2(160, 30);
|
||||
image.gameObject.SetLayerRecursively(Layer.UI);
|
||||
}
|
||||
|
||||
#region ScrollRect
|
||||
[MenuItem("GameObject/UI/Scroll View", true)]
|
||||
public static void IgnoreScrollView()
|
||||
{
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/UI/UIScrollView")]
|
||||
public static ScrollRect CreateScrollView()
|
||||
{
|
||||
var image = Create<Image>("UIScrollView");
|
||||
image.raycastTarget = true;
|
||||
image.maskable = false;
|
||||
image.rectTransform.sizeDelta = new Vector2(200, 200);
|
||||
var scrollRect = image.AddComponent<ScrollRect>();
|
||||
var uIScrollView = image.AddComponent<UIScrollView>();
|
||||
|
||||
var viewportImage = Create<Image>("Viewport", uIScrollView.transform);
|
||||
viewportImage.sprite = AssetDatabase.GetBuiltinExtraResource<Sprite>("UI/Skin/UIMask.psd");
|
||||
viewportImage.type = Image.Type.Sliced;
|
||||
viewportImage.raycastTarget = true;
|
||||
viewportImage.maskable = true;
|
||||
|
||||
var viewport = viewportImage.transform as RectTransform;
|
||||
viewport.AddComponent<RectMask2D>();
|
||||
viewport.anchorMin = Vector2.zero;
|
||||
viewport.anchorMax = Vector2.one;
|
||||
viewport.pivot = new Vector2(0, 1);
|
||||
viewport.sizeDelta = Vector2.zero;
|
||||
viewport.anchoredPosition = Vector2.zero;
|
||||
|
||||
scrollRect.viewport = viewport;
|
||||
|
||||
var content = Create<RectTransform>("Content", viewport);
|
||||
content.anchorMin = new Vector2(0, 1);
|
||||
content.anchorMax = new Vector2(1, 1);
|
||||
content.pivot = new Vector2(0, 1);
|
||||
content.sizeDelta = new Vector2(0, 300);
|
||||
content.anchoredPosition = Vector2.zero;
|
||||
|
||||
scrollRect.content = content;
|
||||
|
||||
uIScrollView.m_ScrollRect = scrollRect;
|
||||
uIScrollView.m_Content = content;
|
||||
scrollRect.gameObject.SetLayerRecursively(Layer.UI);
|
||||
return scrollRect;
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/UI/UIScrollView - Horizontal")]
|
||||
public static void CreateScrollViewHorizontal()
|
||||
{
|
||||
var scrollRect = CreateScrollView();
|
||||
|
||||
scrollRect.horizontalScrollbar = CreateScrollBar("Scrollbar Horizontal", scrollRect.transform);
|
||||
scrollRect.horizontalScrollbar.direction = Scrollbar.Direction.LeftToRight;
|
||||
scrollRect.verticalScrollbarVisibility = scrollRect.horizontalScrollbarVisibility = ScrollRect.ScrollbarVisibility.AutoHideAndExpandViewport;
|
||||
scrollRect.verticalScrollbarSpacing = scrollRect.horizontalScrollbarSpacing = -3;
|
||||
|
||||
var uiScrollView = scrollRect.GetComponent<UIScrollView>();
|
||||
uiScrollView.m_AxisType = RectTransform.Axis.Horizontal;
|
||||
uiScrollView.m_AlignType = AlignType.Left;
|
||||
|
||||
scrollRect.gameObject.SetLayerRecursively(Layer.UI);
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/UI/UIScrollView - Vertical")]
|
||||
public static void CreateScrollViewVertical()
|
||||
{
|
||||
var scrollRect = CreateScrollView();
|
||||
|
||||
scrollRect.verticalScrollbar = CreateScrollBar("Scrollbar Vertical", scrollRect.transform);
|
||||
var verticalRect = scrollRect.verticalScrollbar.transform as RectTransform;
|
||||
verticalRect.anchorMin = new Vector2(1, 0);
|
||||
verticalRect.anchorMax = new Vector2(1, 1);
|
||||
verticalRect.pivot = new Vector2(1, 1);
|
||||
verticalRect.sizeDelta = new Vector2(20, 0);
|
||||
verticalRect.anchoredPosition = Vector2.zero;
|
||||
scrollRect.verticalScrollbar.direction = Scrollbar.Direction.BottomToTop;
|
||||
|
||||
scrollRect.verticalScrollbarVisibility = scrollRect.horizontalScrollbarVisibility = ScrollRect.ScrollbarVisibility.AutoHideAndExpandViewport;
|
||||
scrollRect.verticalScrollbarSpacing = scrollRect.horizontalScrollbarSpacing = -3;
|
||||
|
||||
scrollRect.gameObject.SetLayerRecursively(Layer.UI);
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/UI/UIScrollView - All")]
|
||||
public static void CreateScrollViewAll()
|
||||
{
|
||||
var scrollRect = CreateScrollView();
|
||||
|
||||
scrollRect.horizontalScrollbar = CreateScrollBar("Scrollbar Horizontal", scrollRect.transform);
|
||||
scrollRect.horizontalScrollbar.direction = Scrollbar.Direction.LeftToRight;
|
||||
|
||||
scrollRect.verticalScrollbar = CreateScrollBar("Scrollbar Vertical", scrollRect.transform);
|
||||
var verticalRect = scrollRect.verticalScrollbar.transform as RectTransform;
|
||||
verticalRect.anchorMin = new Vector2(1, 0);
|
||||
verticalRect.anchorMax = new Vector2(1, 1);
|
||||
verticalRect.pivot = new Vector2(1, 1);
|
||||
verticalRect.sizeDelta = new Vector2(20, 0);
|
||||
verticalRect.anchoredPosition = Vector2.zero;
|
||||
scrollRect.verticalScrollbar.direction = Scrollbar.Direction.BottomToTop;
|
||||
|
||||
scrollRect.verticalScrollbarVisibility = scrollRect.horizontalScrollbarVisibility = ScrollRect.ScrollbarVisibility.AutoHideAndExpandViewport;
|
||||
scrollRect.verticalScrollbarSpacing = scrollRect.horizontalScrollbarSpacing = -3;
|
||||
|
||||
scrollRect.gameObject.SetLayerRecursively(Layer.UI);
|
||||
}
|
||||
|
||||
public static Scrollbar CreateScrollBar(string name, Transform parent)
|
||||
{
|
||||
var verticalScorllImage = Create<Image>(name, parent);
|
||||
verticalScorllImage.sprite = AssetDatabase.GetBuiltinExtraResource<Sprite>("UI/Skin/Background.psd");
|
||||
verticalScorllImage.type = Image.Type.Sliced;
|
||||
var verticalScroll = verticalScorllImage.AddComponent<Scrollbar>();
|
||||
var verticalRect = verticalScroll.transform as RectTransform;
|
||||
verticalRect.anchorMin = Vector2.zero;
|
||||
verticalRect.anchorMax = new Vector2(1, 0);
|
||||
verticalRect.pivot = Vector2.zero;
|
||||
verticalRect.sizeDelta = new Vector2(0, 20);
|
||||
verticalRect.anchoredPosition = Vector2.zero;
|
||||
|
||||
var handle = Create<Image>("Handle", verticalRect.transform);
|
||||
handle.sprite = AssetDatabase.GetBuiltinExtraResource<Sprite>("UI/Skin/UISprite.psd");
|
||||
handle.type = Image.Type.Sliced;
|
||||
handle.rectTransform.anchorMin = Vector2.zero;
|
||||
handle.rectTransform.anchorMax = Vector2.one;
|
||||
handle.rectTransform.sizeDelta = Vector2.zero;
|
||||
handle.rectTransform.anchoredPosition = Vector2.zero;
|
||||
|
||||
verticalScroll.handleRect = handle.rectTransform;
|
||||
|
||||
return verticalScroll;
|
||||
}
|
||||
#endregion
|
||||
|
||||
[MenuItem("GameObject/UI/Slider", true)]
|
||||
public static void IgnoreSlider()
|
||||
{
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/UI/Slider.")]
|
||||
public static void CreateSlider()
|
||||
{
|
||||
var image = Create<Image>("Slider");
|
||||
image.color = Color.grey;
|
||||
image.rectTransform.sizeDelta = new Vector2(160, 20);
|
||||
var slider = image.AddComponent<Slider>();
|
||||
slider.interactable = false;
|
||||
slider.transition = Selectable.Transition.None;
|
||||
|
||||
var fill = Create<Image>("Fill", slider.transform);
|
||||
fill.rectTransform.anchorMin = Vector2.zero;
|
||||
fill.rectTransform.anchorMax = new Vector2(0, 1);
|
||||
fill.rectTransform.sizeDelta = Vector2.zero;
|
||||
fill.rectTransform.anchoredPosition = Vector2.zero;
|
||||
slider.fillRect = fill.rectTransform;
|
||||
|
||||
var handle = Create<Image>("Handle", slider.transform);
|
||||
handle.rectTransform.anchorMin = Vector2.zero;
|
||||
handle.rectTransform.anchorMax = new Vector2(0, 1);
|
||||
handle.rectTransform.sizeDelta = new Vector2(20, 0);
|
||||
handle.rectTransform.anchoredPosition = Vector2.zero;
|
||||
handle.sprite = AssetDatabase.GetBuiltinExtraResource<Sprite>("UI/Skin/Knob.psd");
|
||||
slider.handleRect = handle.rectTransform;
|
||||
|
||||
image.gameObject.SetLayerRecursively(Layer.UI);
|
||||
}
|
||||
|
||||
public static T Create<T>(string name = null, Transform parent = null) where T : Component
|
||||
{
|
||||
if (string.IsNullOrEmpty(name))
|
||||
name = typeof(T).Name;
|
||||
GameObject go = new GameObject(name);
|
||||
if (parent == null)
|
||||
{
|
||||
go.transform.SetParent(Selection.activeTransform);
|
||||
Selection.activeGameObject = go;
|
||||
}
|
||||
else
|
||||
{
|
||||
go.transform.SetParent(parent);
|
||||
}
|
||||
go.transform.localScale = Vector3.one;
|
||||
go.transform.localPosition = Vector3.zero;
|
||||
go.transform.localRotation = Quaternion.identity;
|
||||
return go.AddComponent<T>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b2cf4ddaea9fe1499bfdd7e4516b3b2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b8cd8920119b49bc95c6755ae94d1b26
|
||||
timeCreated: 1758179166
|
||||
@@ -0,0 +1,41 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenAlpha))]
|
||||
public class TweenAlphaEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenAlpha tw = target as TweenAlpha;
|
||||
GUI.changed = false;
|
||||
|
||||
var from = EditorGUILayout.Slider("From", tw.from, 0f, 1f);
|
||||
var to = EditorGUILayout.Slider("To", tw.to, 0f, 1f);
|
||||
|
||||
var ds = tw.autoCleanup;
|
||||
var pn = tw.colorProperty;
|
||||
|
||||
if (tw.GetComponent<MeshRenderer>() != null)
|
||||
{
|
||||
ds = EditorGUILayout.Toggle("Auto-cleanup", tw.autoCleanup);
|
||||
pn = EditorGUILayout.TextField("Color Property", tw.colorProperty);
|
||||
}
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
tw.autoCleanup = ds;
|
||||
tw.colorProperty = pn;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6ca1a2b070be6f04f9dc2b6756d084ff
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,30 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenColor))]
|
||||
public class TweenColorEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenColor tw = target as TweenColor;
|
||||
GUI.changed = false;
|
||||
|
||||
Color from = EditorGUILayout.ColorField("From", tw.from);
|
||||
Color to = EditorGUILayout.ColorField("To", tw.to);
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7928b5af346eed04ba391047b8b0ddc8
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,30 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenFOV))]
|
||||
public class TweenFOVEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenFOV tw = target as TweenFOV;
|
||||
GUI.changed = false;
|
||||
|
||||
float from = EditorGUILayout.Slider("From", tw.from, 1f, 180f);
|
||||
float to = EditorGUILayout.Slider("To", tw.to, 1f, 180f);
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 11db62d6da2a5f34590f41ebb958bd94
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,46 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenHeight))]
|
||||
public class TweenHeightEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenHeight tw = target as TweenHeight;
|
||||
GUI.changed = false;
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUI.BeginDisabledGroup(tw.fromTarget != null);
|
||||
var from = EditorGUILayout.FloatField("From", tw.from);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
var fc = (RectTransform)EditorGUILayout.ObjectField(tw.fromTarget, typeof(RectTransform), true, GUILayout.Width(110f));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUI.BeginDisabledGroup(tw.toTarget != null);
|
||||
var to = EditorGUILayout.FloatField("To", tw.to);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
var tc = (RectTransform)EditorGUILayout.ObjectField(tw.toTarget, typeof(RectTransform), true, GUILayout.Width(110f));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
if (from < 0) from = 0;
|
||||
if (to < 0) to = 0;
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
tw.fromTarget = fc;
|
||||
tw.toTarget = tc;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c135e5506eb921409b47fa6543134ec
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,33 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenOrthoSize))]
|
||||
public class TweenOrthoSizeEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenOrthoSize tw = target as TweenOrthoSize;
|
||||
GUI.changed = false;
|
||||
|
||||
float from = EditorGUILayout.FloatField("From", tw.from);
|
||||
float to = EditorGUILayout.FloatField("To", tw.to);
|
||||
|
||||
if (from < 0f) from = 0f;
|
||||
if (to < 0f) to = 0f;
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 37cda4ddb333a6d469473d36a439d20e
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,30 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenPosition))]
|
||||
public class TweenPositionEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenPosition tw = target as TweenPosition;
|
||||
GUI.changed = false;
|
||||
|
||||
Vector3 from = EditorGUILayout.Vector3Field("From", tw.from);
|
||||
Vector3 to = EditorGUILayout.Vector3Field("To", tw.to);
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5c3ed7d7dc3fe434d8fbe43ba848c7de
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,32 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenRotation))]
|
||||
public class TweenRotationEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenRotation tw = target as TweenRotation;
|
||||
GUI.changed = false;
|
||||
|
||||
Vector3 from = EditorGUILayout.Vector3Field("From", tw.from);
|
||||
Vector3 to = EditorGUILayout.Vector3Field("To", tw.to);
|
||||
var quat = EditorGUILayout.Toggle("Quaternion", tw.quaternionLerp);
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
tw.quaternionLerp = quat;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 37920e4b9f98bd44fa1250a9d995475c
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,30 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenScale))]
|
||||
public class TweenScaleEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenScale tw = target as TweenScale;
|
||||
GUI.changed = false;
|
||||
|
||||
Vector3 from = EditorGUILayout.Vector3Field("From", tw.from);
|
||||
Vector3 to = EditorGUILayout.Vector3Field("To", tw.to);
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 50b7b0504ae552a42b20841c085dc185
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,9 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenTransform))]
|
||||
public class TweenTransformEditor : UITweenerEditor
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9ff6713338f44844c82de82685521dd3
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,30 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenVolume))]
|
||||
public class TweenVolumeEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenVolume tw = target as TweenVolume;
|
||||
GUI.changed = false;
|
||||
|
||||
float from = EditorGUILayout.Slider("From", tw.from, 0f, 1f);
|
||||
float to = EditorGUILayout.Slider("To", tw.to, 0f, 1f);
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 023e6404a70e48148b315cf9737211af
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,46 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenWidth))]
|
||||
public class TweenWidthEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenWidth tw = target as TweenWidth;
|
||||
GUI.changed = false;
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUI.BeginDisabledGroup(tw.fromTarget != null);
|
||||
var from = EditorGUILayout.FloatField("From", tw.from);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
var fc = (RectTransform)EditorGUILayout.ObjectField(tw.fromTarget, typeof(RectTransform), true, GUILayout.Width(110f));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUI.BeginDisabledGroup(tw.toTarget != null);
|
||||
var to = EditorGUILayout.FloatField("To", tw.to);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
var tc = (RectTransform)EditorGUILayout.ObjectField(tw.toTarget, typeof(RectTransform), true, GUILayout.Width(110f));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
if (from < 0) from = 0;
|
||||
if (to < 0) to = 0;
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
tw.fromTarget = fc;
|
||||
tw.toTarget = tc;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d35cd8e39586acb4a842a0c77019d598
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,118 @@
|
||||
#if UNITY_EDITOR
|
||||
//-------------------------------------------------
|
||||
// NGUI: Next-Gen UI kit
|
||||
// Copyright © 2011-2020 Tasharen Entertainment Inc
|
||||
//-------------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(UITweener), true)]
|
||||
public class UITweenerEditor : Editor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 110f;
|
||||
base.OnInspectorGUI();
|
||||
DrawCommonProperties();
|
||||
}
|
||||
|
||||
static public bool DrawHeader(string text, string key, bool forceOn, bool minimalistic)
|
||||
{
|
||||
bool state = EditorPrefs.GetBool(key, true);
|
||||
|
||||
if (!minimalistic) GUILayout.Space(3f);
|
||||
if (!forceOn && !state) GUI.backgroundColor = new Color(0.8f, 0.8f, 0.8f);
|
||||
GUILayout.BeginHorizontal();
|
||||
GUI.changed = false;
|
||||
|
||||
if (minimalistic)
|
||||
{
|
||||
if (state) text = "\u25BC" + (char)0x200a + text;
|
||||
else text = "\u25BA" + (char)0x200a + text;
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
GUI.contentColor = EditorGUIUtility.isProSkin ? new Color(1f, 1f, 1f, 0.7f) : new Color(0f, 0f, 0f, 0.7f);
|
||||
if (!GUILayout.Toggle(true, text, "PreToolbar2", GUILayout.MinWidth(20f))) state = !state;
|
||||
GUI.contentColor = Color.white;
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "<b><size=11>" + text + "</size></b>";
|
||||
if (state) text = "\u25BC " + text;
|
||||
else text = "\u25BA " + text;
|
||||
if (!GUILayout.Toggle(true, text, "dragtab", GUILayout.MinWidth(20f))) state = !state;
|
||||
}
|
||||
|
||||
if (GUI.changed) EditorPrefs.SetBool(key, state);
|
||||
|
||||
if (!minimalistic) GUILayout.Space(2f);
|
||||
GUILayout.EndHorizontal();
|
||||
GUI.backgroundColor = Color.white;
|
||||
if (!forceOn && !state) GUILayout.Space(3f);
|
||||
return state;
|
||||
}
|
||||
|
||||
static public void BeginContents()
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal(GUILayout.MinHeight(10f));
|
||||
GUILayout.Space(10f);
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.Space(2f);
|
||||
}
|
||||
static public void EndContents()
|
||||
{
|
||||
GUILayout.Space(3f);
|
||||
GUILayout.EndVertical();
|
||||
EditorGUILayout.EndHorizontal();
|
||||
GUILayout.Space(3f);
|
||||
}
|
||||
|
||||
protected void DrawCommonProperties ()
|
||||
{
|
||||
UITweener tw = target as UITweener;
|
||||
|
||||
if (DrawHeader("Tweener", "Tweener", false , true))
|
||||
{
|
||||
BeginContents();
|
||||
EditorGUIUtility.labelWidth = 110f;
|
||||
|
||||
GUI.changed = false;
|
||||
|
||||
UITweener.Style style = (UITweener.Style)EditorGUILayout.EnumPopup("Play Style", tw.style);
|
||||
AnimationCurve curve = EditorGUILayout.CurveField("Animation Curve", tw.animationCurve, GUILayout.Width(170f), GUILayout.Height(62f));
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
float dur = EditorGUILayout.FloatField("Duration", tw.duration, GUILayout.Width(170f));
|
||||
GUILayout.Label("seconds");
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
float del = EditorGUILayout.FloatField("Start Delay", tw.delay, GUILayout.Width(170f));
|
||||
GUILayout.Label("seconds");
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
var deff = (UITweener.DelayAffects)EditorGUILayout.EnumPopup("Delay Affects", tw.delayAffects);
|
||||
|
||||
int tg = EditorGUILayout.IntField("Tween Group", tw.tweenGroup, GUILayout.Width(170f));
|
||||
bool ts = EditorGUILayout.Toggle("Ignore TimeScale", tw.ignoreTimeScale);
|
||||
bool fx = EditorGUILayout.Toggle("Use Fixed Update", tw.useFixedUpdate);
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
tw.animationCurve = curve;
|
||||
tw.style = style;
|
||||
tw.ignoreTimeScale = ts;
|
||||
tw.tweenGroup = tg;
|
||||
tw.duration = dur;
|
||||
tw.delay = del;
|
||||
tw.delayAffects = deff;
|
||||
tw.useFixedUpdate = fx;
|
||||
}
|
||||
EndContents();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3564c93409a4aaa44a48de1e49be56ba
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 391048bfcbd4480ebaf66c91987b291f
|
||||
timeCreated: 1758179210
|
||||
@@ -0,0 +1,252 @@
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Linq;
|
||||
|
||||
namespace SkierFramework
|
||||
{
|
||||
public class ControlItemDrawer
|
||||
{
|
||||
private UIControlDataEditor _container;
|
||||
private CtrlItemData _itemData;
|
||||
private bool _foldout = true;
|
||||
private int _controlTypeIdx = 0;
|
||||
|
||||
public ControlItemDrawer(UIControlDataEditor container, CtrlItemData item)
|
||||
{
|
||||
_container = container;
|
||||
_itemData = item;
|
||||
}
|
||||
|
||||
public bool Draw()
|
||||
{
|
||||
EditorGUI.BeginChangeCheck();
|
||||
Rect rect = EditorGUILayout.BeginVertical();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
EditorGUILayout.LabelField("变量名 ", UIControlDataEditor.skin.label, GUILayout.Width(60f));
|
||||
string newName = EditorGUILayout.TextField(_itemData.name, UIControlDataEditor.skin.textField).Trim();
|
||||
|
||||
if (newName != _itemData.name)
|
||||
{
|
||||
_itemData.name = newName;
|
||||
(_container.target as UIControlData).SetDirty();
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
_foldout = EditorGUILayout.Foldout(_foldout, _foldout ? "收起" : "展开", true);
|
||||
|
||||
if (GUILayout.Button("+", EditorStyles.miniButton))
|
||||
{
|
||||
_container.AddControlAfter(this);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GUILayout.Button("-", EditorStyles.miniButton))
|
||||
{
|
||||
_container.RemoveControl(this);
|
||||
return false;
|
||||
}
|
||||
GUILayout.FlexibleSpace();
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
// 控件列表
|
||||
if (_foldout)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
EditorGUILayout.LabelField("变量类型 ", UIControlDataEditor.skin.label, GUILayout.Width(60f));
|
||||
|
||||
if (_controlTypeIdx == 0 && !string.IsNullOrEmpty(_itemData.type))
|
||||
_controlTypeIdx = FindTypeIdx(_itemData.type);
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
(_container.target as UIControlData).SetDirty();
|
||||
}
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
_controlTypeIdx = EditorGUILayout.Popup(_controlTypeIdx, _container.allTypeNames, UIControlDataEditor.popupAlignLeft);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
if(_controlTypeIdx != 0)
|
||||
{
|
||||
if (!ChangeControlsTypeTo(_controlTypeIdx))
|
||||
_controlTypeIdx = 0; // 切换失败,重置回自动
|
||||
}
|
||||
else // 被主动设置为了自动
|
||||
_itemData.type = string.Empty;
|
||||
|
||||
(_container.target as UIControlData).SetDirty();
|
||||
return false;
|
||||
}
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
GUILayout.FlexibleSpace();
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
|
||||
EditorGUILayout.Space();
|
||||
for (int i = 0, imax = _itemData.targets.Length; i < imax; i++)
|
||||
{
|
||||
Object obj = _itemData.targets[i];
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
_itemData.targets[i] = EditorGUILayout.ObjectField(obj, typeof(Object), true);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
(_container.target as UIControlData).SetDirty();
|
||||
}
|
||||
|
||||
EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.Space();
|
||||
if (GUILayout.Button("+", EditorStyles.miniButton))
|
||||
{
|
||||
InsertItem(i + 1);
|
||||
return false;
|
||||
}
|
||||
if (GUILayout.Button("-", EditorStyles.miniButton))
|
||||
{
|
||||
if(_itemData.targets.Length == 1)
|
||||
{
|
||||
Debug.LogError("至少应保留一个控件");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
RemoveItem(i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
EditorGUILayout.Space();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
if (EditorGUIUtility.isProSkin)
|
||||
GUI.Box(new Rect(rect.x - 10f, rect.y - 5f, rect.width + 20f, rect.height + 15f), "");
|
||||
else
|
||||
GUI.Box(new Rect(rect.x - 10f, rect.y - 5f, rect.width + 20f, rect.height + 15f), "", UIControlDataEditor.skin.box);
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
(_container.target as UIControlData).SetDirty();
|
||||
}
|
||||
|
||||
PostProcess();
|
||||
return true;
|
||||
}
|
||||
|
||||
private void PostProcess()
|
||||
{
|
||||
// 默认将新添加的第一个控件的名字作为变量名
|
||||
if (_itemData.targets.Length > 0 && _itemData.targets[0] != null && string.IsNullOrEmpty(_itemData.name))
|
||||
_itemData.name = _itemData.targets[0].name.Trim();
|
||||
}
|
||||
|
||||
private int FindTypeIdx(string typeName)
|
||||
{
|
||||
string[] allTypeNames = _container.allTypeNames;
|
||||
for (int i = 0, imax = allTypeNames.Length; i < imax; i++)
|
||||
{
|
||||
if(allTypeNames[i] == typeName)
|
||||
return i;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private void InsertItem(int idx)
|
||||
{
|
||||
Object[] newArr = new Object[_itemData.targets.Length + 1];
|
||||
for(int i = 0; i < idx; i++)
|
||||
{
|
||||
newArr[i] = _itemData.targets[i];
|
||||
}
|
||||
newArr[idx] = null;
|
||||
for(int i = idx + 1; i < newArr.Length; i++)
|
||||
{
|
||||
newArr[i] = _itemData.targets[i - 1];
|
||||
}
|
||||
|
||||
_itemData.targets = newArr;
|
||||
}
|
||||
|
||||
private void RemoveItem(int idx)
|
||||
{
|
||||
Object[] newArr = new Object[_itemData.targets.Length - 1];
|
||||
for(int i = 0; i < idx; i++)
|
||||
{
|
||||
newArr[i] = _itemData.targets[i];
|
||||
}
|
||||
|
||||
for(int i = idx; i < newArr.Length; i++)
|
||||
{
|
||||
newArr[idx] = _itemData.targets[i + 1];
|
||||
}
|
||||
|
||||
_itemData.targets = newArr;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将控件切换到指定类型
|
||||
/// </summary>
|
||||
/// <param name="typeIdx"></param>
|
||||
private bool ChangeControlsTypeTo(int typeIdx)
|
||||
{
|
||||
System.Type targetType = _container.allTypes[typeIdx];
|
||||
string targetTypeName = _container.allTypeNames[typeIdx];
|
||||
bool isGameObject = targetType == typeof(GameObject);
|
||||
|
||||
|
||||
for(int i = 0, imax = _itemData.targets.Length; i < imax; i++)
|
||||
{
|
||||
Object obj = _itemData.targets[i];
|
||||
if (obj == null)
|
||||
{
|
||||
Debug.LogErrorFormat("[{0}.{1}] control[{2}] is null"
|
||||
, _container.target.name, _itemData.name, i);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(obj.GetType() != typeof(GameObject))
|
||||
{
|
||||
if((obj as Component) == null)
|
||||
{
|
||||
Debug.LogErrorFormat("[{0}.{1}] control[{2}] [{3}] must be GameObject or a Component"
|
||||
, _container.target.name, _itemData.name, i, obj.name);
|
||||
return false;
|
||||
}
|
||||
obj = (obj as Component).gameObject;
|
||||
}
|
||||
|
||||
GameObject go = obj as GameObject;
|
||||
if (isGameObject)
|
||||
_itemData.targets[i] = go;
|
||||
else
|
||||
{
|
||||
Component comp = go.GetComponent(targetType);
|
||||
if(comp == null)
|
||||
{
|
||||
Debug.LogErrorFormat("[{0}.{1}] control[{2}] [{3}] isn't a {4}"
|
||||
, _container.target.name, _itemData.name, i, go.name, targetTypeName);
|
||||
return false;
|
||||
}
|
||||
_itemData.targets[i] = comp;
|
||||
}
|
||||
}
|
||||
|
||||
_itemData.type = targetTypeName;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a19fd525bc43e2439c14dac7ed67295
|
||||
timeCreated: 1521794417
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,73 @@
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SkierFramework
|
||||
{
|
||||
public class SubUIItemDrawer
|
||||
{
|
||||
private UIControlDataEditor _container;
|
||||
private SubUIItemData _itemData;
|
||||
private bool _foldout = true;
|
||||
|
||||
public SubUIItemDrawer(UIControlDataEditor container, SubUIItemData itemData)
|
||||
{
|
||||
_container = container;
|
||||
_itemData = itemData;
|
||||
}
|
||||
|
||||
public bool Draw()
|
||||
{
|
||||
Rect rect = EditorGUILayout.BeginVertical();
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
EditorGUILayout.LabelField("子UI名 ", UIControlDataEditor.skin.label);
|
||||
_itemData.name = EditorGUILayout.TextField(_itemData.name, UIControlDataEditor.skin.textField).Trim();
|
||||
EditorGUILayout.Space();
|
||||
_foldout = EditorGUILayout.Foldout(_foldout, _foldout ? "收起" : "展开", true);
|
||||
|
||||
if (GUILayout.Button("+", EditorStyles.miniButton))
|
||||
{
|
||||
_container.AddSubUIAfter(this);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GUILayout.Button("-", EditorStyles.miniButton))
|
||||
{
|
||||
_container.RemoveSubUI(this);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
|
||||
if (_foldout)
|
||||
{
|
||||
EditorGUILayout.Space();
|
||||
_itemData.subUIData = EditorGUILayout.ObjectField(_itemData.subUIData as Object, typeof(UIControlData), true) as UIControlData;
|
||||
}
|
||||
}
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
if (EditorGUIUtility.isProSkin)
|
||||
GUI.Box(new Rect(rect.x - 10f, rect.y - 5f, rect.width + 20f, rect.height + 15f), "");
|
||||
else
|
||||
GUI.Box(new Rect(rect.x - 10f, rect.y - 5f, rect.width + 20f, rect.height + 15f), "", UIControlDataEditor.skin.box);
|
||||
|
||||
PostProcess();
|
||||
return true;
|
||||
}
|
||||
|
||||
private void PostProcess()
|
||||
{
|
||||
// 默认将控件的名字作为变量名
|
||||
if (_itemData.subUIData != null && string.IsNullOrEmpty(_itemData.name))
|
||||
_itemData.name = _itemData.subUIData.name.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2db1a302384342148abb76d0508f2944
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,234 @@
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
|
||||
namespace SkierFramework
|
||||
{
|
||||
[CustomEditor(typeof(UIControlData))]
|
||||
public class UIControlDataEditor : Editor
|
||||
{
|
||||
public static GUISkin skin;
|
||||
public static GUIStyle popupAlignLeft; // TODO 挪出去一个 SkinManager
|
||||
|
||||
public string[] allTypeNames;
|
||||
public Type[] allTypes;
|
||||
|
||||
private List<CtrlItemData> _ctrlItemDatas;
|
||||
private List<SubUIItemData> _subUIItemDatas;
|
||||
|
||||
private List<ControlItemDrawer> _ctrlItemDrawers;
|
||||
private List<SubUIItemDrawer> _subUIItemDrawers;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if(skin == null)
|
||||
{
|
||||
if (EditorGUIUtility.isProSkin)
|
||||
skin = Resources.Load("Editor/UIControlDataSkinPro") as GUISkin;
|
||||
else
|
||||
skin = Resources.Load("Editor/UIControlDataSkinPersonal") as GUISkin;
|
||||
}
|
||||
|
||||
if(popupAlignLeft == null)
|
||||
{
|
||||
popupAlignLeft = new GUIStyle("Popup");
|
||||
popupAlignLeft.alignment = TextAnchor.MiddleLeft;
|
||||
}
|
||||
|
||||
allTypeNames = UIControlData.GetAllTypeNames();
|
||||
allTypes = UIControlData.GetAllTypes();
|
||||
|
||||
UIControlData uIControlData = target as UIControlData;
|
||||
if (uIControlData != null)
|
||||
{
|
||||
uIControlData.CorrectComponents();
|
||||
uIControlData.CheckSubUIs();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (skin == null || skin.customStyles == null || skin.customStyles.Length == 0)
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
return;
|
||||
}
|
||||
|
||||
UIControlData data = target as UIControlData;
|
||||
if(data.ctrlItemDatas == null)
|
||||
data.ctrlItemDatas = new List<CtrlItemData>();
|
||||
|
||||
if(data.subUIItemDatas == null)
|
||||
data.subUIItemDatas = new List<SubUIItemData>();
|
||||
|
||||
_ctrlItemDatas = data.ctrlItemDatas;
|
||||
_subUIItemDatas = data.subUIItemDatas;
|
||||
CheckDrawers();
|
||||
|
||||
EditorGUILayout.BeginVertical();
|
||||
EditorGUILayout.Space();
|
||||
|
||||
|
||||
// 绘制控件绑定
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.LabelField("控件绑定", skin.customStyles[0]);
|
||||
if(_ctrlItemDrawers.Count == 0)
|
||||
{
|
||||
if(GUILayout.Button("+", EditorStyles.miniButton))
|
||||
{
|
||||
AddControlAfter(-1);
|
||||
Repaint();
|
||||
return;
|
||||
}
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
foreach (var drawer in _ctrlItemDrawers)
|
||||
{
|
||||
GUILayout.Space(10f);
|
||||
if (!drawer.Draw())
|
||||
{
|
||||
Repaint();
|
||||
return;
|
||||
}
|
||||
GUILayout.Space(10f);
|
||||
}
|
||||
|
||||
GUILayout.Space(10f);
|
||||
|
||||
// 绘制子UI
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.LabelField("子UI绑定", skin.customStyles[0]);
|
||||
if(_subUIItemDrawers.Count == 0)
|
||||
{
|
||||
if (GUILayout.Button("+", EditorStyles.miniButton))
|
||||
{
|
||||
AddSubUIAfter(-1);
|
||||
Repaint();
|
||||
return;
|
||||
}
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
foreach(var drawer in _subUIItemDrawers)
|
||||
{
|
||||
GUILayout.Space(10f);
|
||||
if (!drawer.Draw())
|
||||
{
|
||||
Repaint();
|
||||
return;
|
||||
}
|
||||
GUILayout.Space(10f);
|
||||
}
|
||||
|
||||
EditorGUILayout.Space(); EditorGUILayout.Space();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
this.Repaint();
|
||||
}
|
||||
|
||||
public void AddControlAfter(ControlItemDrawer drawer)
|
||||
{
|
||||
int idx = _ctrlItemDrawers.IndexOf(drawer);
|
||||
Debug.Assert(idx != -1);
|
||||
|
||||
AddControlAfter(idx);
|
||||
}
|
||||
|
||||
public void AddSubUIAfter(SubUIItemDrawer drawer)
|
||||
{
|
||||
int idx = _subUIItemDrawers.IndexOf(drawer);
|
||||
Debug.Assert(idx != -1);
|
||||
|
||||
AddSubUIAfter(idx);
|
||||
}
|
||||
|
||||
public void RemoveControl(ControlItemDrawer drawer)
|
||||
{
|
||||
int idx = _ctrlItemDrawers.IndexOf(drawer);
|
||||
Debug.Assert(idx != -1);
|
||||
|
||||
RemoveControl(idx);
|
||||
}
|
||||
|
||||
public void RemoveSubUI(SubUIItemDrawer drawer)
|
||||
{
|
||||
int idx = _subUIItemDrawers.IndexOf(drawer);
|
||||
Debug.Assert(idx != -1);
|
||||
|
||||
RemoveSubUI(idx);
|
||||
}
|
||||
|
||||
#region Private
|
||||
private void CheckDrawers()
|
||||
{
|
||||
if (_ctrlItemDrawers == null)
|
||||
{
|
||||
_ctrlItemDrawers = new List<ControlItemDrawer>(100);
|
||||
foreach(var item in _ctrlItemDatas)
|
||||
{
|
||||
ControlItemDrawer drawer = new ControlItemDrawer(this, item);
|
||||
_ctrlItemDrawers.Add(drawer);
|
||||
}
|
||||
}
|
||||
|
||||
if(_subUIItemDrawers == null)
|
||||
{
|
||||
_subUIItemDrawers = new List<SubUIItemDrawer>(100);
|
||||
foreach(var item in _subUIItemDatas)
|
||||
{
|
||||
SubUIItemDrawer drawer = new SubUIItemDrawer(this, item);
|
||||
_subUIItemDrawers.Add(drawer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void AddControlAfter(int idx)
|
||||
{
|
||||
CtrlItemData itemData = new CtrlItemData();
|
||||
_ctrlItemDatas.Insert(idx + 1, itemData);
|
||||
|
||||
ControlItemDrawer drawer = new ControlItemDrawer(this, itemData);
|
||||
_ctrlItemDrawers.Insert(idx + 1, drawer);
|
||||
|
||||
SetPrefabDirty();
|
||||
}
|
||||
|
||||
private void AddSubUIAfter(int idx)
|
||||
{
|
||||
SubUIItemData itemData = new SubUIItemData();
|
||||
_subUIItemDatas.Insert(idx + 1, itemData);
|
||||
|
||||
SubUIItemDrawer drawer = new SubUIItemDrawer(this, itemData);
|
||||
_subUIItemDrawers.Insert(idx + 1, drawer);
|
||||
|
||||
SetPrefabDirty();
|
||||
}
|
||||
|
||||
private void RemoveControl(int idx)
|
||||
{
|
||||
_ctrlItemDatas.RemoveAt(idx);
|
||||
_ctrlItemDrawers.RemoveAt(idx);
|
||||
|
||||
SetPrefabDirty();
|
||||
}
|
||||
|
||||
private void RemoveSubUI(int idx)
|
||||
{
|
||||
_subUIItemDatas.RemoveAt(idx);
|
||||
_subUIItemDrawers.RemoveAt(idx);
|
||||
|
||||
SetPrefabDirty();
|
||||
}
|
||||
|
||||
private void SetPrefabDirty()
|
||||
{
|
||||
UIControlData uIControlData = target as UIControlData;
|
||||
uIControlData.SetDirty();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 27c41d595322d554a9afea0d2b516863
|
||||
timeCreated: 1521786373
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,564 @@
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
using SkierFramework;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using YooAsset.Editor;
|
||||
|
||||
public class UICreateWindow : EditorWindow
|
||||
{
|
||||
#region MenuItem
|
||||
|
||||
[MenuItem("Assets/Create/CreateUI")]
|
||||
private static void CopyUI()
|
||||
{
|
||||
if (Selection.activeObject == null || !(Selection.activeObject is GameObject))
|
||||
{
|
||||
Debug.LogError("请选择UI预制体!");
|
||||
return;
|
||||
}
|
||||
|
||||
UICreateWindow.OpenWindow().uiPrefab = Selection.activeObject as GameObject;
|
||||
}
|
||||
|
||||
[MenuItem("Tools/UI管理")]
|
||||
public static UICreateWindow OpenWindow()
|
||||
{
|
||||
var window = GetWindow<UICreateWindow>("UI管理");
|
||||
if (window == null)
|
||||
{
|
||||
window = CreateWindow<UICreateWindow>("UI管理");
|
||||
}
|
||||
|
||||
window.name = "UI管理";
|
||||
window.Focus();
|
||||
return window;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private string _packageName;
|
||||
private string _mInput;
|
||||
|
||||
private Vector2 _scroll;
|
||||
private Vector2 _scroll2;
|
||||
private Vector2 _scroll3;
|
||||
private string _uiViewTemplate = "UIViewTemplate";
|
||||
private string _uiConfig = "UIConfig";
|
||||
private string _uiType = "UIType";
|
||||
private string _saveUIPath = "SaveUIPath";
|
||||
private string _uiName;
|
||||
public GameObject uiPrefab;
|
||||
private Dictionary<string, string> _uiNames = new Dictionary<string, string>();
|
||||
private Dictionary<string, UIConfigJson> _uiJsonDatas = new Dictionary<string, UIConfigJson>();
|
||||
|
||||
private bool _isWindow = true;
|
||||
private UILayer _layer = UILayer.NormalLayer;
|
||||
|
||||
private IEnumerable<Type> uiViews;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
TryGetPath(ref _uiViewTemplate, _uiViewTemplate, ".txt");
|
||||
TryGetPath(ref _uiType, _uiType, ".cs");
|
||||
TryGetPath(ref _uiConfig, _uiConfig, ".json");
|
||||
_saveUIPath = PlayerPrefs.GetString(_saveUIPath, "Assets/Scripts");
|
||||
|
||||
_uiJsonDatas.Clear();
|
||||
_uiNames.Clear();
|
||||
// string[] strs = Enum.GetNames(typeof(UIType));
|
||||
uiViews = ReflectionHelper.GetAllUIViewTypes();
|
||||
foreach (var uiView in uiViews)
|
||||
{
|
||||
string str = uiView.Name;
|
||||
if (str.Equals("Max")) continue;
|
||||
|
||||
var jsonData = GetUIJson(str);
|
||||
if (jsonData == null || string.IsNullOrEmpty(jsonData.path)) continue;
|
||||
var scriptPath = GetUIScript(str, true);
|
||||
_uiNames.AddOrUpdate(str, scriptPath);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
EditorGUILayout.LabelField("通过[Tools/UI管理]可以打开");
|
||||
_scroll = EditorGUILayout.BeginScrollView(_scroll);
|
||||
{
|
||||
EditorGUILayout.HelpBox("UI基础文件", MessageType.Info);
|
||||
{
|
||||
_packageName = StringInputFild("PackageName", "UIPackageName");
|
||||
PathField("UI模板文件.txt", ref _uiViewTemplate, nameof(_uiViewTemplate), ".txt");
|
||||
PathField("UI配置文件.json", ref _uiConfig, nameof(_uiConfig), ".json");
|
||||
PathField("UIType.cs", ref _uiType, nameof(_uiType), ".cs");
|
||||
}
|
||||
EditorGUILayout.Space(10);
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
_scroll2 = EditorGUILayout.BeginScrollView(_scroll2, "box", GUILayout.Width(position.width * 0.4f - 6));
|
||||
{
|
||||
EditorGUILayout.HelpBox("已创建的UI", MessageType.Info);
|
||||
_mInput = EditorGUILayout.TextField(_mInput, EditorStyles.toolbarSearchField, GUILayout.Height(20));
|
||||
//string[] strs = Enum.GetNames(typeof(UIType));
|
||||
foreach (var uiView in uiViews)
|
||||
{
|
||||
string str = uiView.Name;
|
||||
if (str.Equals("Max")) continue;
|
||||
if (!string.IsNullOrEmpty(_mInput) && !str.Contains(_mInput)) continue;
|
||||
|
||||
var jsonData = GetUIJson(str);
|
||||
var scriptPath = GetUIScript(str);
|
||||
if (jsonData == null || string.IsNullOrEmpty(jsonData.path) ||
|
||||
string.IsNullOrEmpty(scriptPath)) continue;
|
||||
|
||||
var defaultColor = GUI.color;
|
||||
if (str.Equals(_uiName))
|
||||
{
|
||||
GUI.color = Color.yellow;
|
||||
}
|
||||
|
||||
EditorGUILayout.BeginHorizontal("box");
|
||||
if (GUILayout.Button("选中"))
|
||||
{
|
||||
uiPrefab = AssetDatabase.LoadAssetAtPath<GameObject>(jsonData.path);
|
||||
}
|
||||
|
||||
EditorGUILayout.ObjectField(AssetDatabase.LoadAssetAtPath<GameObject>(jsonData.path),
|
||||
typeof(GameObject), true);
|
||||
EditorGUILayout.ObjectField(AssetDatabase.LoadAssetAtPath<TextAsset>(scriptPath),
|
||||
typeof(TextAsset), true);
|
||||
EditorGUILayout.EndHorizontal();
|
||||
GUI.color = defaultColor;
|
||||
}
|
||||
|
||||
if (GUILayout.Button("标记资源"))
|
||||
{
|
||||
Mask();
|
||||
}
|
||||
}
|
||||
EditorGUILayout.EndScrollView();
|
||||
_scroll3 = EditorGUILayout.BeginScrollView(_scroll3, "box", GUILayout.Width(position.width * 0.6f - 6));
|
||||
{
|
||||
EditorGUILayout.HelpBox("UI操作", MessageType.Info);
|
||||
uiPrefab = EditorGUILayout.ObjectField("UI预制体", uiPrefab, typeof(GameObject), true) as GameObject;
|
||||
if (uiPrefab != null)
|
||||
{
|
||||
_uiName = uiPrefab.name;
|
||||
var uiScriptPath = GetUIScript(_uiName);
|
||||
if (string.IsNullOrEmpty(uiScriptPath))
|
||||
{
|
||||
if (GUILayout.Button($"选择创建路径:{_saveUIPath}"))
|
||||
{
|
||||
var newPath = EditorUtility.OpenFolderPanel("UI生成路径", _saveUIPath, "");
|
||||
_saveUIPath = newPath.Replace(Application.dataPath, "Assets");
|
||||
PlayerPrefs.SetString(nameof(_saveUIPath), _saveUIPath);
|
||||
}
|
||||
|
||||
if (uiPrefab != null)
|
||||
{
|
||||
EditorGUILayout.TextField("UI生成路径", $"{_saveUIPath}/{_uiName}.cs");
|
||||
}
|
||||
|
||||
_isWindow = EditorGUILayout.Toggle("是否为窗口", _isWindow);
|
||||
_layer = (UILayer)EditorGUILayout.EnumPopup("UILayer设置", _layer);
|
||||
|
||||
var defaultColor = GUI.color;
|
||||
GUI.color = Color.green;
|
||||
if (GUILayout.Button("创建UI"))
|
||||
{
|
||||
// 生成代码
|
||||
string str = Regex.Replace(File.ReadAllText(_uiViewTemplate), "UIXXXView", _uiName);
|
||||
UIControlData uiControlData = uiPrefab.GetComponent<UIControlData>();
|
||||
if (uiControlData != null)
|
||||
{
|
||||
uiControlData.CopyCodeToClipBoardPrivate();
|
||||
}
|
||||
|
||||
str = Regex.Replace(str, "//UIControlData",
|
||||
uiControlData != null ? UnityEngine.GUIUtility.systemCopyBuffer : "");
|
||||
string newPath = $"{_saveUIPath}/{_uiName}.cs";
|
||||
File.WriteAllText(newPath, str);
|
||||
|
||||
var jsonData = new UIConfigJson
|
||||
{
|
||||
uiType = _uiName,
|
||||
path = AssetDatabase.GetAssetPath(uiPrefab),
|
||||
isWindow = _isWindow,
|
||||
uiLayer = _layer.ToString(),
|
||||
};
|
||||
|
||||
_uiJsonDatas.Add(_uiName, jsonData);
|
||||
_uiNames.Add(_uiName, newPath);
|
||||
SaveJson();
|
||||
|
||||
// 生成UIType
|
||||
var newStr = Regex.Replace(File.ReadAllText(_uiType), "Max,", $"{_uiName},\n\t\tMax,");
|
||||
File.Delete(_uiType);
|
||||
File.WriteAllText(_uiType, newStr);
|
||||
|
||||
Debug.Log("生成成功:" + newPath);
|
||||
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
|
||||
GUI.color = defaultColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
var jsonData = GetUIJson(_uiName);
|
||||
if (UnityEditor.PrefabUtility.IsPartOfPrefabAsset(uiPrefab))
|
||||
{
|
||||
// 预制体资源就是自身
|
||||
jsonData.path = UnityEditor.AssetDatabase.GetAssetPath(uiPrefab);
|
||||
}
|
||||
|
||||
EditorGUILayout.ObjectField("已创建脚本",
|
||||
AssetDatabase.LoadAssetAtPath(uiScriptPath, typeof(TextAsset)), typeof(TextAsset),
|
||||
true);
|
||||
jsonData.isWindow = EditorGUILayout.Toggle("是否为窗口", jsonData.isWindow);
|
||||
Enum.TryParse(jsonData.uiLayer, out UILayer layer);
|
||||
jsonData.uiLayer = EditorGUILayout.EnumPopup("UILayer设置", layer).ToString();
|
||||
|
||||
var defaultColor = GUI.color;
|
||||
GUI.color = Color.green;
|
||||
if (GUILayout.Button("保存设置"))
|
||||
{
|
||||
SaveJson();
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
|
||||
GUI.color = defaultColor;
|
||||
|
||||
GUI.color = Color.red;
|
||||
if (GUILayout.Button("删除UI脚本"))
|
||||
{
|
||||
if (EditorUtility.DisplayDialog("是否确认删除",
|
||||
$"请确认是否删除:\n{uiScriptPath}\n同时会清除Json,UIType中相关数据", "确定", "取消"))
|
||||
{
|
||||
// 清除UIType中指定类型
|
||||
var uiTypeStr = File.ReadAllText(_uiType);
|
||||
int index = uiTypeStr.IndexOf(_uiName);
|
||||
int leftIndex = uiTypeStr.Substring(0, index).LastIndexOf(',') + 1;
|
||||
int rightIndex = uiTypeStr.Substring(index, uiTypeStr.Length - index).IndexOf(',') +
|
||||
index + 1;
|
||||
var newStr = uiTypeStr.Substring(0, leftIndex) +
|
||||
uiTypeStr.Substring(rightIndex, uiTypeStr.Length - rightIndex);
|
||||
File.Delete(_uiType);
|
||||
File.WriteAllText(_uiType, newStr);
|
||||
// 清除UIConfig中的指定类型
|
||||
_uiJsonDatas.Remove(_uiName);
|
||||
_uiNames.Remove(_uiName);
|
||||
SaveJson();
|
||||
// 删除文件
|
||||
File.Delete(uiScriptPath);
|
||||
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
_uiNames.Remove(_uiName);
|
||||
}
|
||||
}
|
||||
|
||||
GUI.color = defaultColor;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_uiName = "";
|
||||
}
|
||||
}
|
||||
EditorGUILayout.EndScrollView();
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
EditorGUILayout.EndScrollView();
|
||||
}
|
||||
|
||||
private void SaveJson()
|
||||
{
|
||||
List<UIConfigJson> list = new List<UIConfigJson>();
|
||||
foreach (var name in _uiNames.Keys)
|
||||
{
|
||||
if (_uiJsonDatas.TryGetValue(name, out var data))
|
||||
{
|
||||
list.Add(data);
|
||||
}
|
||||
}
|
||||
|
||||
File.Delete(_uiConfig);
|
||||
File.WriteAllText(_uiConfig, JsonConvert.SerializeObject(list, Formatting.Indented));
|
||||
}
|
||||
|
||||
private void TryGetPath(ref string path, string pathName, string endsWith)
|
||||
{
|
||||
path = PlayerPrefs.GetString(pathName);
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
string[] ids = AssetDatabase.FindAssets(pathName);
|
||||
if (ids != null)
|
||||
{
|
||||
foreach (var id in ids)
|
||||
{
|
||||
var str = AssetDatabase.GUIDToAssetPath(id);
|
||||
if (str.EndsWith(endsWith))
|
||||
{
|
||||
path = str;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string GetUIScript(string name, bool tryFind = false)
|
||||
{
|
||||
if (_uiNames.TryGetValue(name, out string path))
|
||||
{
|
||||
return path;
|
||||
}
|
||||
|
||||
if (!tryFind)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
if (GetUIJson(name) == null) return string.Empty;
|
||||
|
||||
string[] ids = AssetDatabase.FindAssets(name);
|
||||
if (ids != null)
|
||||
{
|
||||
foreach (var id in ids)
|
||||
{
|
||||
var str = AssetDatabase.GUIDToAssetPath(id);
|
||||
if (str.EndsWith(".cs"))
|
||||
{
|
||||
return str;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
private UIConfigJson GetUIJson(string name)
|
||||
{
|
||||
if (_uiJsonDatas.Count == 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
var json = File.ReadAllText(_uiConfig);
|
||||
var list = JsonConvert.DeserializeObject<List<UIConfigJson>>(json);
|
||||
foreach (var item in list)
|
||||
{
|
||||
_uiJsonDatas.AddOrUpdate(item.uiType, item);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(e);
|
||||
}
|
||||
}
|
||||
|
||||
if (_uiJsonDatas.TryGetValue(name, out var jsonData))
|
||||
{
|
||||
return jsonData;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private string StringInputFild(string name, string endsWith)
|
||||
{
|
||||
string value = PlayerPrefs.GetString(name);
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(endsWith))
|
||||
{
|
||||
PlayerPrefs.SetString(name, endsWith);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
endsWith = value;
|
||||
}
|
||||
|
||||
return EditorGUILayout.TextField(name, endsWith);
|
||||
}
|
||||
|
||||
private void PathField(string name, ref string path, string pathName, string endsWith)
|
||||
{
|
||||
var obj = EditorGUILayout.ObjectField(name, AssetDatabase.LoadAssetAtPath(path, typeof(TextAsset)),
|
||||
typeof(TextAsset), true);
|
||||
if (obj != null)
|
||||
{
|
||||
var newPath = AssetDatabase.GetAssetPath(obj);
|
||||
if (newPath.EndsWith(endsWith) && !newPath.Equals(path))
|
||||
{
|
||||
path = newPath;
|
||||
PlayerPrefs.SetString(pathName, path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region Mask
|
||||
|
||||
public void Mask()
|
||||
{
|
||||
// //清空主包旧数据
|
||||
AssetBundleCollectorPackage assetBundleCollectorPackage = null;
|
||||
foreach (var package in AssetBundleCollectorSettingData.Setting.Packages)
|
||||
{
|
||||
if (package.PackageName == _packageName)
|
||||
{
|
||||
assetBundleCollectorPackage = package;
|
||||
}
|
||||
}
|
||||
|
||||
if (assetBundleCollectorPackage == null)
|
||||
{
|
||||
var setting = YooAsset.Editor.AssetBundleCollectorSettingData.Setting;
|
||||
setting.ShowPackageView = true;
|
||||
setting.UniqueBundleName = true;
|
||||
//创建Package文件
|
||||
assetBundleCollectorPackage = YooAsset.Editor.AssetBundleCollectorSettingData.CreatePackage(_packageName);
|
||||
}
|
||||
|
||||
//检测Packages是否存在TestPackage
|
||||
assetBundleCollectorPackage.PackageName = _packageName;
|
||||
assetBundleCollectorPackage.EnableAddressable = false;
|
||||
assetBundleCollectorPackage.IncludeAssetGUID = true;
|
||||
assetBundleCollectorPackage.AutoCollectShaders = true;
|
||||
assetBundleCollectorPackage.IgnoreRuleName = "NormalIgnoreRule";
|
||||
|
||||
//标记json配置文件
|
||||
if (!string.IsNullOrEmpty(_uiConfig))
|
||||
{
|
||||
var collectorGroup = ReflectionHelper.RemoveGroup(assetBundleCollectorPackage, "Config");
|
||||
var guid = ReflectionHelper.GetGUIDByRelativePath(_uiConfig);
|
||||
AssetBundleCollector collector = new AssetBundleCollector()
|
||||
{
|
||||
CollectPath = _uiConfig,
|
||||
CollectorGUID = guid,
|
||||
CollectorType = ECollectorType.MainAssetCollector,
|
||||
AddressRuleName = nameof(AddressByFolderAndFileName),
|
||||
};
|
||||
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(collectorGroup, collector);
|
||||
}
|
||||
|
||||
//标记预制体
|
||||
foreach (var data in _uiJsonDatas)
|
||||
{
|
||||
var collectorGroup = ReflectionHelper.RemoveGroup(assetBundleCollectorPackage, "Prefab");
|
||||
|
||||
|
||||
var guid = ReflectionHelper.GetGUIDByRelativePath(data.Value.path);
|
||||
AssetBundleCollector collector = new AssetBundleCollector()
|
||||
{
|
||||
CollectPath = data.Value.path,
|
||||
CollectorGUID = guid,
|
||||
CollectorType = ECollectorType.MainAssetCollector,
|
||||
AddressRuleName = nameof(AddressByFolderAndFileName),
|
||||
AssetTags = data.Value.uiLayer.ToString(),
|
||||
};
|
||||
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(collectorGroup, collector);
|
||||
}
|
||||
|
||||
YooAsset.Editor.AssetBundleCollectorSettingData.SaveFile();
|
||||
|
||||
Debug.Log("MarkAsset Successful");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static class ReflectionHelper
|
||||
{
|
||||
public static IEnumerable<T> CreateAllInstancesOf<T>()
|
||||
{
|
||||
return typeof(ReflectionHelper).Assembly.GetTypes() //获取当前类库下所有类型
|
||||
.Where(t => typeof(T).IsAssignableFrom(t)) //获取间接或直接继承t的所有类型
|
||||
.Where(t => !t.IsAbstract && t.IsClass) //获取非抽象类 排除接口继承
|
||||
.Select(t => (T)Activator.CreateInstance(t)); //创造实例,并返回结果(项目需求,可删除)
|
||||
}
|
||||
|
||||
// 新增方法:专门用于查找UIView类型的所有实现类
|
||||
public static IEnumerable<Type> GetAllUIViewTypes()
|
||||
{
|
||||
// 查找所有程序集中的UIView类型实现
|
||||
var uiviewType = typeof(UIView);
|
||||
List<Type> result = new List<Type>();
|
||||
|
||||
// 遍历所有已加载的程序集
|
||||
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
|
||||
{
|
||||
try
|
||||
{
|
||||
result.AddRange(assembly.GetTypes()
|
||||
.Where(t => uiviewType.IsAssignableFrom(t))
|
||||
.Where(t => !t.IsAbstract && t.IsClass));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// 忽略无法访问的程序集
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据相对路径获取资源的GUID
|
||||
/// </summary>
|
||||
/// <param name="relativePath">相对于Assets目录的路径,例如:"Assets/UI/Prefabs/LoginPanel.prefab"</param>
|
||||
/// <returns>资源的GUID字符串,如果路径无效则返回空字符串</returns>
|
||||
public static string GetGUIDByRelativePath(string relativePath)
|
||||
{
|
||||
// 检查路径是否为空
|
||||
if (string.IsNullOrEmpty(relativePath))
|
||||
{
|
||||
Debug.LogError("相对路径不能为空");
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
// 检查路径是否存在
|
||||
if (!AssetDatabase.IsValidFolder(Path.GetDirectoryName(relativePath)) &&
|
||||
!System.IO.File.Exists(Path.Combine(Application.dataPath, relativePath.Replace("Assets/", ""))))
|
||||
{
|
||||
Debug.LogError(string.Format("路径不存在: {0}", relativePath));
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
// 获取GUID
|
||||
string guid = AssetDatabase.AssetPathToGUID(relativePath);
|
||||
|
||||
if (string.IsNullOrEmpty(guid))
|
||||
{
|
||||
Debug.LogWarning(string.Format("无法获取路径的GUID: {0}", relativePath));
|
||||
}
|
||||
|
||||
return guid;
|
||||
}
|
||||
|
||||
public static AssetBundleCollectorGroup RemoveGroup(AssetBundleCollectorPackage package, string groupName)
|
||||
{
|
||||
//删除的Group
|
||||
var groupToDelete = package.Groups.FirstOrDefault(g => g.GroupName == groupName);
|
||||
|
||||
if (groupToDelete == null)
|
||||
{
|
||||
UnityEngine.Debug.LogError($"在Package中未找到Group '{groupName}'!");
|
||||
}
|
||||
|
||||
// 3. 从Package的Groups集合中删除该Group
|
||||
package.Groups.Remove(groupToDelete);
|
||||
return YooAsset.Editor.AssetBundleCollectorSettingData.CreateGroup(package, groupName);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 96a0d05f5869aed43bd7ab82a8bd430c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
|
||||
namespace SkierFramework
|
||||
{
|
||||
public class UIXXXView : UIView
|
||||
{
|
||||
//UIControlData
|
||||
|
||||
public override void OnInit(UIControlData uIControlData, UIViewController controller)
|
||||
{
|
||||
base.OnInit(uIControlData, controller);
|
||||
}
|
||||
|
||||
public override void OnOpen(object userData)
|
||||
{
|
||||
base.OnOpen(userData);
|
||||
}
|
||||
|
||||
public override void OnAddListener()
|
||||
{
|
||||
base.OnAddListener();
|
||||
}
|
||||
|
||||
public override void OnRemoveListener()
|
||||
{
|
||||
base.OnRemoveListener();
|
||||
}
|
||||
|
||||
public override void OnClose()
|
||||
{
|
||||
base.OnClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca37d3bfaabc8124cabb4b71f309b4c5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 125226ccd07f47c5bf3b94157bf12fc3
|
||||
timeCreated: 1758179120
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f6e218215da269c45b6b578b4eb0da12
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,268 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SkierFramework
|
||||
{
|
||||
|
||||
public enum AnchorPresets
|
||||
{
|
||||
TopLeft,
|
||||
TopCenter,
|
||||
TopRight,
|
||||
|
||||
MiddleLeft,
|
||||
MiddleCenter,
|
||||
MiddleRight,
|
||||
|
||||
BottomLeft,
|
||||
BottonCenter,
|
||||
BottomRight,
|
||||
BottomStretch,
|
||||
|
||||
VertStretchLeft,
|
||||
VertStretchRight,
|
||||
VertStretchCenter,
|
||||
|
||||
HorStretchTop,
|
||||
HorStretchMiddle,
|
||||
HorStretchBottom,
|
||||
|
||||
StretchAll
|
||||
}
|
||||
|
||||
public enum PivotPresets
|
||||
{
|
||||
TopLeft,
|
||||
TopCenter,
|
||||
TopRight,
|
||||
|
||||
MiddleLeft,
|
||||
MiddleCenter,
|
||||
MiddleRight,
|
||||
|
||||
BottomLeft,
|
||||
BottomCenter,
|
||||
BottomRight,
|
||||
}
|
||||
|
||||
public static class UIExtension
|
||||
{
|
||||
public static void SetAnchor(this RectTransform source, AnchorPresets allign, int offsetX = 0, int offsetY = 0)
|
||||
{
|
||||
source.anchoredPosition = new Vector3(offsetX, offsetY, 0);
|
||||
|
||||
switch (allign)
|
||||
{
|
||||
case (AnchorPresets.TopLeft):
|
||||
{
|
||||
source.anchorMin = new Vector2(0, 1);
|
||||
source.anchorMax = new Vector2(0, 1);
|
||||
break;
|
||||
}
|
||||
case (AnchorPresets.TopCenter):
|
||||
{
|
||||
source.anchorMin = new Vector2(0.5f, 1);
|
||||
source.anchorMax = new Vector2(0.5f, 1);
|
||||
break;
|
||||
}
|
||||
case (AnchorPresets.TopRight):
|
||||
{
|
||||
source.anchorMin = new Vector2(1, 1);
|
||||
source.anchorMax = new Vector2(1, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
case (AnchorPresets.MiddleLeft):
|
||||
{
|
||||
source.anchorMin = new Vector2(0, 0.5f);
|
||||
source.anchorMax = new Vector2(0, 0.5f);
|
||||
break;
|
||||
}
|
||||
case (AnchorPresets.MiddleCenter):
|
||||
{
|
||||
source.anchorMin = new Vector2(0.5f, 0.5f);
|
||||
source.anchorMax = new Vector2(0.5f, 0.5f);
|
||||
break;
|
||||
}
|
||||
case (AnchorPresets.MiddleRight):
|
||||
{
|
||||
source.anchorMin = new Vector2(1, 0.5f);
|
||||
source.anchorMax = new Vector2(1, 0.5f);
|
||||
break;
|
||||
}
|
||||
|
||||
case (AnchorPresets.BottomLeft):
|
||||
{
|
||||
source.anchorMin = new Vector2(0, 0);
|
||||
source.anchorMax = new Vector2(0, 0);
|
||||
break;
|
||||
}
|
||||
case (AnchorPresets.BottonCenter):
|
||||
{
|
||||
source.anchorMin = new Vector2(0.5f, 0);
|
||||
source.anchorMax = new Vector2(0.5f, 0);
|
||||
break;
|
||||
}
|
||||
case (AnchorPresets.BottomRight):
|
||||
{
|
||||
source.anchorMin = new Vector2(1, 0);
|
||||
source.anchorMax = new Vector2(1, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
case (AnchorPresets.HorStretchTop):
|
||||
{
|
||||
source.anchorMin = new Vector2(0, 1);
|
||||
source.anchorMax = new Vector2(1, 1);
|
||||
break;
|
||||
}
|
||||
case (AnchorPresets.HorStretchMiddle):
|
||||
{
|
||||
source.anchorMin = new Vector2(0, 0.5f);
|
||||
source.anchorMax = new Vector2(1, 0.5f);
|
||||
break;
|
||||
}
|
||||
case (AnchorPresets.HorStretchBottom):
|
||||
{
|
||||
source.anchorMin = new Vector2(0, 0);
|
||||
source.anchorMax = new Vector2(1, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
case (AnchorPresets.VertStretchLeft):
|
||||
{
|
||||
source.anchorMin = new Vector2(0, 0);
|
||||
source.anchorMax = new Vector2(0, 1);
|
||||
break;
|
||||
}
|
||||
case (AnchorPresets.VertStretchCenter):
|
||||
{
|
||||
source.anchorMin = new Vector2(0.5f, 0);
|
||||
source.anchorMax = new Vector2(0.5f, 1);
|
||||
break;
|
||||
}
|
||||
case (AnchorPresets.VertStretchRight):
|
||||
{
|
||||
source.anchorMin = new Vector2(1, 0);
|
||||
source.anchorMax = new Vector2(1, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
case (AnchorPresets.StretchAll):
|
||||
{
|
||||
source.anchorMin = new Vector2(0, 0);
|
||||
source.anchorMax = new Vector2(1, 1);
|
||||
source.sizeDelta = Vector2.zero;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetPivot(this RectTransform source, PivotPresets preset)
|
||||
{
|
||||
|
||||
switch (preset)
|
||||
{
|
||||
case (PivotPresets.TopLeft):
|
||||
{
|
||||
source.pivot = new Vector2(0, 1);
|
||||
break;
|
||||
}
|
||||
case (PivotPresets.TopCenter):
|
||||
{
|
||||
source.pivot = new Vector2(0.5f, 1);
|
||||
break;
|
||||
}
|
||||
case (PivotPresets.TopRight):
|
||||
{
|
||||
source.pivot = new Vector2(1, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
case (PivotPresets.MiddleLeft):
|
||||
{
|
||||
source.pivot = new Vector2(0, 0.5f);
|
||||
break;
|
||||
}
|
||||
case (PivotPresets.MiddleCenter):
|
||||
{
|
||||
source.pivot = new Vector2(0.5f, 0.5f);
|
||||
break;
|
||||
}
|
||||
case (PivotPresets.MiddleRight):
|
||||
{
|
||||
source.pivot = new Vector2(1, 0.5f);
|
||||
break;
|
||||
}
|
||||
|
||||
case (PivotPresets.BottomLeft):
|
||||
{
|
||||
source.pivot = new Vector2(0, 0);
|
||||
break;
|
||||
}
|
||||
case (PivotPresets.BottomCenter):
|
||||
{
|
||||
source.pivot = new Vector2(0.5f, 0);
|
||||
break;
|
||||
}
|
||||
case (PivotPresets.BottomRight):
|
||||
{
|
||||
source.pivot = new Vector2(1, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static CanvasGroup CreateBlackMask(Transform parent, float alpha = 0, string name = null)
|
||||
{
|
||||
GameObject maskGo = new GameObject("Black Mask");
|
||||
RectTransform rectTransform = maskGo.AddComponent<RectTransform>();
|
||||
rectTransform.SetParentEx(parent);
|
||||
rectTransform.anchorMin = Vector2.zero;
|
||||
rectTransform.anchorMax = Vector2.one;
|
||||
Image image = maskGo.AddComponent<Image>();
|
||||
image.color = Color.black;
|
||||
image.raycastTarget = false;
|
||||
CanvasGroup canvasGroup = maskGo.AddComponent<CanvasGroup>();
|
||||
canvasGroup.alpha = alpha;
|
||||
if(name != null)
|
||||
canvasGroup.name = name;
|
||||
return canvasGroup;
|
||||
}
|
||||
|
||||
public static Canvas CreateLayerCanvas(UILayer layer, bool is3D, Transform parent, Camera camera, float width, float height)
|
||||
{
|
||||
GameObject canvasGo = new GameObject(layer.ToString());
|
||||
RectTransform rectTransform = canvasGo.AddComponent<RectTransform>();
|
||||
rectTransform.SetParentEx(parent);
|
||||
rectTransform.anchorMin = Vector2.zero;
|
||||
rectTransform.anchorMax = Vector2.one;
|
||||
canvasGo.layer = is3D ? Layer.Default : Layer.UI;
|
||||
Canvas canvas = canvasGo.AddComponent<Canvas>();
|
||||
canvas.renderMode = is3D ? RenderMode.WorldSpace : RenderMode.ScreenSpaceCamera;
|
||||
canvas.overrideSorting = true;
|
||||
canvas.sortingOrder = (int)layer;
|
||||
canvas.worldCamera = camera;
|
||||
canvas.pixelPerfect = false;
|
||||
CanvasScaler canvasScaler = canvasGo.AddComponent<CanvasScaler>();
|
||||
canvasScaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize;
|
||||
canvasScaler.referenceResolution = new Vector2(height,width);
|
||||
canvasScaler.screenMatchMode = CanvasScaler.ScreenMatchMode.Expand;
|
||||
|
||||
canvasGo.AddComponent<GraphicRaycaster>();
|
||||
|
||||
return canvas;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 为方便统一处理点击音效等
|
||||
/// </summary>
|
||||
public static void AddClick(this Button button, UnityAction callback)
|
||||
{
|
||||
button.onClick.AddListener(callback);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b521dcf8e49760e4fa28db6a6436ebc3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab9e1d815209d5e469824bfa1bbc399c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SkierFramework
|
||||
{
|
||||
public static class Layer
|
||||
{
|
||||
public const int Default = 0;
|
||||
public const int TransparentFX = 1;
|
||||
public const int IgnoreRaycast = 2;
|
||||
public const int Water = 4;
|
||||
public const int UI = 5;
|
||||
public const int UIRenderToTarget = 6;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f57fecb20b667bb45a6240fd6b16fc80
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SkierFramework
|
||||
{
|
||||
public static class ObjectExtension
|
||||
{
|
||||
private static readonly List<Transform> s_CachedTransforms = new List<Transform>();
|
||||
|
||||
public static T GetOrAddComponent<T>(this Component obj) where T : Component
|
||||
{
|
||||
return obj.gameObject.GetOrAddComponent<T>();
|
||||
}
|
||||
|
||||
public static T GetOrAddComponent<T>(this GameObject gameObject) where T : Component
|
||||
{
|
||||
T t = gameObject.GetComponent<T>();
|
||||
if (t == null)
|
||||
t = gameObject.AddComponent<T>();
|
||||
return t;
|
||||
}
|
||||
|
||||
public static Component GetOrAddComponent(this Component obj, Type type)
|
||||
{
|
||||
return obj.gameObject.GetOrAddComponent(type);
|
||||
}
|
||||
|
||||
public static Component GetOrAddComponent(this GameObject gameObject, Type type)
|
||||
{
|
||||
if (gameObject == null) return null;
|
||||
|
||||
Component component = gameObject.GetComponent(type);
|
||||
if (component == null)
|
||||
component = gameObject.AddComponent(type);
|
||||
return component;
|
||||
}
|
||||
|
||||
public static void SetParentEx(this Transform transform, Transform parent)
|
||||
{
|
||||
transform.SetParent(parent);
|
||||
transform.localPosition = Vector3.zero;
|
||||
transform.localRotation = Quaternion.identity;
|
||||
transform.localScale = Vector3.one;
|
||||
}
|
||||
|
||||
public static void SetLayerRecursively(this GameObject gameObject, int layer)
|
||||
{
|
||||
gameObject.GetComponentsInChildren(true, s_CachedTransforms);
|
||||
for (int i = 0; i < s_CachedTransforms.Count; i++)
|
||||
{
|
||||
s_CachedTransforms[i].gameObject.layer = layer;
|
||||
}
|
||||
s_CachedTransforms.Clear();
|
||||
}
|
||||
|
||||
public static void AddOrUpdate<TKey, TValue>(this IDictionary<TKey, TValue> dict, TKey key, TValue value)
|
||||
{
|
||||
if (dict.ContainsKey(key))
|
||||
dict[key] = value;
|
||||
else
|
||||
dict.Add(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1255735e746b217478dc63262723567a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,194 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SkierFramework
|
||||
{
|
||||
public static class Pool
|
||||
{
|
||||
public readonly static List<PoolBase> AllPool = new List<PoolBase>();
|
||||
|
||||
public static void ReleaseAll()
|
||||
{
|
||||
foreach (var pool in AllPool)
|
||||
{
|
||||
pool.Dispose();
|
||||
}
|
||||
AllPool.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public interface IObject
|
||||
{
|
||||
void OnRelease();
|
||||
}
|
||||
|
||||
public interface PoolBase
|
||||
{
|
||||
void Dispose();
|
||||
}
|
||||
|
||||
public class ObjectPool<T> : PoolBase where T : new()
|
||||
{
|
||||
private static ObjectPool<T> Instance;
|
||||
|
||||
private Stack<T> _pool;
|
||||
|
||||
private ObjectPool() { }
|
||||
|
||||
|
||||
private static void Init()
|
||||
{
|
||||
if (Instance == null)
|
||||
{
|
||||
Instance = new ObjectPool<T>();
|
||||
Instance._pool = new Stack<T>();
|
||||
Pool.AllPool.Add(Instance);
|
||||
}
|
||||
}
|
||||
|
||||
public static T Get()
|
||||
{
|
||||
Init();
|
||||
|
||||
if (Instance._pool.Count > 0)
|
||||
{
|
||||
return Instance._pool.Pop();
|
||||
}
|
||||
else
|
||||
{
|
||||
return new T();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Release(T obj)
|
||||
{
|
||||
if (obj == null || Instance == null) return;
|
||||
|
||||
if (obj is IObject interfac)
|
||||
{
|
||||
interfac.OnRelease();
|
||||
}
|
||||
Instance._pool.Push(obj);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (Instance != null)
|
||||
{
|
||||
if (Instance._pool != null)
|
||||
{
|
||||
Instance._pool.Clear();
|
||||
Instance._pool = null;
|
||||
}
|
||||
Instance = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ListPool<T> : PoolBase
|
||||
{
|
||||
private static ListPool<T> Instance;
|
||||
|
||||
private Stack<List<T>> _pool;
|
||||
|
||||
private ListPool() { }
|
||||
|
||||
private static void Init()
|
||||
{
|
||||
if (Instance == null)
|
||||
{
|
||||
Instance = new ListPool<T>();
|
||||
Instance._pool = new Stack<List<T>>();
|
||||
Pool.AllPool.Add(Instance);
|
||||
}
|
||||
}
|
||||
|
||||
public static List<T> Get()
|
||||
{
|
||||
Init();
|
||||
|
||||
if (Instance._pool.Count > 0)
|
||||
{
|
||||
return Instance._pool.Pop();
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<T>();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Release(List<T> list)
|
||||
{
|
||||
if (list == null || Instance == null) return;
|
||||
list.Clear();
|
||||
Instance._pool.Push(list);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (Instance != null)
|
||||
{
|
||||
if (Instance._pool != null)
|
||||
{
|
||||
Instance._pool.Clear();
|
||||
Instance._pool = null;
|
||||
}
|
||||
Instance = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DictionaryPool<Key, Value> : PoolBase
|
||||
{
|
||||
private static DictionaryPool<Key, Value> Instance;
|
||||
|
||||
private Stack<Dictionary<Key, Value>> _pool;
|
||||
|
||||
private DictionaryPool() { }
|
||||
|
||||
private static void Init()
|
||||
{
|
||||
if (Instance == null)
|
||||
{
|
||||
Instance = new DictionaryPool<Key, Value>();
|
||||
Instance._pool = new Stack<Dictionary<Key, Value>>();
|
||||
Pool.AllPool.Add(Instance);
|
||||
}
|
||||
}
|
||||
|
||||
public static Dictionary<Key, Value> Get()
|
||||
{
|
||||
Init();
|
||||
|
||||
if (Instance._pool.Count > 0)
|
||||
{
|
||||
return Instance._pool.Pop();
|
||||
}
|
||||
else
|
||||
{
|
||||
return new Dictionary<Key, Value>();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Release(Dictionary<Key, Value> dict)
|
||||
{
|
||||
if (dict == null || Instance == null) return;
|
||||
dict.Clear();
|
||||
Instance._pool.Push(dict);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (Instance != null)
|
||||
{
|
||||
if (Instance._pool != null)
|
||||
{
|
||||
Instance._pool.Clear();
|
||||
Instance._pool = null;
|
||||
}
|
||||
Instance = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||