Dialogue System for Unity 에셋 추가
@ -50,6 +50,9 @@ namespace BlueWater.BehaviorTrees.Actions
|
||||
return TaskStatus.Running;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
private void HandleFoodInteraction()
|
||||
{
|
||||
var tycoonPlayer = GameManager.Instance.CurrentTycoonPlayer;
|
||||
|
@ -71,7 +71,7 @@ namespace BlueWater.Uis
|
||||
return;
|
||||
}
|
||||
|
||||
if (_orderItemData.Sprite == null)
|
||||
if (!_orderItemData.Sprite)
|
||||
{
|
||||
Debug.LogWarning($"{_orderItemData.Sprite} 해당 음식의 이미지가 없습니다.");
|
||||
}
|
||||
|
@ -21,17 +21,18 @@ MonoBehaviour:
|
||||
startIndex:
|
||||
variableStartIndex:
|
||||
JSONSerialization: '{"EntryTask":{"Type":"BehaviorDesigner.Runtime.Tasks.EntryTask","NodeData":{"Offset":"(548.5,0)"},"ID":0,"Name":"Entry","Instant":true},"RootTask":{"Type":"BehaviorDesigner.Runtime.Tasks.Sequence","NodeData":{"Offset":"(-2.878418,152.4463)","Comment":"\uc190\ub2d8\uc758
|
||||
\ud55c \uc2f8\uc774\ud074"},"ID":1,"Name":"Customer Cycle","Instant":true,"AbortTypeabortType":"None","Children":[{"Type":"BehaviorDesigner.Runtime.Tasks.Sequence","NodeData":{"Offset":"(-712.8185,150)","Comment":"\uc790\ub9ac\ub97c
|
||||
\ud55c \uc2f8\uc774\ud074"},"ID":1,"Name":"Customer Cycle","Instant":true,"AbortTypeabortType":"None","Children":[{"Type":"BehaviorDesigner.Runtime.Tasks.Sequence","NodeData":{"Offset":"(-847.4339,150)","Comment":"\uc790\ub9ac\ub97c
|
||||
\ucc3e\ub294\ub2e4"},"ID":2,"Name":"Find Empty Table Sequence","Instant":true,"AbortTypeabortType":"None","Children":[{"Type":"BlueWater.BehaviorTrees.Actions.FindTable","NodeData":{"Offset":"(-237.57135,147)","Comment":"\ube48\uc790\ub9ac\ub97c
|
||||
\ucc3e\uc744 \ub54c\uae4c\uc9c0 \ub300\uae30"},"ID":3,"Name":"Find Table","Instant":true},{"Type":"BlueWater.BehaviorTrees.Actions.HasReachedDestination","NodeData":{"Offset":"(4.428632,152)","Comment":"\ub3c4\ucc29\ud560
|
||||
\ub54c\uae4c\uc9c0 \ub300\uae30"},"ID":4,"Name":"Has Reached Destination","Instant":true},{"Type":"BlueWater.BehaviorTrees.Actions.SetTableSeatPositionAndDirection","NodeData":{"Offset":"(250,150)","Comment":"\ud14c\uc774\ube14
|
||||
\uc88c\uc11d\uc5d0 \uc704\uce58\ud558\uace0, \ud14c\uc774\ube14\uc744 \ubc14\ub77c\ubd04"},"ID":5,"Name":"Set
|
||||
Table Seat Position And Direction","Instant":true}]},{"Type":"BehaviorDesigner.Runtime.Tasks.Sequence","NodeData":{"Offset":"(-140,150)","Comment":"\uc74c\ub8cc\ub97c
|
||||
\uc8fc\ubb38\ud55c\ub2e4"},"ID":6,"Name":"Order Drink Sequence","Instant":true,"AbortTypeabortType":"None","Children":[{"Type":"BehaviorDesigner.Runtime.Tasks.Selector","NodeData":{"Offset":"(-1.223877,154.022858)"},"ID":7,"Name":"Selector","Instant":true,"AbortTypeabortType":"None","Children":[{"Type":"BehaviorDesigner.Runtime.Tasks.Sequence","NodeData":{"Offset":"(-127.381042,151.88)"},"ID":8,"Name":"Order
|
||||
\uc8fc\ubb38\ud55c\ub2e4"},"ID":6,"Name":"Order Drink Sequence","Instant":true,"AbortTypeabortType":"None","Children":[{"Type":"BehaviorDesigner.Runtime.Tasks.Selector","NodeData":{"Offset":"(-1.223877,154.022858)"},"ID":7,"Name":"Selector","Instant":true,"AbortTypeabortType":"None","Children":[{"Type":"BehaviorDesigner.Runtime.Tasks.Sequence","NodeData":{"Offset":"(-182.936584,151.88)"},"ID":8,"Name":"Order
|
||||
Success Sequence","Instant":true,"AbortTypeabortType":"None","Children":[{"Type":"BlueWater.BehaviorTrees.Actions.OrderFood","NodeData":{"Offset":"(-105.555573,145.555237)","Comment":"\uc74c\ub8cc\ub97c
|
||||
\uc8fc\ubb38\ud558\uace0 \uae30\ub2e4\ub9b0\ub2e4"},"ID":9,"Name":"Order
|
||||
Food","Instant":true}]},{"Type":"BehaviorDesigner.Runtime.Tasks.Sequence","NodeData":{"Offset":"(166.6665,147.777832)"},"ID":10,"Name":"Order
|
||||
Failure Sequence","Instant":true,"AbortTypeabortType":"None","Children":[{"Type":"BlueWater.BehaviorTrees.Actions.Move","NodeData":{"Offset":"(-120.441589,149.5423)"},"ID":11,"Name":"Move","Instant":true,"Boolean<UseMovePosition>k__BackingField":true,"SharedVector3<MovePosition>k__BackingField":{"Type":"BehaviorDesigner.Runtime.SharedVector3","Name":null,"Vector3mValue":"(0,0,-19)"},"SharedCollider<Target>k__BackingField":{"Type":"BehaviorDesigner.Runtime.SharedCollider","Name":null}},{"Type":"BehaviorDesigner.Runtime.Tasks.Unity.UnityGameObject.Destroy","NodeData":{"Offset":"(116.929504,154.032043)"},"ID":12,"Name":"Destroy","Instant":true,"SharedGameObjecttargetGameObject":{"Type":"BehaviorDesigner.Runtime.SharedGameObject","Name":"MyObj","IsShared":true},"Singletime":0}]}]}]}]},"DetachedTasks":[{"Type":"BehaviorDesigner.Runtime.Tasks.Sequence","NodeData":{"Offset":"(1652.77856,300)","Comment":"\ud1f4\uc7a5\ud55c\ub2e4"},"ID":13,"Name":"Sequence","Instant":true,"Disabled":true,"AbortTypeabortType":"None"},{"Type":"BehaviorDesigner.Runtime.Tasks.Sequence","NodeData":{"Offset":"(1402.77844,300)","Comment":"\uacc4\uc0b0\ud55c\ub2e4"},"ID":14,"Name":"Sequence","Instant":true,"Disabled":true,"AbortTypeabortType":"None"},{"Type":"BehaviorDesigner.Runtime.Tasks.Sequence","NodeData":{"Offset":"(1112.77722,300)","Comment":"\uc74c\uc2dd\uc744
|
||||
Food","Instant":true}]},{"Type":"BehaviorDesigner.Runtime.Tasks.Sequence","NodeData":{"Offset":"(263.8887,147.777832)"},"ID":10,"Name":"Order
|
||||
Failure Sequence","Instant":true,"AbortTypeabortType":"None","Children":[{"Type":"BlueWater.BehaviorTrees.Actions.Move","NodeData":{"Offset":"(-120.441589,149.5423)","Comment":"\uc785\uad6c\ub85c
|
||||
\ub418\ub3cc\uc544\uac04\ub2e4"},"ID":11,"Name":"Move","Instant":true,"Boolean<UseMovePosition>k__BackingField":true,"SharedVector3<MovePosition>k__BackingField":{"Type":"BehaviorDesigner.Runtime.SharedVector3","Name":null,"Vector3mValue":"(0,0,-19)"},"SharedCollider<Target>k__BackingField":{"Type":"BehaviorDesigner.Runtime.SharedCollider","Name":null}},{"Type":"BehaviorDesigner.Runtime.Tasks.Unity.UnityGameObject.Destroy","NodeData":{"Offset":"(116.929504,154.032043)"},"ID":12,"Name":"Destroy","Instant":true,"SharedGameObjecttargetGameObject":{"Type":"BehaviorDesigner.Runtime.SharedGameObject","Name":"MyObj","IsShared":true},"Singletime":0}]}]}]}]},"DetachedTasks":[{"Type":"BehaviorDesigner.Runtime.Tasks.Sequence","NodeData":{"Offset":"(1652.77856,300)","Comment":"\ud1f4\uc7a5\ud55c\ub2e4"},"ID":13,"Name":"Sequence","Instant":true,"Disabled":true,"AbortTypeabortType":"None"},{"Type":"BehaviorDesigner.Runtime.Tasks.Sequence","NodeData":{"Offset":"(1402.77844,300)","Comment":"\uacc4\uc0b0\ud55c\ub2e4"},"ID":14,"Name":"Sequence","Instant":true,"Disabled":true,"AbortTypeabortType":"None"},{"Type":"BehaviorDesigner.Runtime.Tasks.Sequence","NodeData":{"Offset":"(1112.77722,300)","Comment":"\uc74c\uc2dd\uc744
|
||||
\uc8fc\ubb38\ud55c\ub2e4"},"ID":15,"Name":"Sequence","Instant":true,"Disabled":true,"AbortTypeabortType":"None"}],"Variables":[{"Type":"BehaviorDesigner.Runtime.SharedGameObject","Name":"MyObj","IsShared":true}]}'
|
||||
fieldSerializationData:
|
||||
typeName: []
|
||||
|
9
Assets/Editor Default Resources.meta
Normal file
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a03322c80bdb08b4c81e34c015c2c3e0
|
||||
folderAsset: yes
|
||||
timeCreated: 1523621471
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
9
Assets/Editor Default Resources/Dialogue System.meta
Normal file
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6415a3b923f706f4cbfad95a17aeb6e0
|
||||
folderAsset: yes
|
||||
timeCreated: 1523621481
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/Editor Default Resources/Dialogue System/Conditions.png
Normal file
After Width: | Height: | Size: 190 B |
@ -0,0 +1,95 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e36d98dc2889c2040b35e8b25bb3119f
|
||||
timeCreated: 1590451810
|
||||
licenseType: Store
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
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
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 0
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 2
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
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: 0
|
||||
textureShape: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Editor Default Resources/Dialogue System/Conditions.png
|
||||
uploadId: 667566
|
After Width: | Height: | Size: 4.7 KiB |
@ -0,0 +1,53 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da2299cb159f904459216ca87bce9dbb
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 2
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Editor Default Resources/Dialogue System/DialogueManager Inspector
|
||||
Dark.png
|
||||
uploadId: 667566
|
After Width: | Height: | Size: 4.5 KiB |
@ -0,0 +1,53 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a69d5c321f729f1499ac11e52f110452
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 2
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Editor Default Resources/Dialogue System/DialogueManager Inspector
|
||||
Light.png
|
||||
uploadId: 667566
|
BIN
Assets/Editor Default Resources/Dialogue System/EditorNode.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,65 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a03d2f508e30c24e826a259b1c825ee
|
||||
timeCreated: 1549325847
|
||||
licenseType: Store
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 7
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
allowsAlphaSplitting: 0
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Editor Default Resources/Dialogue System/EditorNode.png
|
||||
uploadId: 667566
|
BIN
Assets/Editor Default Resources/Dialogue System/Event.png
Normal file
After Width: | Height: | Size: 615 B |
@ -0,0 +1,95 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fe004ffe580a6b74eb585e93d5ba113d
|
||||
timeCreated: 1593887019
|
||||
licenseType: Store
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
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
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 0
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
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: 0
|
||||
textureShape: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Editor Default Resources/Dialogue System/Event.png
|
||||
uploadId: 667566
|
BIN
Assets/Editor Default Resources/Dialogue System/Resize.png
Normal file
After Width: | Height: | Size: 331 B |
@ -0,0 +1,95 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 018dc0a4dc45ff14eb2b84d0c6f4e3f7
|
||||
timeCreated: 1621890141
|
||||
licenseType: Store
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
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
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
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: 0
|
||||
textureShape: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 32
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- buildTarget: Standalone
|
||||
maxTextureSize: 32
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Editor Default Resources/Dialogue System/Resize.png
|
||||
uploadId: 667566
|
BIN
Assets/Editor Default Resources/Dialogue System/Script.png
Normal file
After Width: | Height: | Size: 186 B |
@ -0,0 +1,95 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cfb2ddf8e3923324ea96e23ee67d79b6
|
||||
timeCreated: 1590451810
|
||||
licenseType: Store
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
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
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 0
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 2
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
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: 0
|
||||
textureShape: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Editor Default Resources/Dialogue System/Script.png
|
||||
uploadId: 667566
|
BIN
Assets/Editor Default Resources/Dialogue System/Sequence.png
Normal file
After Width: | Height: | Size: 179 B |
@ -0,0 +1,95 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 68479939e81df0542b3f4449e7bab4a1
|
||||
timeCreated: 1590451809
|
||||
licenseType: Store
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
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
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 0
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 2
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
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: 0
|
||||
textureShape: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Editor Default Resources/Dialogue System/Sequence.png
|
||||
uploadId: 667566
|
BIN
Assets/Gizmos/DialogueDatabase Icon.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
52
Assets/Gizmos/DialogueDatabase Icon.png.meta
Normal file
@ -0,0 +1,52 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c00072895782fb4d918363c8ff501a5
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 2
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Gizmos/DialogueDatabase Icon.png
|
||||
uploadId: 667566
|
BIN
Assets/Gizmos/StringAsset Icon.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
54
Assets/Gizmos/StringAsset Icon.png.meta
Normal file
@ -0,0 +1,54 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f2936fe28db54943a07b18c4366f96d
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 64
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 2
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Gizmos/StringAsset Icon.png
|
||||
uploadId: 667566
|
BIN
Assets/Gizmos/TextTable Icon.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
54
Assets/Gizmos/TextTable Icon.png.meta
Normal file
@ -0,0 +1,54 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f043073205c249748ae651e1518ced37
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 64
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 2
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Gizmos/TextTable Icon.png
|
||||
uploadId: 667566
|
9
Assets/Plugins/Pixel Crushers.meta
Normal file
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e548d83123d220b4ca31fa7813b93169
|
||||
folderAsset: yes
|
||||
timeCreated: 1523621309
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
9
Assets/Plugins/Pixel Crushers/Common.meta
Normal file
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 464fa5fb7b9423447b820fb1586bc377
|
||||
folderAsset: yes
|
||||
timeCreated: 1549415913
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
9
Assets/Plugins/Pixel Crushers/Common/Documentation.meta
Normal file
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d251ab3a82057f646b86d4680ecf98fa
|
||||
folderAsset: yes
|
||||
timeCreated: 1549415913
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 846626fbdca7bc043b03974780ce4ded
|
||||
timeCreated: 1583293279
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Documentation/Input_Device_Manager_Manual.pdf
|
||||
uploadId: 667566
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 078b161b9252e2a49ae78f3274016e9a
|
||||
DefaultImporter:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Documentation/Save_System_Manual.pdf
|
||||
uploadId: 667566
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 35e24f51cfa33ae45875a60c94afe1c4
|
||||
timeCreated: 1547864529
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Documentation/Text_Table_Manual.pdf
|
||||
uploadId: 667566
|
9
Assets/Plugins/Pixel Crushers/Common/Scripts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31a7ee3bf0d4f32409ed16f46d687b3b
|
||||
folderAsset: yes
|
||||
timeCreated: 1549415913
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d9b575363cdb56408d92f7d7f0e5216
|
||||
timeCreated: 1533129795
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/CommonAssemblyDefinitions.unitypackage
|
||||
uploadId: 667566
|
9
Assets/Plugins/Pixel Crushers/Common/Scripts/Editor.meta
Normal file
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad10e7c76ead24541bec6a9d58e509cc
|
||||
folderAsset: yes
|
||||
timeCreated: 1549415914
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 402663108598fef46a3589f86b6ce181
|
||||
folderAsset: yes
|
||||
timeCreated: 1549415914
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,24 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
[CustomEditor(typeof(MessageEvents), true)]
|
||||
public class MessageEventsEditor : Editor
|
||||
{
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
EditorGUILayout.HelpBox("In Messages To Listen For, add messages to listen for and the events that should occur when these messages are received.", MessageType.None);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_messagesToListenFor"), true);
|
||||
EditorGUILayout.HelpBox("In Messages To Send, configure messages that you want to send. To send them, call SendToMessageSystem(index) with the index of the element in Messages To Send.", MessageType.None);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_messagesToSend"), true);
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4046055df9a0a9647a98be75adc715b8
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Message System/MessageEventsEditor.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa99048c69f821847a3a7e8bf605c3b3
|
||||
folderAsset: yes
|
||||
timeCreated: 1549415914
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,127 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.IO;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
public static class AssetUtility
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new ScriptableObject asset in the project's asset database.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The ScriptableObject type.</typeparam>
|
||||
/// <param name="typeName">The type name to use when naming the asset file in the project's asset database.</param>
|
||||
/// <param name="select">If true, select the asset.</param>
|
||||
/// <param name="prependNew">If true, prepend 'New' to the beginning of the asset name.</param>
|
||||
/// <returns>The asset.</returns>
|
||||
public static T CreateAsset<T>(string typeName, bool select = true, bool prependNew = true) where T : ScriptableObject
|
||||
{
|
||||
var asset = ScriptableObjectUtility.CreateScriptableObject<T>() as T;
|
||||
SaveAsset(asset, typeName, select, prependNew);
|
||||
return asset;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new ScriptableObject asset in the project's asset database.
|
||||
/// </summary>
|
||||
/// <param name="type">The ScriptableObject type.</param>
|
||||
/// <param name="typeName">The type name to use when naming the asset file in the project's asset database.</param>
|
||||
/// <param name="select">If true, select the asset.</param>
|
||||
/// <param name="prependNew">If true, prepend 'New' to the beginning of the asset name.</param>
|
||||
/// <returns>The asset.</returns>
|
||||
public static ScriptableObject CreateAsset(System.Type type, string typeName, bool select = true, bool prependNew = true)
|
||||
{
|
||||
var asset = ScriptableObjectUtility.CreateScriptableObject(type);
|
||||
SaveAsset(asset, typeName, select, prependNew);
|
||||
return asset;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new ScriptableObject asset in the project's asset database.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The ScriptableObject type.</typeparam>
|
||||
/// <param name="filename">The filename to save the asset as.</param>
|
||||
/// <param name="select">If true, select the asset.</param>
|
||||
/// <returns>The asset.</returns>
|
||||
public static T CreateAssetWithFilename<T>(string filename, bool select = true) where T : ScriptableObject
|
||||
{
|
||||
var asset = ScriptableObjectUtility.CreateScriptableObject<T>() as T;
|
||||
SaveAssetWithFilename(asset, filename, select);
|
||||
return asset;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new ScriptableObject asset in the project's asset database.
|
||||
/// </summary>
|
||||
/// <param name="type">The ScriptableObject type.</param>
|
||||
/// <param name="filename">The filename to save the asset as.</param>
|
||||
/// <param name="select">If true, select the asset.</param>
|
||||
/// <returns>The asset.</returns>
|
||||
public static ScriptableObject CreateAssetWithFilename(System.Type type, string filename, bool select = true)
|
||||
{
|
||||
var asset = ScriptableObjectUtility.CreateScriptableObject(type);
|
||||
SaveAssetWithFilename(asset, filename, select);
|
||||
return asset;
|
||||
}
|
||||
|
||||
|
||||
private static void SaveAsset(ScriptableObject asset, string typeName, bool select = true, bool prependNew = true)
|
||||
{
|
||||
string path = AssetDatabase.GetAssetPath(Selection.activeObject);
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
path = "Assets";
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(Path.GetExtension(path)))
|
||||
{
|
||||
path = path.Replace(Path.GetFileName(AssetDatabase.GetAssetPath(Selection.activeObject)), "");
|
||||
}
|
||||
string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(path + (prependNew ? "/New " : "/") + typeName + ".asset");
|
||||
SaveAssetWithFilename(asset, assetPathAndName, select);
|
||||
}
|
||||
|
||||
private static void SaveAssetWithFilename(ScriptableObject asset, string filename, bool select = true)
|
||||
{
|
||||
AssetDatabase.CreateAsset(asset, filename);
|
||||
//AssetDatabase.SaveAssets();
|
||||
if (select)
|
||||
{
|
||||
EditorUtility.FocusProjectWindow();
|
||||
Selection.activeObject = asset;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// (Editor only) Registers a ScriptableObject as part of an asset in the project's asset database.
|
||||
/// </summary>
|
||||
/// <param name="scriptableObject">The ScriptableObject to add.</param>
|
||||
/// <param name="asset">The asset to add the ScriptableObject to.</param>
|
||||
public static void AddToAsset(ScriptableObject scriptableObject, UnityEngine.Object asset)
|
||||
{
|
||||
scriptableObject.hideFlags = HideFlags.HideInHierarchy;
|
||||
AssetDatabase.AddObjectToAsset(scriptableObject, asset);
|
||||
//AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(scriptableObject));
|
||||
//AssetDatabase.SaveAssets();
|
||||
//AssetDatabase.Refresh();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// (Editor only) Deletes a ScriptableObject from an asset.
|
||||
/// </summary>
|
||||
/// <param name="scriptableObject">The ScriptableObject to add.</param>
|
||||
/// <param name="asset">The asset to delete the ScriptableObject from.</param>
|
||||
public static void DeleteFromAsset(ScriptableObject scriptableObject, UnityEngine.Object asset)
|
||||
{
|
||||
if (scriptableObject == null) return;
|
||||
UnityEngine.Object.DestroyImmediate(scriptableObject, true);
|
||||
//AssetDatabase.SaveAssets();
|
||||
//AssetDatabase.Refresh();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07303eff990b078489da752f47820b89
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Misc/AssetUtility.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,38 @@
|
||||
// From "Unity Editor Window Zooming" by Martin Ecker.
|
||||
// http://martinecker.com/martincodes/unity-editor-window-zooming/
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
public class EditorGUIZoomArea
|
||||
{
|
||||
private const float kEditorWindowTabHeight = 21.0f;
|
||||
private static Matrix4x4 _prevGuiMatrix;
|
||||
|
||||
public static Rect Begin(float zoomScale, Rect screenCoordsArea)
|
||||
{
|
||||
GUI.EndGroup(); // End the group Unity begins automatically for an EditorWindow to clip out the window tab. This allows us to draw outside of the size of the EditorWindow.
|
||||
|
||||
Rect clippedArea = screenCoordsArea.ScaleSizeBy(1.0f / zoomScale, screenCoordsArea.TopLeft());
|
||||
clippedArea.y += kEditorWindowTabHeight;
|
||||
GUI.BeginGroup(clippedArea);
|
||||
|
||||
_prevGuiMatrix = GUI.matrix;
|
||||
Matrix4x4 translation = Matrix4x4.TRS(clippedArea.TopLeft(), Quaternion.identity, Vector3.one);
|
||||
Matrix4x4 scale = Matrix4x4.Scale(new Vector3(zoomScale, zoomScale, 1.0f));
|
||||
GUI.matrix = translation * scale * translation.inverse * GUI.matrix;
|
||||
|
||||
return clippedArea;
|
||||
}
|
||||
|
||||
public static void End()
|
||||
{
|
||||
GUI.matrix = _prevGuiMatrix;
|
||||
GUI.EndGroup();
|
||||
GUI.BeginGroup(new Rect(0.0f, kEditorWindowTabHeight, Screen.width, Screen.height));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fd7defe51a4f2314295968cbe8560d17
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Misc/EditorGUIZoomArea.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,31 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
public static class EnablePhysics2DMenuItem
|
||||
{
|
||||
|
||||
[MenuItem("Tools/Pixel Crushers/Common/Misc/Enable Physics2D Support...", false, 100)]
|
||||
static public void AddUSEPHYSICS2D()
|
||||
{
|
||||
if (EditorUtility.DisplayDialog("Enable Physics2D Support", "If your project uses 2D Physics, press OK to enable Pixel Crushers support for 2D Physics.", "OK", "Cancel"))
|
||||
{
|
||||
MoreEditorUtility.TryAddScriptingDefineSymbols("USE_PHYSICS2D");
|
||||
EditorUtility.DisplayDialog("Physics2D Support Enabled", "Support for 2D Physics has been enabled. You may need to right-click on the Plugins/Pixel Crushers folder and select Reimport to recompile the scripts with 2D Physics support. If you add build platforms, you may need to select this menu item again.", "OK");
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Pixel Crushers/Common/Misc/Enable Physics2D Support...", true)]
|
||||
static bool ValidateAddUSEPHYSICS2D()
|
||||
{
|
||||
return !MoreEditorUtility.DoesScriptingDefineSymbolExist("USE_PHYSICS2D");
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e2b871fdb938485479e342fcab452149
|
||||
timeCreated: 1539308973
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Misc/EnablePhysics2DMenuItem.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,59 @@
|
||||
#if !ODIN_INSPECTOR
|
||||
// Pending fix from Sirenix, to prevent Odin stack overflow bug we don't draw help boxes if Odin in installed.
|
||||
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
[CustomPropertyDrawer(typeof(HelpBoxAttribute))]
|
||||
public class HelpBoxAttributeDrawer : DecoratorDrawer
|
||||
{
|
||||
|
||||
public override float GetHeight()
|
||||
{
|
||||
try
|
||||
{
|
||||
var helpBoxAttribute = attribute as HelpBoxAttribute;
|
||||
if (helpBoxAttribute == null) return base.GetHeight();
|
||||
|
||||
var helpBoxStyle = (GUI.skin != null) ? GUI.skin.GetStyle("helpbox") : null;
|
||||
if (helpBoxStyle == null) return base.GetHeight();
|
||||
|
||||
return Mathf.Max(40f, helpBoxStyle.CalcHeight(new GUIContent(helpBoxAttribute.text), EditorGUIUtility.currentViewWidth) + 4);
|
||||
}
|
||||
catch (System.ArgumentException) // Handles IMGUI->UITK bug in Unity 2022.2.
|
||||
{
|
||||
return 3 * EditorGUIUtility.singleLineHeight;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnGUI(Rect position)
|
||||
{
|
||||
var helpBoxAttribute = attribute as HelpBoxAttribute;
|
||||
if (helpBoxAttribute == null) return;
|
||||
EditorGUI.HelpBox(position, helpBoxAttribute.text, GetMessageType(helpBoxAttribute.messageType));
|
||||
}
|
||||
|
||||
private MessageType GetMessageType(HelpBoxMessageType helpBoxMessageType)
|
||||
{
|
||||
switch (helpBoxMessageType)
|
||||
{
|
||||
default:
|
||||
case HelpBoxMessageType.None:
|
||||
return MessageType.None;
|
||||
case HelpBoxMessageType.Info:
|
||||
return MessageType.Info;
|
||||
case HelpBoxMessageType.Warning:
|
||||
return MessageType.Warning;
|
||||
case HelpBoxMessageType.Error:
|
||||
return MessageType.Error;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6b7fff4cb8c61f14ab57e6cdd5469595
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Misc/HelpBoxAttributeDrawer.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,113 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
public static class MoreEditorGuiUtility
|
||||
{
|
||||
|
||||
// // Evaluation version headaches. Get it at runtime instead:
|
||||
//#if UNITY_2022_3_OR_NEWER && !UNITY_2022_3_0
|
||||
// public const string ToolbarSearchTextFieldName = "ToolbarSearchTextField";
|
||||
// public const string ToolbarSearchCancelButtonName = "ToolbarSearchCancelButton";
|
||||
// public const string ToolbarSearchCancelButtonEmpty = "ToolbarSearchCancelButtonEmpty";
|
||||
//#else
|
||||
// public const string ToolbarSearchTextFieldName = "ToolbarSeachTextField";
|
||||
// public const string ToolbarSearchCancelButtonName = "ToolbarSeachCancelButton";
|
||||
// public const string ToolbarSearchCancelButtonEmpty = "ToolbarSeachCancelButtonEmpty";
|
||||
//#endif
|
||||
|
||||
private static GUIStyle toolbarSearchTextFieldStyle = null;
|
||||
private static GUIStyle toolbarSearchCancelButtonStyle = null;
|
||||
private static GUIStyle toolbarSearchCancelButtonEmptyStyle = null;
|
||||
public static string ToolbarSearchTextFieldName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (toolbarSearchTextFieldStyle == null)
|
||||
{
|
||||
toolbarSearchTextFieldStyle = FindCustomStyle("ToolbarSearchTextField", "ToolbarSeachTextField");
|
||||
}
|
||||
return toolbarSearchTextFieldStyle.name;
|
||||
}
|
||||
}
|
||||
public static string ToolbarSearchCancelButtonName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (toolbarSearchCancelButtonStyle == null)
|
||||
{
|
||||
toolbarSearchCancelButtonStyle = FindCustomStyle("ToolbarSearchCancelButton", "ToolbarSeachCancelButton");
|
||||
}
|
||||
return toolbarSearchCancelButtonStyle.name;
|
||||
}
|
||||
}
|
||||
public static string ToolbarSearchCancelButtonEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
if (toolbarSearchCancelButtonEmptyStyle == null)
|
||||
{
|
||||
toolbarSearchCancelButtonEmptyStyle = FindCustomStyle("ToolbarSearchCancelButtonEmpty", "ToolbarSeachCancelButtonEmpty");
|
||||
}
|
||||
return toolbarSearchCancelButtonEmptyStyle.name;
|
||||
}
|
||||
}
|
||||
private static GUIStyle FindCustomStyle(string name1, string name2)
|
||||
{
|
||||
foreach (var style in GUI.skin.customStyles)
|
||||
{
|
||||
if ((style.name == name1) || (style.name == name2)) return style;
|
||||
}
|
||||
return GUI.skin.label;
|
||||
}
|
||||
|
||||
public const float GearWidth = 15;
|
||||
public const float GearHeight = 14;
|
||||
|
||||
private static GUIStyle m_gearMenuGuiStyle = null;
|
||||
|
||||
/// <summary>
|
||||
/// Draws a gear menu button.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the button was clicked; otherwise <c>false</c>.</returns>
|
||||
public static bool DoGearMenu(Rect rect)
|
||||
{
|
||||
if (!LoadGearStyle()) return false;
|
||||
return GUI.Button(rect, GUIContent.none, m_gearMenuGuiStyle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws a gear menu button in GUI layout mode.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the button was clicked; otherwise <c>false</c>.</returns>
|
||||
public static bool DoLayoutGearMenu()
|
||||
{
|
||||
if (!LoadGearStyle()) return false;
|
||||
return GUILayout.Button(GUIContent.none, m_gearMenuGuiStyle, GUILayout.Width(GearWidth), GUILayout.Height(GearHeight));
|
||||
}
|
||||
|
||||
private static bool LoadGearStyle()
|
||||
{
|
||||
if (m_gearMenuGuiStyle == null)
|
||||
{
|
||||
var textureName = EditorGUIUtility.isProSkin ? "icons/d__Popup.png" : "icons/_Popup.png";
|
||||
Texture2D gearTexture = EditorGUIUtility.Load(textureName) as Texture2D;
|
||||
m_gearMenuGuiStyle = new GUIStyle(GUI.skin.label);
|
||||
m_gearMenuGuiStyle.normal.background = gearTexture;
|
||||
m_gearMenuGuiStyle.active.background = gearTexture;
|
||||
m_gearMenuGuiStyle.focused.background = gearTexture;
|
||||
m_gearMenuGuiStyle.hover.background = gearTexture;
|
||||
m_gearMenuGuiStyle.onNormal.background = gearTexture;
|
||||
m_gearMenuGuiStyle.onActive.background = gearTexture;
|
||||
m_gearMenuGuiStyle.onFocused.background = gearTexture;
|
||||
m_gearMenuGuiStyle.onHover.background = gearTexture;
|
||||
}
|
||||
return (m_gearMenuGuiStyle != null);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 13b677070f7ca2648ba2f9dc29726594
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Misc/MoreEditorGuiUtility.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,258 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
public static class MoreEditorUtility
|
||||
{
|
||||
|
||||
// These two methods handle API differences:
|
||||
|
||||
public static string GetScriptingDefineSymbolsForGroup(BuildTargetGroup group)
|
||||
{
|
||||
#if UNITY_2023_1_OR_NEWER
|
||||
return PlayerSettings.GetScriptingDefineSymbols(UnityEditor.Build.NamedBuildTarget.FromBuildTargetGroup(group));
|
||||
#else
|
||||
return PlayerSettings.GetScriptingDefineSymbolsForGroup(group);
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void SetScriptingDefineSymbolsForGroup(BuildTargetGroup group, string defines)
|
||||
{
|
||||
#if UNITY_2023_1_OR_NEWER
|
||||
PlayerSettings.SetScriptingDefineSymbols(UnityEditor.Build.NamedBuildTarget.FromBuildTargetGroup(group), defines);
|
||||
#else
|
||||
PlayerSettings.SetScriptingDefineSymbolsForGroup(group, defines);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a symbol exists in the project's Scripting Define Symbols for the current build target.
|
||||
/// </summary>
|
||||
public static bool DoesScriptingDefineSymbolExist(string symbol)
|
||||
{
|
||||
var defines = GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup).Split(';');
|
||||
for (int i = 0; i < defines.Length; i++)
|
||||
{
|
||||
if (string.Equals(symbol, defines[i].Trim())) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static HashSet<BuildTargetGroup> GetInstalledBuildTargetGroups()
|
||||
{
|
||||
#if UNITY_2017
|
||||
Debug.Log("Updating all build targets. Please ignore messages about build targets not installed.");
|
||||
#endif
|
||||
var result = new HashSet<BuildTargetGroup>();
|
||||
foreach (BuildTarget target in (BuildTarget[])Enum.GetValues(typeof(BuildTarget)))
|
||||
{
|
||||
BuildTargetGroup group = BuildPipeline.GetBuildTargetGroup(target);
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
if (BuildPipeline.IsBuildTargetSupported(group, target))
|
||||
#endif
|
||||
{
|
||||
result.Add(group);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Try to add a symbol to the project's Scripting Define Symbols for all build targets.
|
||||
/// </summary>
|
||||
public static void TryAddScriptingDefineSymbols(string symbol, bool touchFiles = false)
|
||||
{
|
||||
foreach (var group in GetInstalledBuildTargetGroups())
|
||||
{
|
||||
try
|
||||
{
|
||||
var defines = GetScriptingDefineSymbolsForGroup(group);
|
||||
if (!string.IsNullOrEmpty(defines)) defines += ";";
|
||||
defines += symbol;
|
||||
SetScriptingDefineSymbolsForGroup(group, defines);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogException(e);
|
||||
}
|
||||
}
|
||||
if (touchFiles) TouchScriptsWithScriptingSymbol(symbol);
|
||||
RecompileScripts();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Try to remove a symbol from the project's Scripting Define Symbols for all build targets.
|
||||
/// </summary>
|
||||
public static void TryRemoveScriptingDefineSymbols(string symbol)
|
||||
{
|
||||
foreach (var group in GetInstalledBuildTargetGroups())
|
||||
{
|
||||
try
|
||||
{
|
||||
var symbols = new List<string>(GetScriptingDefineSymbolsForGroup(group).Split(';'));
|
||||
symbols.Remove(symbol);
|
||||
var defines = string.Join(";", symbols.ToArray());
|
||||
SetScriptingDefineSymbolsForGroup(group, defines);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogException(e);
|
||||
}
|
||||
}
|
||||
RecompileScripts();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add or remove a scripting define symbol.
|
||||
/// </summary>
|
||||
public static void ToggleScriptingDefineSymbol(string define, bool value, bool touchFiles = false)
|
||||
{
|
||||
if (value == true) TryAddScriptingDefineSymbols(define, touchFiles);
|
||||
else TryRemoveScriptingDefineSymbols(define);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Triggers a script recompile.
|
||||
/// </summary>
|
||||
public static void RecompileScripts()
|
||||
{
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
EditorUtility.RequestScriptReload();
|
||||
#else
|
||||
UnityEditorInternal.InternalEditorUtility.RequestScriptReload();
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The only reliable way to force a recompile and get the editor to recognize
|
||||
/// MonoBehaviour scripts and wrappers in Plugins is to actually change those
|
||||
/// files. :/
|
||||
/// </summary>
|
||||
/// <param name="symbol">Touch files that cehck this scripting symbol.</param>
|
||||
public static void TouchScriptsWithScriptingSymbol(string symbol)
|
||||
{
|
||||
var path = Application.dataPath + "/Plugins/Pixel Crushers/";
|
||||
if (Application.platform == RuntimePlatform.WindowsEditor)
|
||||
{
|
||||
path = path.Replace("/", "\\");
|
||||
}
|
||||
if (!Directory.Exists(path))
|
||||
{
|
||||
Debug.Log("It looks like you've moved this Pixel Crushers asset. In the Project view, please right-click on the folder in its new location and select Reimport.");
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] filenames = Directory.GetFiles(path, "*.cs", SearchOption.AllDirectories);
|
||||
var found = string.Empty;
|
||||
var recompileAtText = "// Recompile at " + DateTime.Now + "\r\n";
|
||||
var searchString = "#if " + symbol;
|
||||
foreach (string filename in filenames)
|
||||
{
|
||||
var text = File.ReadAllText(filename);
|
||||
if (text.Contains(searchString))
|
||||
{
|
||||
found += filename + "\n";
|
||||
if (text.StartsWith("// Recompile at "))
|
||||
{
|
||||
var lines = File.ReadAllLines(filename);
|
||||
lines[0] = recompileAtText;
|
||||
File.WriteAllLines(filename, lines);
|
||||
}
|
||||
else
|
||||
{
|
||||
text = recompileAtText + text;
|
||||
File.WriteAllText(filename, text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================
|
||||
|
||||
[MenuItem("Tools/Pixel Crushers/Common/Misc/Enable TextMesh Pro Support...", false, 101)]
|
||||
static public void AddTMPPRESENT()
|
||||
{
|
||||
if (EditorUtility.DisplayDialog("Enable TextMesh Pro Support", "This will enable TextMesh Pro support. Your project must already contain the TextMesh Pro package. To continue, press OK. If you need to install TextMesh Pro first, press Cancel.", "OK", "Cancel"))
|
||||
{
|
||||
MoreEditorUtility.TryAddScriptingDefineSymbols("TMP_PRESENT");
|
||||
TouchScriptsWithScriptingSymbol("TMP_PRESENT");
|
||||
EditorUtility.DisplayDialog("TextMesh Pro Support Enabled", "TextMesh Pro support has been enabled. You may need to right-click on the two files named TextMeshProTypewriterEffect and select Reimport to be able to add them to your GameObjects. If you change build platforms, you may need to select this menu item again.", "OK");
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Pixel Crushers/Common/Misc/Enable TextMesh Pro Support...", true)]
|
||||
static bool ValidateAddTMPPRESENT()
|
||||
{
|
||||
return !MoreEditorUtility.DoesScriptingDefineSymbolExist("TMP_PRESENT");
|
||||
}
|
||||
|
||||
//=============================================================
|
||||
|
||||
[MenuItem("Tools/Pixel Crushers/Common/Misc/Enable Super Text Mesh Support...", false, 101)]
|
||||
static public void AddUSESTM()
|
||||
{
|
||||
if (EditorUtility.DisplayDialog("Enable Super Text Mesh Support", "This will enable Super Text Mesh support. Your project must already contain Super Text Mesh.\n\n*IMPORTANT*: Before pressing OK, you MUST move the Clavian folder into the Plugins folder!\n\nTo continue, press OK. If you need to install Super Text Mesh or move the folder first, press Cancel.", "OK", "Cancel"))
|
||||
{
|
||||
MoreEditorUtility.TryAddScriptingDefineSymbols("USE_STM");
|
||||
EditorUtility.DisplayDialog("Super Text Mesh Support Enabled", "Super Text Mesh support has been enabled.", "OK");
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Pixel Crushers/Common/Misc/Enable Super Text Mesh Support...", true)]
|
||||
static bool ValidateAddUSESTM()
|
||||
{
|
||||
return !MoreEditorUtility.DoesScriptingDefineSymbolExist("USE_STM");
|
||||
}
|
||||
|
||||
//=============================================================
|
||||
|
||||
#if UNITY_2019_1_OR_NEWER
|
||||
|
||||
[MenuItem("Tools/Pixel Crushers/Common/Misc/Use New Input System...", false, 102)]
|
||||
static public void AddUSENEWINPUT()
|
||||
{
|
||||
if (EditorUtility.DisplayDialog("Use New Input System", "This will switch the Input Device Manager to read from Unity's new Input System. You must have already added the Input System package.\n\nSee the configuration manual in Plugins > Pixel Crushers > Common > Documentation.", "OK", "Cancel"))
|
||||
{
|
||||
MoreEditorUtility.TryAddScriptingDefineSymbols("USE_NEW_INPUT");
|
||||
EditorUtility.DisplayDialog("Using New Input System", "See the configuration manual in Plugins > Pixel Crushers > Common > Documentation.", "OK");
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Pixel Crushers/Common/Misc/Use New Input System...", true)]
|
||||
static bool ValidateAddUSENEWINPUT()
|
||||
{
|
||||
return !MoreEditorUtility.DoesScriptingDefineSymbolExist("USE_NEW_INPUT");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//=============================================================
|
||||
|
||||
[MenuItem("Tools/Pixel Crushers/Common/Misc/Use NavMesh...", false, 103)]
|
||||
static public void AddUSENAVMESH()
|
||||
{
|
||||
if (EditorUtility.DisplayDialog("Use NavMesh", "If your project uses Unity's NavMesh AI navigation system, this will enable Pixel Crushers support for it.", "OK", "Cancel"))
|
||||
{
|
||||
MoreEditorUtility.TryAddScriptingDefineSymbols("USE_NAVMESH");
|
||||
EditorUtility.DisplayDialog("NavMesh Integration Enabled", "Pixel Crushers asset support for NavMeshes navigation is now enabled.", "OK");
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Pixel Crushers/Common/Misc/Use NavMesh...", true)]
|
||||
static bool ValidateAddUSENAVMESH()
|
||||
{
|
||||
return !MoreEditorUtility.DoesScriptingDefineSymbolExist("USE_NAVMESH");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a110bd7252c4c8142b596a4b7eb0b524
|
||||
timeCreated: 1530297921
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Misc/MoreEditorUtility.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,44 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
[CustomEditor(typeof(TimedEvent), true)]
|
||||
public class TimedEventEditor : Editor
|
||||
{
|
||||
private SerializedProperty modeProperty;
|
||||
private SerializedProperty durationProperty;
|
||||
private SerializedProperty framesProperty;
|
||||
private SerializedProperty activateOnStartProperty;
|
||||
private SerializedProperty onTimeReachedProperty;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
modeProperty = serializedObject.FindProperty("m_mode");
|
||||
durationProperty = serializedObject.FindProperty("m_duration");
|
||||
framesProperty = serializedObject.FindProperty("m_frames");
|
||||
activateOnStartProperty = serializedObject.FindProperty("m_activateOnStart");
|
||||
onTimeReachedProperty = serializedObject.FindProperty("m_onTimeReached");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
EditorGUILayout.PropertyField(modeProperty);
|
||||
if (modeProperty.enumValueIndex == (int)TimedEvent.TimingMode.Frames)
|
||||
{
|
||||
EditorGUILayout.PropertyField(framesProperty);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.PropertyField(durationProperty);
|
||||
}
|
||||
EditorGUILayout.PropertyField(activateOnStartProperty);
|
||||
EditorGUILayout.PropertyField(onTimeReachedProperty);
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a06a7c4f14779614f8f4c3dc3c2bcc41
|
||||
timeCreated: 1590110964
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Misc/TimedEventEditor.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,78 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
public static class TypeUtility
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Gets all non-abstract subtypes of a specified type.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Parent type.</typeparam>
|
||||
/// <returns>List of all non-abstract subtypes descended from the parent type.</returns>
|
||||
public static List<Type> GetSubtypes<T>() where T : class
|
||||
{
|
||||
var subtypes = new List<Type>();
|
||||
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
|
||||
{
|
||||
if (assembly.FullName.StartsWith("Mono.Cecil")) continue;
|
||||
if (assembly.FullName.StartsWith("UnityScript")) continue;
|
||||
if (assembly.FullName.StartsWith("Boo.Lan")) continue;
|
||||
if (assembly.FullName.StartsWith("System")) continue;
|
||||
if (assembly.FullName.StartsWith("I18N")) continue;
|
||||
if (assembly.FullName.StartsWith("UnityEngine")) continue;
|
||||
if (assembly.FullName.StartsWith("UnityEditor")) continue;
|
||||
if (assembly.FullName.StartsWith("mscorlib")) continue;
|
||||
try
|
||||
{
|
||||
foreach (Type type in assembly.GetTypes())
|
||||
{
|
||||
if (!type.IsClass) continue;
|
||||
if (type.IsAbstract) continue;
|
||||
if (!type.IsSubclassOf(typeof(T))) continue;
|
||||
subtypes.Add(type);
|
||||
}
|
||||
}
|
||||
catch (System.Reflection.ReflectionTypeLoadException)
|
||||
{
|
||||
}
|
||||
}
|
||||
return subtypes;
|
||||
}
|
||||
|
||||
public static System.Type GetWrapperType(System.Type type)
|
||||
{
|
||||
if (type == null || !type.Namespace.StartsWith("PixelCrushers") || type.Namespace.Contains(".Wrappers.")) return type;
|
||||
try
|
||||
{
|
||||
var wrapperName = type.Namespace + ".Wrappers." + type.Name;
|
||||
var assemblies = RuntimeTypeUtility.GetAssemblies();
|
||||
foreach (var assembly in assemblies)
|
||||
{
|
||||
try
|
||||
{
|
||||
var wrapperList = (from assemblyType in assembly.GetExportedTypes()
|
||||
where string.Equals(assemblyType.FullName, wrapperName)
|
||||
select assemblyType).ToArray();
|
||||
if (wrapperList.Length > 0) return wrapperList[0];
|
||||
}
|
||||
catch (System.Exception)
|
||||
{
|
||||
// If an assembly complains, ignore it and move on.
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (System.Exception)
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7f03e178ea6b714a929e35cf33c597a
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Misc/TypeUtility.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b1c05611e74be014b853ee663e2fdaac
|
||||
folderAsset: yes
|
||||
timeCreated: 1549415914
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,127 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditorInternal;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
[CustomEditor(typeof(DiskSavedGameDataStorer), true)]
|
||||
public class DiskSavedGameDataStorerEditor : Editor
|
||||
{
|
||||
|
||||
#if !(UNITY_WEBGL || UNITY_WSA)
|
||||
|
||||
private const int MaxSlots = 100;
|
||||
|
||||
private List<string> m_files;
|
||||
private ReorderableList m_list;
|
||||
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
var storer = target as DiskSavedGameDataStorer;
|
||||
|
||||
// Get active files:
|
||||
m_files = new List<string>();
|
||||
int slotNum = 0;
|
||||
var filename = storer.GetSavedGameInfoFilename();
|
||||
if (!string.IsNullOrEmpty(filename) && File.Exists(filename))
|
||||
{
|
||||
try
|
||||
{
|
||||
using (StreamReader streamReader = new StreamReader(filename))
|
||||
{
|
||||
int safeguard = 0;
|
||||
while (!streamReader.EndOfStream && safeguard < 999)
|
||||
{
|
||||
var sceneName = streamReader.ReadLine().Replace("<cr>", "\n");
|
||||
m_files.Add(storer.GetSaveGameFilename(slotNum) + ": " + sceneName);
|
||||
slotNum++;
|
||||
safeguard++;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.Exception)
|
||||
{
|
||||
Debug.Log("Save System: DiskSavedGameDataStorer - Error reading file: " + filename);
|
||||
}
|
||||
}
|
||||
|
||||
// Setup editor list:
|
||||
m_list = new ReorderableList(m_files, typeof(string), false, true, false, false);
|
||||
m_list.drawHeaderCallback = OnDrawHeader;
|
||||
m_list.drawElementCallback = OnDrawElement;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
//base.OnInspectorGUI();
|
||||
|
||||
serializedObject.Update();
|
||||
var locationProperty = serializedObject.FindProperty("storeSaveFilesIn");
|
||||
EditorGUILayout.PropertyField(locationProperty);
|
||||
if (locationProperty.enumValueIndex == (int)DiskSavedGameDataStorer.BasePath.Custom)
|
||||
{
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("customPath"));
|
||||
}
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("encrypt"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("encryptionPassword"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_debug"));
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
DrawSavedGameList();
|
||||
}
|
||||
|
||||
protected virtual void DrawSavedGameList()
|
||||
{
|
||||
if (m_list != null) m_list.DoLayoutList();
|
||||
if (GUILayout.Button(new GUIContent("Clear Saved Games", "Delete all saved game files.")))
|
||||
{
|
||||
if (EditorUtility.DisplayDialog("Clear Saved Games", "Delete all saved game files?", "OK", "Cancel"))
|
||||
{
|
||||
ClearSavedGames();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDrawHeader(Rect rect)
|
||||
{
|
||||
EditorGUI.LabelField(rect, "Saved Games");
|
||||
}
|
||||
|
||||
private void OnDrawElement(Rect rect, int index, bool isActive, bool isFocused)
|
||||
{
|
||||
if (!(0 <= index && index < m_files.Count)) return;
|
||||
var key = m_files[index];
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
EditorGUI.TextField(rect, key);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
|
||||
private void ClearSavedGames()
|
||||
{
|
||||
var storer = target as DiskSavedGameDataStorer;
|
||||
for (int i = m_files.Count - 1; i >= 0; i--)
|
||||
{
|
||||
storer.DeleteSavedGameData(i);
|
||||
}
|
||||
m_files.Clear();
|
||||
Repaint();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
EditorGUILayout.HelpBox("DiskSavedGameDataStorer is not supported on this build platform.", MessageType.Warning);
|
||||
base.OnInspectorGUI();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 36511bad05c9fcc488213c99dbd8a3c5
|
||||
timeCreated: 1561750316
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Save System/DiskSavedGameDataStorerEditor.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,112 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditorInternal;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
[CustomEditor(typeof(PlayerPrefsSavedGameDataStorer), true)]
|
||||
public class PlayerPrefsSavedGameDataStorerEditor : Editor
|
||||
{
|
||||
|
||||
private const int MaxSlots = 100;
|
||||
private string EmptySlotString = "-empty-";
|
||||
|
||||
private List<string> m_keys;
|
||||
private ReorderableList m_list;
|
||||
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
var storer = target as PlayerPrefsSavedGameDataStorer;
|
||||
|
||||
// Get active keys:
|
||||
m_keys = new List<string>();
|
||||
int lastActiveSlot = -1;
|
||||
for (int i = 1; i < MaxSlots; i++)
|
||||
{
|
||||
if (storer.HasDataInSlot(i)) lastActiveSlot = i;
|
||||
}
|
||||
for (int i = 1; i <= lastActiveSlot; i++)
|
||||
{
|
||||
m_keys.Add(storer.HasDataInSlot(i) ? storer.GetPlayerPrefsKey(i) : EmptySlotString);
|
||||
}
|
||||
|
||||
// Setup editor list:
|
||||
m_list = new ReorderableList(m_keys, typeof(string), false, true, false, true);
|
||||
m_list.drawHeaderCallback = OnDrawHeader;
|
||||
m_list.drawElementCallback = OnDrawElement;
|
||||
m_list.onRemoveCallback = OnRemoveElement;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
DrawSavedGameList();
|
||||
}
|
||||
|
||||
protected virtual void DrawSavedGameList()
|
||||
{
|
||||
if (m_list != null) m_list.DoLayoutList();
|
||||
if (GUILayout.Button(new GUIContent("Clear Saved Games", "Delete all PlayerPrefs keys associated with saved games.")))
|
||||
{
|
||||
if (EditorUtility.DisplayDialog("Clear Saved Games", "Delete all PlayerPrefs keys associated with saved games?", "OK", "Cancel"))
|
||||
{
|
||||
ClearSavedGames();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDrawHeader(Rect rect)
|
||||
{
|
||||
EditorGUI.LabelField(rect, "Saved Games");
|
||||
}
|
||||
|
||||
private void OnDrawElement(Rect rect, int index, bool isActive, bool isFocused)
|
||||
{
|
||||
if (!(0 <= index && index < m_keys.Count)) return;
|
||||
var key = m_keys[index];
|
||||
int buttonWidth = 48;
|
||||
var keyRect = new Rect(rect.x, rect.y + 1, rect.width - buttonWidth, EditorGUIUtility.singleLineHeight);
|
||||
var showRect = new Rect(rect.x + rect.width - buttonWidth, rect.y + 1, buttonWidth, EditorGUIUtility.singleLineHeight);
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
EditorGUI.TextField(keyRect, key);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
EditorGUI.BeginDisabledGroup(string.Equals(key, EmptySlotString));
|
||||
if (GUI.Button(showRect, "Show"))
|
||||
{
|
||||
Debug.Log(key + ": " + PlayerPrefs.GetString(key));
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
|
||||
private void OnRemoveElement(ReorderableList list)
|
||||
{
|
||||
if (!(0 <= list.index && list.index < m_keys.Count)) return;
|
||||
var key = m_keys[list.index];
|
||||
if (EditorUtility.DisplayDialog("Delete Saved Game", "Delete saved game " + key + "?", "OK", "Cancel"))
|
||||
{
|
||||
PlayerPrefs.DeleteKey(key);
|
||||
m_keys[list.index] = EmptySlotString;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void ClearSavedGames()
|
||||
{
|
||||
var baseKey = (target as PlayerPrefsSavedGameDataStorer).playerPrefsKeyBase;
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
var key = baseKey + i;
|
||||
if (PlayerPrefs.HasKey(key)) PlayerPrefs.DeleteKey(key);
|
||||
}
|
||||
m_keys.Clear();
|
||||
Repaint();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8cc97891a12eee040b4c022e25300313
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Save System/PlayerPrefsSavedGameDataStorerEditor.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,87 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Utility menu items for the Save System.
|
||||
/// </summary>
|
||||
public static class SaveSystemEditorUtility
|
||||
{
|
||||
|
||||
private static HashSet<string> s_keys = new HashSet<string>();
|
||||
|
||||
[MenuItem("Tools/Pixel Crushers/Common/Save System/Assign Unique Keys...", false, 0)]
|
||||
public static void AssignUniqueKeysDialog()
|
||||
{
|
||||
if (EditorUtility.DisplayDialog("Assign Unique Saver Keys", "Assign unique keys to all Saver components in the current scene whose Key fields are currently blank?", "OK", "Cancel"))
|
||||
{
|
||||
AssignUniqueKeysInScene();
|
||||
}
|
||||
}
|
||||
|
||||
public static void AssignUniqueKeysInScene()
|
||||
{
|
||||
s_keys.Clear();
|
||||
for (int i = 0; i < EditorSceneManager.sceneCount; i++)
|
||||
{
|
||||
var s = EditorSceneManager.GetSceneAt(i);
|
||||
if (s.isLoaded)
|
||||
{
|
||||
var allGameObjects = s.GetRootGameObjects();
|
||||
for (int j = 0; j < allGameObjects.Length; j++)
|
||||
{
|
||||
AssignUniqueKeysInTransformHierarchy(allGameObjects[j].transform);
|
||||
}
|
||||
}
|
||||
}
|
||||
s_keys.Clear();
|
||||
}
|
||||
|
||||
private static void AssignUniqueKeysInTransformHierarchy(Transform t)
|
||||
{
|
||||
if (t == null) return;
|
||||
var savers = t.GetComponents<Saver>();
|
||||
for (int i = 0; i < savers.Length; i++)
|
||||
{
|
||||
var saver = savers[i];
|
||||
if (string.IsNullOrEmpty(saver._internalKeyValue))
|
||||
{
|
||||
// Key is not assigned yet. Assign one:
|
||||
AssignNewKey(saver, " [new]");
|
||||
}
|
||||
else if (s_keys.Contains(saver._internalKeyValue))
|
||||
{
|
||||
// Key is already used. Assign a new one:
|
||||
AssignNewKey(saver, " [key '" + saver._internalKeyValue + "' already exists; make unique]");
|
||||
}
|
||||
s_keys.Add(saver._internalKeyValue);
|
||||
}
|
||||
foreach (Transform child in t)
|
||||
{
|
||||
AssignUniqueKeysInTransformHierarchy(child);
|
||||
}
|
||||
}
|
||||
|
||||
private static void AssignNewKey(Saver saver, string reason)
|
||||
{
|
||||
if (saver == null) return;
|
||||
var key = CleanName(saver.name) + "_" + Mathf.Abs(saver.GetInstanceID());
|
||||
Debug.Log(saver.name + "." + saver.GetType().Name + ".Key = " + key + reason, saver);
|
||||
Undo.RecordObject(saver, "Key");
|
||||
saver._internalKeyValue = key;
|
||||
saver.appendSaverTypeToKey = false;
|
||||
}
|
||||
|
||||
private static string CleanName(string name)
|
||||
{
|
||||
if (string.IsNullOrEmpty(name)) return name;
|
||||
return System.Text.RegularExpressions.Regex.Replace(name, @"[\(\s\)\.\,\'""]", string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0ce6b1d9bfb10c54da02aa4554949b41
|
||||
timeCreated: 1538006943
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Save System/SaveSystemEditorUtility.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,51 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
[CustomEditor(typeof(Saver), true)]
|
||||
public class SaverEditor : Editor
|
||||
{
|
||||
|
||||
protected Saver[] m_saversOnGameObject;
|
||||
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
m_saversOnGameObject = (target is Saver) ? (target as Saver).GetComponents<Saver>() : null;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
CheckSaverKeys();
|
||||
base.OnInspectorGUI();
|
||||
}
|
||||
|
||||
protected virtual void CheckSaverKeys()
|
||||
{
|
||||
if (m_saversOnGameObject == null) return;
|
||||
var numSavers = 0;
|
||||
var anyBlankKeys = false;
|
||||
for (int i = 0; i < m_saversOnGameObject.Length; i++)
|
||||
{
|
||||
var saver = m_saversOnGameObject[i];
|
||||
if (saver != null)
|
||||
{
|
||||
numSavers++;
|
||||
if (!saver.appendSaverTypeToKey && string.IsNullOrEmpty(saver._internalKeyValue))
|
||||
{
|
||||
anyBlankKeys = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (numSavers > 1 && anyBlankKeys)
|
||||
{
|
||||
EditorGUILayout.HelpBox("GameObject has more than one Saver component. Make sure each Saver has a unique Key.", MessageType.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1898d5456617565459b0cbdacb0ae67c
|
||||
timeCreated: 1629213895
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Save System/SaverEditor.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eee3a84c9cf0f6c4a9828ed772df921d
|
||||
folderAsset: yes
|
||||
timeCreated: 1549415914
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,170 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
public static class CSVUtility
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Writes a table of strings to a CSV file.
|
||||
/// </summary>
|
||||
/// <param name="content">2D list of strings.</param>
|
||||
/// <param name="filename">Filename to write as.</param>
|
||||
/// <param name="encodingType">Encoding type to use.</param>
|
||||
public static void WriteCSVFile(List<List<string>> content, string filename, EncodingType encodingType)
|
||||
{
|
||||
using (var file = new StreamWriter(filename, false, EncodingTypeTools.GetEncoding(encodingType)))
|
||||
{
|
||||
for (int i = 0; i < content.Count; i++)
|
||||
{
|
||||
var row = content[i];
|
||||
StringBuilder sb = new StringBuilder();
|
||||
var first = true;
|
||||
for (int j = 0; j < row.Count; j++)
|
||||
{
|
||||
if (!first) sb.Append(",");
|
||||
first = false;
|
||||
var cell = row[j];
|
||||
sb.Append(CleanField(cell));
|
||||
}
|
||||
file.WriteLine(sb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads a CSV file into a table of strings.
|
||||
/// </summary>
|
||||
/// <param name="filename">Name of CSV file to read.</param>
|
||||
/// <param name="encodingType">Encoding type CSV file was created in.</param>
|
||||
/// <returns>Contents of CSV file as a 2D list of strings.</returns>
|
||||
public static List<List<string>> ReadCSVFile(string filename, EncodingType encodingType)
|
||||
{
|
||||
// Read the source file and combine multiline rows:
|
||||
var sourceLines = new List<string>();
|
||||
using (var file = new StreamReader(filename, EncodingTypeTools.GetEncoding(encodingType)))
|
||||
{
|
||||
string line;
|
||||
while ((line = file.ReadLine()) != null)
|
||||
{
|
||||
sourceLines.Add(line.TrimEnd());
|
||||
}
|
||||
}
|
||||
CombineMultilineSourceLines(sourceLines);
|
||||
if (sourceLines.Count < 1) return null;
|
||||
|
||||
var content = new List<List<string>>();
|
||||
while (sourceLines.Count > 0)
|
||||
{
|
||||
var values = GetValues(sourceLines[0]);
|
||||
sourceLines.RemoveAt(0);
|
||||
if (values == null || values.Length == 0) continue;
|
||||
var row = new List<string>();
|
||||
content.Add(row);
|
||||
for (int i = 0; i < values.Length; i++)
|
||||
{
|
||||
row.Add(values[i]);
|
||||
}
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
private static string CleanField(string s)
|
||||
{
|
||||
if (string.IsNullOrEmpty(s)) return string.Empty;
|
||||
string s2 = s.Contains("\n") ? s.Replace("\n", "\\n") : s;
|
||||
if (s2.Contains("\r")) s2 = s2.Replace("\r", "\\r");
|
||||
if (s2.Contains(",") || s2.Contains("\""))
|
||||
{
|
||||
return "\"" + s2.Replace("\"", "\"\"") + "\"";
|
||||
}
|
||||
else
|
||||
{
|
||||
return s2;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the individual comma-separated values in a line.
|
||||
/// </summary>
|
||||
/// <returns>The values.</returns>
|
||||
/// <param name="line">Line.</param>
|
||||
private static string[] GetValues(string line)
|
||||
{
|
||||
Regex csvSplit = new Regex("(?:^|,)(\"(?:[^\"]+|\"\")*\"|[^,]*)");
|
||||
List<string> values = new List<string>();
|
||||
foreach (Match match in csvSplit.Matches(line))
|
||||
{
|
||||
values.Add(UnwrapValue(match.Value.TrimStart(',')));
|
||||
}
|
||||
return values.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a "fixed" version of a comma-separated value where escaped newlines
|
||||
/// have been converted back into real newlines, and optional surrounding quotes
|
||||
/// have been removed.
|
||||
/// </summary>
|
||||
/// <returns>The value.</returns>
|
||||
/// <param name="value">Value.</param>
|
||||
private static string UnwrapValue(string value)
|
||||
{
|
||||
string s = value.Replace("\\n", "\n").Replace("\\r", "\r");
|
||||
if (s.StartsWith("\"") && s.EndsWith("\""))
|
||||
{
|
||||
s = s.Substring(1, s.Length - 2).Replace("\"\"", "\"");
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Combines lines that are actually a multiline CSV row. This also helps prevent the
|
||||
/// CSV-splitting regex from hanging due to catastrophic backtracking on unterminated quotes.
|
||||
/// </summary>
|
||||
private static void CombineMultilineSourceLines(List<string> sourceLines)
|
||||
{
|
||||
int lineNum = 0;
|
||||
int safeguard = 0;
|
||||
int MaxIterations = 999999;
|
||||
while ((lineNum < sourceLines.Count) && (safeguard < MaxIterations))
|
||||
{
|
||||
safeguard++;
|
||||
string line = sourceLines[lineNum];
|
||||
if (line == null)
|
||||
{
|
||||
sourceLines.RemoveAt(lineNum);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool terminated = true;
|
||||
char previousChar = (char)0;
|
||||
for (int i = 0; i < line.Length; i++)
|
||||
{
|
||||
char currentChar = line[i];
|
||||
bool isQuote = (currentChar == '"') && (previousChar != '\\');
|
||||
if (isQuote) terminated = !terminated;
|
||||
previousChar = currentChar;
|
||||
}
|
||||
if (terminated || (lineNum + 1) >= sourceLines.Count)
|
||||
{
|
||||
if (!terminated) sourceLines[lineNum] = line + '"';
|
||||
lineNum++;
|
||||
}
|
||||
else
|
||||
{
|
||||
sourceLines[lineNum] = line + "\\n" + sourceLines[lineNum + 1];
|
||||
sourceLines.RemoveAt(lineNum + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5bc76f91176340e46a2e240833f25b2a
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Text/CSVUtility.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,181 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
[CustomPropertyDrawer(typeof(StringField), true)]
|
||||
public class StringFieldDrawer : PropertyDrawer
|
||||
{
|
||||
|
||||
public const int NumExpandedLines = 5;
|
||||
|
||||
private static GUIStyle s_wrappedTextAreaGUIStyle = null;
|
||||
|
||||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
|
||||
{
|
||||
return GetHeight(property);
|
||||
}
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
Draw(position, property, label, false);
|
||||
}
|
||||
|
||||
public static float GetHeight(SerializedProperty property)
|
||||
{
|
||||
var textProperty = property.FindPropertyRelative("m_text");
|
||||
var stringAssetProperty = property.FindPropertyRelative("m_stringAsset");
|
||||
var textTableProperty = property.FindPropertyRelative("m_textTable");
|
||||
var isContentAssigned = (textProperty != null && !string.IsNullOrEmpty(textProperty.stringValue)) ||
|
||||
(stringAssetProperty != null && stringAssetProperty.objectReferenceValue != null) ||
|
||||
(textTableProperty != null && textTableProperty.objectReferenceValue != null);
|
||||
return (isContentAssigned ? 1 : 3) * EditorGUIUtility.singleLineHeight;
|
||||
}
|
||||
|
||||
public static void Draw(Rect position, SerializedProperty property, GUIContent label, bool expandHeight)
|
||||
{
|
||||
try
|
||||
{
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
|
||||
position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
|
||||
|
||||
// Get child properties:
|
||||
var textProperty = property.FindPropertyRelative("m_text");
|
||||
var stringAssetProperty = property.FindPropertyRelative("m_stringAsset");
|
||||
var textTableProperty = property.FindPropertyRelative("m_textTable");
|
||||
var textTableFieldIDProperty = property.FindPropertyRelative("m_textTableFieldID");
|
||||
if (textProperty == null || stringAssetProperty == null || textTableProperty == null || textTableFieldIDProperty == null)
|
||||
{
|
||||
Debug.LogError("Sorry! There was an internal editor error with a String Field. Please contact Pixel Crushers for support.");
|
||||
return;
|
||||
}
|
||||
var isTextAssigned = (!string.IsNullOrEmpty(textProperty.stringValue));
|
||||
var isStringAssetAssigned = (stringAssetProperty.objectReferenceValue != null);
|
||||
var isTextTableAssigned = (textTableProperty.objectReferenceValue != null);
|
||||
var isContentAssigned = isTextAssigned || isStringAssetAssigned || isTextTableAssigned;
|
||||
|
||||
float yOffset = 0;
|
||||
|
||||
// Text row:
|
||||
if (isTextAssigned || !isContentAssigned)
|
||||
{
|
||||
if (expandHeight)
|
||||
{
|
||||
if (s_wrappedTextAreaGUIStyle == null)
|
||||
{
|
||||
s_wrappedTextAreaGUIStyle = new GUIStyle(EditorStyles.textArea);
|
||||
s_wrappedTextAreaGUIStyle.wordWrap = true;
|
||||
}
|
||||
textProperty.stringValue = EditorGUI.TextArea(new Rect(position.x, position.y, position.width, NumExpandedLines * EditorGUIUtility.singleLineHeight), textProperty.stringValue, s_wrappedTextAreaGUIStyle);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight), textProperty, GUIContent.none);
|
||||
}
|
||||
yOffset += (expandHeight ? NumExpandedLines : 1) * EditorGUIUtility.singleLineHeight;
|
||||
}
|
||||
|
||||
if (isStringAssetAssigned || !isContentAssigned)
|
||||
{
|
||||
float buttonWidth = 40;
|
||||
EditorGUI.PropertyField(new Rect(position.x, position.y + yOffset, position.width - buttonWidth, EditorGUIUtility.singleLineHeight), stringAssetProperty, GUIContent.none);
|
||||
EditorGUI.BeginDisabledGroup(isStringAssetAssigned);
|
||||
bool createNewAsset = GUI.Button(new Rect(position.x + position.width - buttonWidth, position.y + yOffset, buttonWidth, EditorGUIUtility.singleLineHeight),
|
||||
new GUIContent("New", "Create and assign a new String Asset."), EditorStyles.miniButton);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
//--Pre-DLL support: if (createNewAsset) stringAssetProperty.objectReferenceValue = AssetUtility.CreateAsset<Wrappers.StringAsset>("String Asset", false);
|
||||
if (createNewAsset)
|
||||
{
|
||||
var filename = EditorUtility.SaveFilePanelInProject("Create String Asset", ObjectNames.NicifyVariableName(property.name), "asset", "Save new string asset as:");
|
||||
var type = System.Type.GetType("PixelCrushers.Wrappers.StringAsset, Assembly-CSharp-firstpass");
|
||||
if (type == null) type = System.Type.GetType("PixelCrushers.Wrappers.StringAsset, Assembly-CSharp");
|
||||
if (type == null)
|
||||
{
|
||||
Debug.LogError("Internal error: Unable to find wrapper type PixelCrushers.Wrappers.StringAsset. Please contact the developer.");
|
||||
}
|
||||
else
|
||||
{
|
||||
stringAssetProperty.objectReferenceValue = AssetUtility.CreateAssetWithFilename(type, filename, false);
|
||||
}
|
||||
}
|
||||
yOffset += EditorGUIUtility.singleLineHeight;
|
||||
}
|
||||
|
||||
if (isTextTableAssigned || !isContentAssigned)
|
||||
{
|
||||
float fieldWidth = isTextTableAssigned ? position.width / 2 : position.width;
|
||||
EditorGUI.PropertyField(new Rect(position.x, position.y + yOffset, fieldWidth, EditorGUIUtility.singleLineHeight), textTableProperty, GUIContent.none);
|
||||
if (isTextTableAssigned)
|
||||
{
|
||||
textTableFieldIDProperty.intValue = DrawTextTableFieldDropdown(new Rect(position.x + fieldWidth, position.y + yOffset, fieldWidth, EditorGUIUtility.singleLineHeight),
|
||||
textTableProperty.objectReferenceValue as TextTable, textTableFieldIDProperty.intValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
EditorGUI.EndProperty();
|
||||
}
|
||||
}
|
||||
|
||||
private static int DrawTextTableFieldDropdown(Rect rect, TextTable textTable, int fieldID)
|
||||
{
|
||||
if (textTable == null || textTable.fields == null) return fieldID;
|
||||
var fieldNames = textTable.GetFieldNames();
|
||||
var fieldIDs = textTable.GetFieldIDs();
|
||||
int index = -1;
|
||||
for (int i = 0; i < fieldIDs.Length; i++)
|
||||
{
|
||||
if (fieldIDs[i] == fieldID)
|
||||
{
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var newIndex = EditorGUI.Popup(rect, index, fieldNames);
|
||||
return (newIndex != -1 && newIndex != index) ? fieldIDs[newIndex] : fieldID;
|
||||
}
|
||||
|
||||
public static string GetStringFieldValue(SerializedProperty stringFieldProperty)
|
||||
{
|
||||
if (stringFieldProperty == null) return string.Empty;
|
||||
var textProperty = stringFieldProperty.FindPropertyRelative("m_text");
|
||||
if (textProperty != null && !string.IsNullOrEmpty(textProperty.stringValue))
|
||||
{
|
||||
return textProperty.stringValue;
|
||||
}
|
||||
var stringAssetProperty = stringFieldProperty.FindPropertyRelative("m_stringAsset");
|
||||
if (stringAssetProperty != null && stringAssetProperty.objectReferenceValue is StringAsset)
|
||||
{
|
||||
return (stringAssetProperty.objectReferenceValue as StringAsset).text;
|
||||
}
|
||||
var textTableProperty = stringFieldProperty.FindPropertyRelative("m_textTable");
|
||||
if (textTableProperty != null && textTableProperty.objectReferenceValue is TextTable)
|
||||
{
|
||||
var textTable = textTableProperty.objectReferenceValue as TextTable;
|
||||
var textTableFieldIDProperty = stringFieldProperty.FindPropertyRelative("m_textTableFieldID");
|
||||
return textTable.GetFieldTextForLanguage(textTableFieldIDProperty.intValue,
|
||||
(UILocalizationManager.instance != null) ? UILocalizationManager.instance.currentLanguage : string.Empty);
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public static void SetStringFieldValue(SerializedProperty stringFieldProperty, string value)
|
||||
{
|
||||
if (stringFieldProperty == null) return;
|
||||
var textProperty = stringFieldProperty.FindPropertyRelative("m_text");
|
||||
if (textProperty != null) textProperty.stringValue = value;
|
||||
var stringAssetProperty = stringFieldProperty.FindPropertyRelative("m_stringAsset");
|
||||
if (stringAssetProperty != null) stringAssetProperty.objectReferenceValue = null;
|
||||
var textTableProperty = stringFieldProperty.FindPropertyRelative("m_textTable");
|
||||
if (textTableProperty != null) textTableProperty.objectReferenceValue = null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2d021fbf144c817489417aa063f92ca2
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Text/StringFieldDrawer.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,42 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
[CustomPropertyDrawer(typeof(StringFieldTextAreaAttribute))]
|
||||
public class StringFieldTextAreaAttributeDrawer : PropertyDrawer
|
||||
{
|
||||
|
||||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
|
||||
{
|
||||
var stringFieldSizeAttribute = attribute as StringFieldTextAreaAttribute;
|
||||
if (stringFieldSizeAttribute == null) return base.GetPropertyHeight(property, label);
|
||||
var expandHeight = stringFieldSizeAttribute.expandHeight;
|
||||
|
||||
var textProperty = property.FindPropertyRelative("m_text");
|
||||
var stringAssetProperty = property.FindPropertyRelative("m_stringAsset");
|
||||
var textTableProperty = property.FindPropertyRelative("m_textTable");
|
||||
if (textProperty == null || stringAssetProperty == null || textTableProperty == null) return base.GetPropertyHeight(property, label);
|
||||
var isTextAssigned = (textProperty != null && !string.IsNullOrEmpty(textProperty.stringValue));
|
||||
var isStringAssetAssigned = (stringAssetProperty != null && stringAssetProperty.objectReferenceValue != null);
|
||||
var isTextTableAssigned = (textTableProperty != null && textTableProperty.objectReferenceValue != null);
|
||||
var isContentAssigned = isTextAssigned || isStringAssetAssigned || isTextTableAssigned;
|
||||
|
||||
var textLines = expandHeight ? StringFieldDrawer.NumExpandedLines : 1;
|
||||
if (isContentAssigned && !isTextAssigned) textLines = 0;
|
||||
var nonTextLines = isTextAssigned ? 0 : (isContentAssigned ? 1 : 2);
|
||||
return (textLines + nonTextLines) * EditorGUIUtility.singleLineHeight;
|
||||
}
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
var stringFieldSizeAttribute = attribute as StringFieldTextAreaAttribute;
|
||||
var expandHeight = (stringFieldSizeAttribute != null) ? stringFieldSizeAttribute.expandHeight : false;
|
||||
StringFieldDrawer.Draw(position, property, label, expandHeight);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f4cc1e51e3d5a7441ad01e8d84f85082
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Text/StringFieldTextAreaAttributeDrawer.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,74 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
[CustomEditor(typeof(TextTable), true)]
|
||||
public class TextTableEditor : Editor
|
||||
{
|
||||
|
||||
private TextTable m_textTable;
|
||||
private int m_languageCount;
|
||||
private int m_fieldCount;
|
||||
private string m_languageCountText;
|
||||
private string m_fieldCountText;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
EditorApplication.projectWindowItemOnGUI += OnProjectWindowItemOnGUI;
|
||||
m_textTable = target as TextTable;
|
||||
UpdateLabelText();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
EditorApplication.projectWindowItemOnGUI -= OnProjectWindowItemOnGUI;
|
||||
}
|
||||
|
||||
private void OnProjectWindowItemOnGUI(string guid, Rect selectionRect)
|
||||
{
|
||||
// Check for double-clicks to open editor window:
|
||||
var doubleClicked = Event.current.type == EventType.MouseDown && Event.current.clickCount == 2 && selectionRect.Contains(Event.current.mousePosition);
|
||||
if (doubleClicked)
|
||||
{
|
||||
TextTableEditorWindow.ShowWindow();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (TextTableEditorWindow.isOpen)
|
||||
{
|
||||
EditorGUILayout.HelpBox("A Text Table is a database of text fields and translations into any number of languages. Edit it in the Text Table window.", MessageType.None);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.HelpBox("A Text Table is a database of text fields and translations into any number of languages. To edit it, click on the Open Text Table Editor button below.", MessageType.None);
|
||||
if (GUILayout.Button("Open Text Table Editor"))
|
||||
{
|
||||
TextTableEditorWindow.ShowWindow();
|
||||
}
|
||||
}
|
||||
if (m_textTable.languages.Count != m_languageCount || m_textTable.fields.Count != m_fieldCount)
|
||||
{
|
||||
UpdateLabelText();
|
||||
}
|
||||
EditorGUILayout.LabelField(m_languageCountText);
|
||||
EditorGUILayout.LabelField(m_fieldCountText);
|
||||
|
||||
// Debug: DrawDefaultInspector();
|
||||
}
|
||||
|
||||
private void UpdateLabelText()
|
||||
{
|
||||
m_languageCount = m_textTable.languages.Count;
|
||||
m_fieldCount = m_textTable.fields.Count;
|
||||
m_languageCountText = "Languages: " + m_languageCount;
|
||||
m_fieldCountText = "Fields: " + m_fieldCount;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d180f5ccb807d7e4489c2a31b334388b
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Text/TextTableEditor.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9b26dc2337a4ecd4285aafb655ca55de
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Text/TextTableEditorWindow.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,408 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEditor;
|
||||
using UnityEditorInternal;
|
||||
using UnityEngine;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Custom editor window for mass exporting text tables to CSV.
|
||||
/// </summary>
|
||||
public class TextTableMassExportImportWindow : EditorWindow
|
||||
{
|
||||
|
||||
#region Menu Item
|
||||
|
||||
[MenuItem("Tools/Pixel Crushers/Common/Text Table Mass Export")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
GetWindow<TextTableMassExportImportWindow>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private const string PrefsKey = "PixelCrushers.TextTableMassExport";
|
||||
|
||||
[Serializable]
|
||||
public class Prefs
|
||||
{
|
||||
public List<string> textTableGuids = new List<string>();
|
||||
public string csvFilename;
|
||||
public EncodingType encodingType = EncodingType.UTF8;
|
||||
}
|
||||
|
||||
private Prefs prefs;
|
||||
private List<TextTable> textTables = new List<TextTable>();
|
||||
private ReorderableList textTablesList;
|
||||
private Vector2 scrollPosition = Vector2.zero;
|
||||
private string folderPath;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (EditorPrefs.HasKey(PrefsKey))
|
||||
{
|
||||
prefs = JsonUtility.FromJson<Prefs>(EditorPrefs.GetString(PrefsKey));
|
||||
}
|
||||
if (prefs == null) prefs = new Prefs();
|
||||
|
||||
textTables.Clear();
|
||||
foreach (var textTableGuid in prefs.textTableGuids)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(textTableGuid))
|
||||
{
|
||||
var textTable = AssetDatabase.LoadAssetAtPath<TextTable>(AssetDatabase.GUIDToAssetPath(textTableGuid));
|
||||
if (textTable != null)
|
||||
{
|
||||
textTables.Add(textTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
prefs.textTableGuids.Clear();
|
||||
foreach (var textTable in textTables)
|
||||
{
|
||||
prefs.textTableGuids.Add((textTable != null) ? AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(textTable)) : string.Empty);
|
||||
}
|
||||
EditorPrefs.SetString(PrefsKey, JsonUtility.ToJson(prefs));
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
try
|
||||
{
|
||||
scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
|
||||
if (textTablesList == null)
|
||||
{
|
||||
textTablesList = new ReorderableList(textTables, typeof(TextTable), true, true, true, true);
|
||||
textTablesList.drawHeaderCallback += OnDrawTextTablesListHeader;
|
||||
textTablesList.drawElementCallback += OnDrawTextTablesListElement;
|
||||
textTablesList.onAddCallback += OnAddTextTable;
|
||||
}
|
||||
textTablesList.DoLayoutList();
|
||||
if (GUILayout.Button("Add Folder..."))
|
||||
{
|
||||
AddFolder();
|
||||
}
|
||||
prefs.encodingType = (EncodingType)EditorGUILayout.EnumPopup("Encoding Type", prefs.encodingType);
|
||||
EditorGUI.BeginDisabledGroup(!HasAnyTextTables());
|
||||
if (GUILayout.Button("Export to CSV..."))
|
||||
{
|
||||
ExportToCSV();
|
||||
}
|
||||
if (GUILayout.Button("Import from CSV File..."))
|
||||
{
|
||||
ImportFromCSVFile();
|
||||
}
|
||||
if (GUILayout.Button("Import from CSV Folder..."))
|
||||
{
|
||||
ImportFromCSVFolder();
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
finally
|
||||
{
|
||||
EditorGUILayout.EndScrollView();
|
||||
}
|
||||
}
|
||||
|
||||
private bool HasAnyTextTables()
|
||||
{
|
||||
return textTables.Find(x => x != null) != null;
|
||||
}
|
||||
|
||||
private void OnDrawTextTablesListHeader(Rect rect)
|
||||
{
|
||||
EditorGUI.LabelField(rect, "Text Tables");
|
||||
}
|
||||
|
||||
private void OnDrawTextTablesListElement(Rect rect, int index, bool isActive, bool isFocused)
|
||||
{
|
||||
if (!(0 <= index && index < textTables.Count)) return;
|
||||
textTables[index] = EditorGUI.ObjectField(rect, textTables[index], typeof(TextTable), true) as TextTable;
|
||||
}
|
||||
|
||||
private void OnAddTextTable(ReorderableList list)
|
||||
{
|
||||
textTables.Add(null);
|
||||
}
|
||||
|
||||
private void AddFolder()
|
||||
{
|
||||
var newPath = EditorUtility.OpenFolderPanel("Add Text Tables", folderPath, folderPath);
|
||||
if (!string.IsNullOrEmpty(newPath))
|
||||
{
|
||||
folderPath = newPath;
|
||||
var filenames = Directory.GetFiles(folderPath, "*.asset", SearchOption.AllDirectories);
|
||||
foreach (var filename in filenames)
|
||||
{
|
||||
string assetPath = filename.Replace("\\", "/");
|
||||
assetPath = "Assets/" + assetPath.Substring(Application.dataPath.Length);
|
||||
var textTable = AssetDatabase.LoadAssetAtPath<TextTable>(assetPath);
|
||||
if (textTable != null && !textTables.Contains(textTable))
|
||||
{
|
||||
textTables.Add(textTable);
|
||||
}
|
||||
}
|
||||
if (Application.platform == RuntimePlatform.WindowsEditor) folderPath = folderPath.Replace("/", "\\");
|
||||
}
|
||||
}
|
||||
|
||||
private void ExportToCSV()
|
||||
{
|
||||
string newFilename = EditorUtility.SaveFilePanel("Export to CSV", GetPath(prefs.csvFilename), prefs.csvFilename, "csv");
|
||||
if (string.IsNullOrEmpty(newFilename)) return;
|
||||
prefs.csvFilename = newFilename;
|
||||
if (Application.platform == RuntimePlatform.WindowsEditor) prefs.csvFilename = prefs.csvFilename.Replace("/", "\\");
|
||||
switch (EditorUtility.DisplayDialogComplex("Export CSV", "Export languages as columns in one file or as separate files?", "One", "Cancel", "Separate"))
|
||||
{
|
||||
case 0:
|
||||
ExportCSV(prefs.csvFilename, false);
|
||||
break;
|
||||
case 2:
|
||||
ExportCSV(prefs.csvFilename, true);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
EditorUtility.DisplayDialog("Export Complete", "The text table was exported to CSV (comma-separated values) format. ", "OK");
|
||||
}
|
||||
|
||||
private void ImportFromCSVFile()
|
||||
{
|
||||
if (!EditorUtility.DisplayDialog("Import CSV?", "Importing from CSV will overwrite any existing languages or fields with the same name in the current contents. Are you sure?", "Import", "Cancel")) return;
|
||||
string newFilename = EditorUtility.OpenFilePanel("Import from CSV", GetPath(prefs.csvFilename), "csv");
|
||||
if (string.IsNullOrEmpty(newFilename)) return;
|
||||
if (!File.Exists(newFilename))
|
||||
{
|
||||
EditorUtility.DisplayDialog("Import CSV", "Can't find the file " + newFilename + ".", "OK");
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
EditorUtility.DisplayProgressBar("Importing CSV File", newFilename, 0);
|
||||
prefs.csvFilename = newFilename;
|
||||
if (Application.platform == RuntimePlatform.WindowsEditor) prefs.csvFilename = prefs.csvFilename.Replace("/", "\\");
|
||||
ImportCSVFile(prefs.csvFilename);
|
||||
if (TextTableEditorWindow.instance != null)
|
||||
{
|
||||
var selection = Selection.activeObject;
|
||||
Selection.activeObject = null;
|
||||
Selection.activeObject = selection;
|
||||
}
|
||||
EditorUtility.ClearProgressBar();
|
||||
EditorUtility.DisplayDialog("Import Complete", "The text tables have been updated from CSV. ", "OK");
|
||||
}
|
||||
finally
|
||||
{
|
||||
EditorUtility.ClearProgressBar();
|
||||
}
|
||||
}
|
||||
|
||||
private void ImportFromCSVFolder()
|
||||
{
|
||||
if (!EditorUtility.DisplayDialog("Import CSV?", "Importing from CSV will overwrite any existing languages or fields with the same name in the current contents. Are you sure?", "Import", "Cancel")) return;
|
||||
string newFolder = EditorUtility.OpenFolderPanel("Import from CSV Folder", GetPath(prefs.csvFilename), "csv");
|
||||
if (string.IsNullOrEmpty(newFolder)) return;
|
||||
try
|
||||
{
|
||||
EditorUtility.DisplayProgressBar("Importing CSV Files", newFolder, 0);
|
||||
var filenames = Directory.GetFiles(newFolder);
|
||||
foreach (var filename in filenames)
|
||||
{
|
||||
if (!filename.EndsWith(".csv", StringComparison.OrdinalIgnoreCase)) continue;
|
||||
Debug.Log($"Importing {filename}");
|
||||
ImportCSVFile(filename);
|
||||
}
|
||||
if (TextTableEditorWindow.instance != null)
|
||||
{
|
||||
var selection = Selection.activeObject;
|
||||
Selection.activeObject = null;
|
||||
Selection.activeObject = selection;
|
||||
}
|
||||
EditorUtility.ClearProgressBar();
|
||||
EditorUtility.DisplayDialog("Import Complete", "The text tables have been updated from CSV. ", "OK");
|
||||
}
|
||||
finally
|
||||
{
|
||||
EditorUtility.ClearProgressBar();
|
||||
}
|
||||
}
|
||||
|
||||
private string GetPath(string filename)
|
||||
{
|
||||
if (string.IsNullOrEmpty(filename)) return string.Empty;
|
||||
try
|
||||
{
|
||||
return Path.GetDirectoryName(filename);
|
||||
}
|
||||
catch (System.ArgumentException)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
private List<string> GetLanguages()
|
||||
{
|
||||
var hashSet = new HashSet<string>();
|
||||
foreach (var textTable in textTables)
|
||||
{
|
||||
if (textTable == null) continue;
|
||||
foreach (var language in textTable.languages.Keys)
|
||||
{
|
||||
hashSet.Add(language);
|
||||
}
|
||||
}
|
||||
return new List<string>(hashSet);
|
||||
}
|
||||
|
||||
private void ExportCSV(string csvFilename, bool separateFiles)
|
||||
{
|
||||
var languages = GetLanguages();
|
||||
if (separateFiles)
|
||||
{
|
||||
foreach (var language in languages)
|
||||
{
|
||||
var content = new List<List<string>>();
|
||||
var row = new List<string>();
|
||||
row.Add("Language");
|
||||
row.Add(language);
|
||||
content.Add(row);
|
||||
foreach (var textTable in textTables)
|
||||
{
|
||||
if (textTable == null) continue;
|
||||
var hasLanguage = textTable.HasLanguage(language);
|
||||
int languageID = textTable.GetLanguageID(language);
|
||||
foreach (var fieldKvp in textTable.fields)
|
||||
{
|
||||
var field = fieldKvp.Value;
|
||||
row = new List<string>();
|
||||
row.Add(field.fieldName);
|
||||
var text = hasLanguage ? field.GetTextForLanguage(languageID) : "";
|
||||
row.Add(text);
|
||||
content.Add(row);
|
||||
}
|
||||
}
|
||||
var languageFilename = csvFilename.Substring(0, csvFilename.Length - 4) + "_" + language + ".csv";
|
||||
CSVUtility.WriteCSVFile(content, languageFilename, prefs.encodingType);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// All in one file:
|
||||
var content = new List<List<string>>();
|
||||
|
||||
// Heading rows:
|
||||
var row = new List<string>();
|
||||
content.Add(row);
|
||||
row.Add("Field");
|
||||
foreach (var language in languages)
|
||||
{
|
||||
row.Add(language);
|
||||
}
|
||||
foreach (var textTable in textTables)
|
||||
{
|
||||
if (textTable == null) continue;
|
||||
// One row per field:
|
||||
foreach (var kvp in textTable.fields)
|
||||
{
|
||||
var field = kvp.Value;
|
||||
row = new List<string>();
|
||||
content.Add(row);
|
||||
row.Add(field.fieldName);
|
||||
foreach (var language in languages)
|
||||
{
|
||||
if (textTable.HasLanguage(language))
|
||||
{
|
||||
var languageID = textTable.GetLanguageID(language);
|
||||
var value = field.HasTextForLanguage(languageID) ? field.GetTextForLanguage(languageID) : "";
|
||||
row.Add(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
row.Add("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
CSVUtility.WriteCSVFile(content, csvFilename, prefs.encodingType);
|
||||
}
|
||||
}
|
||||
|
||||
private void ImportCSVFile(string csvFilename)
|
||||
{
|
||||
var content = CSVUtility.ReadCSVFile(csvFilename, prefs.encodingType);
|
||||
if (content == null || content.Count < 1 || content[0].Count < 2) return;
|
||||
var fieldList = new List<string>();
|
||||
var firstCell = content[0][0];
|
||||
if (string.Equals(firstCell, "Language"))
|
||||
{
|
||||
// Single language file:
|
||||
var language = content[0][1];
|
||||
if (!string.IsNullOrEmpty(language))
|
||||
{
|
||||
foreach (var textTable in textTables)
|
||||
{
|
||||
if (textTable == null) continue;
|
||||
if (!textTable.HasLanguage(language)) textTable.AddLanguage(language);
|
||||
for (int y = 1; y < content.Count; y++)
|
||||
{
|
||||
var field = content[y][0];
|
||||
if (string.IsNullOrEmpty(field)) continue;
|
||||
fieldList.Add(field);
|
||||
if (textTable.HasField(field))
|
||||
{
|
||||
for (int x = 1; x < content[y].Count; x++)
|
||||
{
|
||||
textTable.SetFieldTextForLanguage(field, language, content[y][x]);
|
||||
}
|
||||
}
|
||||
}
|
||||
textTable.ReorderFields(fieldList);
|
||||
textTable.OnBeforeSerialize();
|
||||
EditorUtility.SetDirty(textTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// All-in-one file:
|
||||
foreach (var textTable in textTables)
|
||||
{
|
||||
if (textTable == null) continue;
|
||||
for (int x = 1; x < content[0].Count; x++)
|
||||
{
|
||||
var language = content[0][x];
|
||||
if (string.IsNullOrEmpty(language)) continue;
|
||||
if (!textTable.HasLanguage(language)) textTable.AddLanguage(language);
|
||||
for (int y = 1; y < content.Count; y++)
|
||||
{
|
||||
var field = content[y][0];
|
||||
if (string.IsNullOrEmpty(field)) continue;
|
||||
if (x == 1) fieldList.Add(field);
|
||||
if (textTable.HasField(field))
|
||||
{
|
||||
if ((0 <= y && y < content.Count) && (0 <= x && x < content[y].Count))
|
||||
{
|
||||
textTable.SetFieldTextForLanguage(field, language, content[y][x]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
textTable.ReorderFields(fieldList);
|
||||
textTable.OnBeforeSerialize();
|
||||
EditorUtility.SetDirty(textTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 74cdaa5c88e290f41b2cb6ab33f62897
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/Text/TextTableMassExportImportWindow.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 901ff9041fac8b24f8112acc388ddedc
|
||||
folderAsset: yes
|
||||
timeCreated: 1549415914
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,35 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// This script runs when Unity starts or reloads assemblies after compilation.
|
||||
/// If it hasn't yet asked, it asks to set the InputDeviceManager standard inputs.
|
||||
/// </summary>
|
||||
[InitializeOnLoad]
|
||||
public static class CheckInputManagerSettings
|
||||
{
|
||||
|
||||
private const string CheckedInputManagerSettingsEditorPrefsKey = "PixelCrushers.CheckedInputManagerSettings";
|
||||
|
||||
static CheckInputManagerSettings()
|
||||
{
|
||||
#if !USE_NEW_INPUT
|
||||
var alreadyAsked = EditorPrefs.GetBool(CheckedInputManagerSettingsEditorPrefsKey, false);
|
||||
EditorPrefs.SetBool(CheckedInputManagerSettingsEditorPrefsKey, true);
|
||||
if (InputDeviceManagerEditor.HasStandardInputDefinitions() || alreadyAsked) return;
|
||||
if (EditorUtility.DisplayDialog("Add Input Manager Settings?",
|
||||
"Do you want to add standard input definitions for joystick axes so the Input Device Manager can detect when the player is using a joystick?", "Yes", "No"))
|
||||
{
|
||||
InputDeviceManagerEditor.AddStandardInputDefinitions();
|
||||
Debug.Log("Added standard input definitions.");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 50f62b6cda68c8b478898a0dd4a7b3db
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/UI/CheckInputManagerSettings.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,261 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
[CustomEditor(typeof(InputDeviceManager), true)]
|
||||
public class InputDeviceManagerEditor : Editor
|
||||
{
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
var inputDeviceManager = target as InputDeviceManager;
|
||||
if (GUILayout.Button(new GUIContent("Add Input Definitions", "If any of the buttons or axes listed above aren't in Unity's Input Manager, add them.")))
|
||||
{
|
||||
AddInputDefinitions(inputDeviceManager);
|
||||
}
|
||||
if (inputDeviceManager.joystickAxesToCheck == null || inputDeviceManager.joystickAxesToCheck.Length == 0)
|
||||
{
|
||||
if (GUILayout.Button(new GUIContent("Check Default Joystick Axes", "Check joystick axis movement to detect switch to joystick mode.")))
|
||||
{
|
||||
SetDefaultJoystickAxesToCheck(inputDeviceManager);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetDefaultJoystickAxesToCheck(InputDeviceManager inputDeviceManager)
|
||||
{
|
||||
if (inputDeviceManager == null) return;
|
||||
inputDeviceManager.joystickAxesToCheck = new string[] { "JoystickAxis1", "JoystickAxis2", "JoystickAxis3", "JoystickAxis4", "JoystickAxis6", "JoystickAxis7" };
|
||||
AddInputDefinitions(inputDeviceManager);
|
||||
}
|
||||
|
||||
public static void AddInputDefinitions(InputDeviceManager inputDeviceManager)
|
||||
{
|
||||
if (inputDeviceManager == null) return;
|
||||
foreach (var button in inputDeviceManager.joystickButtonsToCheck)
|
||||
{
|
||||
AddInputDefinition(button);
|
||||
}
|
||||
foreach (var axis in inputDeviceManager.joystickAxesToCheck)
|
||||
{
|
||||
AddInputDefinition(axis);
|
||||
}
|
||||
foreach (var button in inputDeviceManager.keyButtonsToCheck)
|
||||
{
|
||||
AddInputDefinition(button);
|
||||
}
|
||||
foreach (var button in inputDeviceManager.backButtons)
|
||||
{
|
||||
AddInputDefinition(button);
|
||||
}
|
||||
Debug.Log("All input definitions are in Unity's Input Manager.");
|
||||
}
|
||||
|
||||
public static bool HasStandardInputDefinitions()
|
||||
{
|
||||
return AxisDefined("JoystickAxis7");
|
||||
}
|
||||
|
||||
public static void AddStandardInputDefinitions()
|
||||
{
|
||||
AddAxis(new InputAxis() { name = "JoystickAxis1", dead = 0.2f, sensitivity = 1f, type = AxisType.JoystickAxis, axis = 1, joyNum = 0, });
|
||||
AddAxis(new InputAxis() { name = "JoystickAxis2", dead = 0.2f, sensitivity = 1f, type = AxisType.JoystickAxis, axis = 2, joyNum = 0, });
|
||||
AddAxis(new InputAxis() { name = "JoystickAxis3", dead = 0.2f, sensitivity = 1f, type = AxisType.JoystickAxis, axis = 3, joyNum = 0, });
|
||||
AddAxis(new InputAxis() { name = "JoystickAxis4", dead = 0.2f, sensitivity = 1f, type = AxisType.JoystickAxis, axis = 4, joyNum = 0, });
|
||||
AddAxis(new InputAxis() { name = "JoystickAxis5", dead = 0.2f, sensitivity = 1f, type = AxisType.JoystickAxis, axis = 5, joyNum = 0, });
|
||||
AddAxis(new InputAxis() { name = "JoystickAxis6", dead = 0.2f, sensitivity = 1f, type = AxisType.JoystickAxis, axis = 6, joyNum = 0, });
|
||||
AddAxis(new InputAxis() { name = "JoystickAxis7", dead = 0.2f, sensitivity = 1f, type = AxisType.JoystickAxis, axis = 7, joyNum = 0, });
|
||||
}
|
||||
|
||||
public static void AddInputDefinition(string inputName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(inputName)) return;
|
||||
switch (inputName)
|
||||
{
|
||||
case "JoystickButton0":
|
||||
AddAxis(new InputAxis() { name = inputName, positiveButton = "joystick button 0", gravity = 1000, dead = 0.0001f, sensitivity = 1000, type = AxisType.KeyOrMouseButton });
|
||||
break;
|
||||
case "JoystickButton1":
|
||||
AddAxis(new InputAxis() { name = inputName, positiveButton = "joystick button 1", gravity = 1000, dead = 0.0001f, sensitivity = 1000, type = AxisType.KeyOrMouseButton });
|
||||
break;
|
||||
case "JoystickButton2":
|
||||
AddAxis(new InputAxis() { name = inputName, positiveButton = "joystick button 2", gravity = 1000, dead = 0.0001f, sensitivity = 1000, type = AxisType.KeyOrMouseButton });
|
||||
break;
|
||||
case "JoystickButton3":
|
||||
AddAxis(new InputAxis() { name = inputName, positiveButton = "joystick button 3", gravity = 1000, dead = 0.0001f, sensitivity = 1000, type = AxisType.KeyOrMouseButton });
|
||||
break;
|
||||
case "JoystickButton4":
|
||||
AddAxis(new InputAxis() { name = inputName, positiveButton = "joystick button 4", gravity = 1000, dead = 0.0001f, sensitivity = 1000, type = AxisType.KeyOrMouseButton });
|
||||
break;
|
||||
case "JoystickButton5":
|
||||
AddAxis(new InputAxis() { name = inputName, positiveButton = "joystick button 5", gravity = 1000, dead = 0.0001f, sensitivity = 1000, type = AxisType.KeyOrMouseButton });
|
||||
break;
|
||||
case "JoystickButton6":
|
||||
AddAxis(new InputAxis() { name = inputName, positiveButton = "joystick button 6", gravity = 1000, dead = 0.0001f, sensitivity = 1000, type = AxisType.KeyOrMouseButton });
|
||||
break;
|
||||
case "JoystickButton7":
|
||||
AddAxis(new InputAxis() { name = inputName, positiveButton = "joystick button 7", gravity = 1000, dead = 0.0001f, sensitivity = 1000, type = AxisType.KeyOrMouseButton });
|
||||
break;
|
||||
case "JoystickAxis1":
|
||||
AddAxis(new InputAxis() { name = inputName, dead = 0.2f, sensitivity = 1f, type = AxisType.JoystickAxis, axis = 1, joyNum = 0, });
|
||||
break;
|
||||
case "JoystickAxis2":
|
||||
AddAxis(new InputAxis() { name = inputName, dead = 0.2f, sensitivity = 1f, type = AxisType.JoystickAxis, axis = 2, joyNum = 0, });
|
||||
break;
|
||||
case "JoystickAxis3":
|
||||
AddAxis(new InputAxis() { name = inputName, dead = 0.2f, sensitivity = 1f, type = AxisType.JoystickAxis, axis = 3, joyNum = 0, });
|
||||
break;
|
||||
case "JoystickAxis4":
|
||||
AddAxis(new InputAxis() { name = inputName, dead = 0.2f, sensitivity = 1f, type = AxisType.JoystickAxis, axis = 4, joyNum = 0, });
|
||||
break;
|
||||
case "JoystickAxis5":
|
||||
AddAxis(new InputAxis() { name = inputName, dead = 0.2f, sensitivity = 1f, type = AxisType.JoystickAxis, axis = 5, joyNum = 0, });
|
||||
break;
|
||||
case "JoystickAxis6":
|
||||
AddAxis(new InputAxis() { name = inputName, dead = 0.2f, sensitivity = 1f, type = AxisType.JoystickAxis, axis = 6, joyNum = 0, });
|
||||
break;
|
||||
case "JoystickAxis7":
|
||||
AddAxis(new InputAxis() { name = inputName, dead = 0.2f, sensitivity = 1f, type = AxisType.JoystickAxis, axis = 7, joyNum = 0, });
|
||||
break;
|
||||
default:
|
||||
AddUnrecognizedInputDefinition(inputName);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddUnrecognizedInputDefinition(string inputName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(inputName)) return;
|
||||
if (inputName.ToLower().Contains("button"))
|
||||
{
|
||||
Debug.LogWarning("Will add button to Input Manager: " + inputName + " but you may need to check its values (Edit > Project Settings > Input).");
|
||||
var buttonName = ObjectNames.NicifyVariableName(inputName).ToLower();
|
||||
AddAxis(new InputAxis() { name = inputName, positiveButton = buttonName, gravity = 1000, dead = 0.0001f, sensitivity = 1000, type = AxisType.KeyOrMouseButton });
|
||||
}
|
||||
else
|
||||
{
|
||||
AddAxisUndefined(inputName);
|
||||
}
|
||||
}
|
||||
|
||||
// From: https://plyoung.appspot.com/blog/manipulating-input-manager-in-script.html
|
||||
|
||||
private static SerializedProperty GetChildProperty(SerializedProperty parent, string name)
|
||||
{
|
||||
SerializedProperty child = parent.Copy();
|
||||
child.Next(true);
|
||||
do
|
||||
{
|
||||
if (child.name == name) return child;
|
||||
}
|
||||
while (child.Next(false));
|
||||
return null;
|
||||
}
|
||||
|
||||
public enum AxisType
|
||||
{
|
||||
KeyOrMouseButton = 0,
|
||||
MouseMovement = 1,
|
||||
JoystickAxis = 2
|
||||
};
|
||||
|
||||
public class InputAxis
|
||||
{
|
||||
public string name;
|
||||
public string descriptiveName;
|
||||
public string descriptiveNegativeName;
|
||||
public string negativeButton;
|
||||
public string positiveButton;
|
||||
public string altNegativeButton;
|
||||
public string altPositiveButton;
|
||||
|
||||
public float gravity;
|
||||
public float dead;
|
||||
public float sensitivity;
|
||||
|
||||
public bool snap = false;
|
||||
public bool invert = false;
|
||||
|
||||
public AxisType type;
|
||||
|
||||
public int axis;
|
||||
public int joyNum;
|
||||
}
|
||||
|
||||
private static bool AxisDefined(string axisName)
|
||||
{
|
||||
#if USE_NEW_INPUT
|
||||
return true; // Assume InputActions will define axis.
|
||||
#else
|
||||
try
|
||||
{
|
||||
var assets = AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/InputManager.asset");
|
||||
if (assets == null || assets.Length == 0) return true; // Gracefully skip if can't load InputManager.
|
||||
SerializedObject serializedObject = new SerializedObject(assets[0]);
|
||||
SerializedProperty axesProperty = serializedObject.FindProperty("m_Axes");
|
||||
|
||||
var valid = axesProperty.Next(true);
|
||||
valid = valid || axesProperty.Next(true);
|
||||
while (valid && axesProperty.Next(false))
|
||||
{
|
||||
SerializedProperty axis = axesProperty.Copy();
|
||||
if (axis.Next(true))
|
||||
{
|
||||
if (axis.stringValue == axisName) return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
catch (System.InvalidOperationException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private static void AddAxis(InputAxis axis)
|
||||
{
|
||||
if (AxisDefined(axis.name)) return;
|
||||
|
||||
Debug.Log("Added to Input Manager: " + axis.name);
|
||||
|
||||
SerializedObject serializedObject = new SerializedObject(AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/InputManager.asset")[0]);
|
||||
SerializedProperty axesProperty = serializedObject.FindProperty("m_Axes");
|
||||
|
||||
axesProperty.arraySize++;
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
SerializedProperty axisProperty = axesProperty.GetArrayElementAtIndex(axesProperty.arraySize - 1);
|
||||
|
||||
GetChildProperty(axisProperty, "m_Name").stringValue = axis.name;
|
||||
GetChildProperty(axisProperty, "descriptiveName").stringValue = axis.descriptiveName;
|
||||
GetChildProperty(axisProperty, "descriptiveNegativeName").stringValue = axis.descriptiveNegativeName;
|
||||
GetChildProperty(axisProperty, "negativeButton").stringValue = axis.negativeButton;
|
||||
GetChildProperty(axisProperty, "positiveButton").stringValue = axis.positiveButton;
|
||||
GetChildProperty(axisProperty, "altNegativeButton").stringValue = axis.altNegativeButton;
|
||||
GetChildProperty(axisProperty, "altPositiveButton").stringValue = axis.altPositiveButton;
|
||||
GetChildProperty(axisProperty, "gravity").floatValue = axis.gravity;
|
||||
GetChildProperty(axisProperty, "dead").floatValue = axis.dead;
|
||||
GetChildProperty(axisProperty, "sensitivity").floatValue = axis.sensitivity;
|
||||
GetChildProperty(axisProperty, "snap").boolValue = axis.snap;
|
||||
GetChildProperty(axisProperty, "invert").boolValue = axis.invert;
|
||||
GetChildProperty(axisProperty, "type").intValue = (int)axis.type;
|
||||
GetChildProperty(axisProperty, "axis").intValue = axis.axis - 1;
|
||||
GetChildProperty(axisProperty, "joyNum").intValue = axis.joyNum;
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
private static void AddAxisUndefined(string axisName)
|
||||
{
|
||||
if (AxisDefined(axisName)) return;
|
||||
Debug.LogWarning("Will add to Input Manager: " + axisName + " but you must set its values (Edit > Project Settings > Input).");
|
||||
AddAxis(new InputAxis() { name = axisName });
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c62130f496886141a8c2725b8b12b7c
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/UI/InputDeviceManagerEditor.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,71 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
[CustomPropertyDrawer(typeof(UIDropdownField), true)]
|
||||
public class UIDropdownFieldDrawer : PropertyDrawer
|
||||
{
|
||||
|
||||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
|
||||
{
|
||||
try
|
||||
{
|
||||
var uiDropdownProperty = property.FindPropertyRelative("m_uiDropdown");
|
||||
var tmpDropdownProperty = property.FindPropertyRelative("m_tmpDropdown");
|
||||
var isUIDropdownAssigned = (uiDropdownProperty != null) && (uiDropdownProperty.objectReferenceValue != null);
|
||||
var isTMPDropdownAssigned = (tmpDropdownProperty != null) && (tmpDropdownProperty.objectReferenceValue != null);
|
||||
var isContentAssigned = isUIDropdownAssigned || isTMPDropdownAssigned;
|
||||
int numUnassignedLines = 1;
|
||||
if (tmpDropdownProperty != null) numUnassignedLines++;
|
||||
return (isContentAssigned ? 1 : numUnassignedLines) * EditorGUIUtility.singleLineHeight;
|
||||
}
|
||||
catch (System.ArgumentException) // Handles IMGUI->UITK bug in Unity 2022.2.
|
||||
{
|
||||
return 2 * EditorGUIUtility.singleLineHeight;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
try
|
||||
{
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
|
||||
position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
|
||||
|
||||
var uiDropdownProperty = property.FindPropertyRelative("m_uiDropdown");
|
||||
var tmpDropdownProperty = property.FindPropertyRelative("m_tmpDropdown");
|
||||
if (uiDropdownProperty == null)
|
||||
{
|
||||
Debug.LogError("Sorry! There was an internal editor error with a UI Dropdown Field. Please contact Pixel Crushers for support.");
|
||||
return;
|
||||
}
|
||||
var isUIDropdownAssigned = (uiDropdownProperty != null) && (uiDropdownProperty.objectReferenceValue != null);
|
||||
var isTMPDropdownAssigned = (tmpDropdownProperty != null) && (tmpDropdownProperty.objectReferenceValue != null);
|
||||
var isContentAssigned = isUIDropdownAssigned || isTMPDropdownAssigned;
|
||||
|
||||
float yOffset = 0;
|
||||
|
||||
if (isUIDropdownAssigned || !isContentAssigned)
|
||||
{
|
||||
EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight), uiDropdownProperty, GUIContent.none);
|
||||
yOffset += EditorGUIUtility.singleLineHeight;
|
||||
}
|
||||
|
||||
if (isTMPDropdownAssigned || (tmpDropdownProperty != null && !isContentAssigned))
|
||||
{
|
||||
EditorGUI.PropertyField(new Rect(position.x, position.y + yOffset, position.width, EditorGUIUtility.singleLineHeight), tmpDropdownProperty, GUIContent.none);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
EditorGUI.EndProperty();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2fa119de2278f404c87b62a30d61f4cd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/UI/UIDropdownFieldDrawer.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,23 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
[CustomEditor(typeof(UILocalizationManager), true)]
|
||||
public class UILocalizationManagerEditor : Editor
|
||||
{
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
if (GUILayout.Button(new GUIContent("Reset Language PlayerPrefs", "Delete the language selection saved in PlayerPrefs.")))
|
||||
{
|
||||
PlayerPrefs.DeleteKey((target as UILocalizationManager).currentLanguagePlayerPrefsKey);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b923b59825130147956e438e2347799
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/UI/UILocalizationManagerEditor.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,81 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
[CustomPropertyDrawer(typeof(UITextField), true)]
|
||||
public class UITextFieldDrawer : PropertyDrawer
|
||||
{
|
||||
|
||||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
|
||||
{
|
||||
try
|
||||
{
|
||||
var uiTextProperty = property.FindPropertyRelative("m_uiText");
|
||||
var textMeshProUGUIProperty = property.FindPropertyRelative("m_textMeshProUGUI");
|
||||
var superTextMeshProperty = property.FindPropertyRelative("m_superTextMesh");
|
||||
var isUiTextAssigned = (uiTextProperty != null) && (uiTextProperty.objectReferenceValue != null);
|
||||
var isTextMeshProUGUIAssigned = (textMeshProUGUIProperty != null) && (textMeshProUGUIProperty.objectReferenceValue != null);
|
||||
var isSuperTextMeshAssigned = (superTextMeshProperty != null) && (superTextMeshProperty.objectReferenceValue != null);
|
||||
var isContentAssigned = isUiTextAssigned || isTextMeshProUGUIAssigned || isSuperTextMeshAssigned;
|
||||
int numUnassignedLines = 1;
|
||||
if (textMeshProUGUIProperty != null) numUnassignedLines++;
|
||||
if (superTextMeshProperty != null) numUnassignedLines++;
|
||||
return (isContentAssigned ? 1 : numUnassignedLines) * EditorGUIUtility.singleLineHeight;
|
||||
}
|
||||
catch (System.ArgumentException) // Handles IMGUI->UITK bug in Unity 2022.2.
|
||||
{
|
||||
return 2 * EditorGUIUtility.singleLineHeight;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
try
|
||||
{
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
|
||||
position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
|
||||
|
||||
var uiTextProperty = property.FindPropertyRelative("m_uiText");
|
||||
var textMeshProUGUIProperty = property.FindPropertyRelative("m_textMeshProUGUI");
|
||||
var superTextMeshProperty = property.FindPropertyRelative("m_superTextMesh");
|
||||
if (uiTextProperty == null)
|
||||
{
|
||||
Debug.LogError("Sorry! There was an internal editor error with a UI Text Field. Please contact Pixel Crushers for support.");
|
||||
return;
|
||||
}
|
||||
var isUiTextAssigned = (uiTextProperty != null) && (uiTextProperty.objectReferenceValue != null);
|
||||
var isTextMeshProUGUIAssigned = (textMeshProUGUIProperty != null) && (textMeshProUGUIProperty.objectReferenceValue != null);
|
||||
var isSuperTextMeshAssigned = (superTextMeshProperty != null) && (superTextMeshProperty.objectReferenceValue != null);
|
||||
var isContentAssigned = isUiTextAssigned || isTextMeshProUGUIAssigned || isSuperTextMeshAssigned;
|
||||
|
||||
float yOffset = 0;
|
||||
|
||||
if (isUiTextAssigned || !isContentAssigned)
|
||||
{
|
||||
EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight), uiTextProperty, GUIContent.none);
|
||||
yOffset += EditorGUIUtility.singleLineHeight;
|
||||
}
|
||||
|
||||
if (isTextMeshProUGUIAssigned || (textMeshProUGUIProperty != null && !isContentAssigned))
|
||||
{
|
||||
EditorGUI.PropertyField(new Rect(position.x, position.y + yOffset, position.width, EditorGUIUtility.singleLineHeight), textMeshProUGUIProperty, GUIContent.none);
|
||||
}
|
||||
|
||||
if (isSuperTextMeshAssigned || (superTextMeshProperty != null && !isContentAssigned))
|
||||
{
|
||||
EditorGUI.PropertyField(new Rect(position.x, position.y + yOffset, position.width, EditorGUIUtility.singleLineHeight), superTextMeshProperty, GUIContent.none);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
EditorGUI.EndProperty();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0a054d83c759ad44be2663a383637f5
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/UI/UITextFieldDrawer.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ddf075d19a817ce4e85d1a238e5550f3
|
||||
folderAsset: yes
|
||||
timeCreated: 1549415914
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,153 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
[CustomPropertyDrawer(typeof(TagMask), true)]
|
||||
public class TagMaskDrawer : PropertyDrawer
|
||||
{
|
||||
|
||||
public struct MenuItemTagInfo
|
||||
{
|
||||
public SerializedProperty property;
|
||||
public int allTagsIndex;
|
||||
public MenuItemTagInfo(SerializedProperty property, int allTagsIndex)
|
||||
{
|
||||
this.property = property;
|
||||
this.allTagsIndex = allTagsIndex;
|
||||
}
|
||||
}
|
||||
|
||||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
|
||||
{
|
||||
return EditorGUIUtility.singleLineHeight;
|
||||
}
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
|
||||
position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
|
||||
|
||||
try
|
||||
{
|
||||
// Count how many tags are selected in the m_tag property:
|
||||
var allTags = UnityEditorInternal.InternalEditorUtility.tags;
|
||||
var tagsProperty = property.FindPropertyRelative("m_tags");
|
||||
var lastSelectedTag = string.Empty;
|
||||
int numSelected = 0;
|
||||
for (int i = 0; i < allTags.Length; i++)
|
||||
{
|
||||
for (int j = 0; j < tagsProperty.arraySize; j++)
|
||||
{
|
||||
var selectedTag = tagsProperty.GetArrayElementAtIndex(j).stringValue;
|
||||
if (string.Equals(selectedTag, allTags[i]))
|
||||
{
|
||||
lastSelectedTag = selectedTag;
|
||||
numSelected++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Show the dropdown button:
|
||||
var dropdownButtonSummary = (numSelected == 0) ? "Nothing"
|
||||
: (numSelected == allTags.Length) ? "Everything"
|
||||
: (numSelected > 1) ? "Mixed"
|
||||
: lastSelectedTag;
|
||||
#if UNITY_5_3 || UNITY_5_4 || UNITY_5_5
|
||||
if (GUI.Button(position, dropdownButtonSummary))
|
||||
#else
|
||||
if (EditorGUI.DropdownButton(position, new GUIContent(dropdownButtonSummary), FocusType.Keyboard))
|
||||
#endif
|
||||
{
|
||||
// If dropdown button is clicked, show a context menu that looks like EditorGUI.MaskField:
|
||||
var menu = new GenericMenu();
|
||||
menu.AddItem(new GUIContent("Nothing"), false, OnSelectNothing, property);
|
||||
menu.AddItem(new GUIContent("Everything"), false, OnSelectEverything, property);
|
||||
for (int i = 0; i < allTags.Length; i++)
|
||||
{
|
||||
var isSelected = false;
|
||||
for (int j = 0; j < tagsProperty.arraySize; j++)
|
||||
{
|
||||
var selectedTag = tagsProperty.GetArrayElementAtIndex(j).stringValue;
|
||||
if (string.Equals(selectedTag, allTags[i]))
|
||||
{
|
||||
isSelected = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
menu.AddItem(new GUIContent(allTags[i]), isSelected, OnSelectTag, new MenuItemTagInfo(property, i));
|
||||
}
|
||||
menu.ShowAsContext();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
EditorGUI.EndProperty();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSelectNothing(object data)
|
||||
{
|
||||
var property = (SerializedProperty)data;
|
||||
var tagsProperty = property.FindPropertyRelative("m_tags");
|
||||
property.serializedObject.Update();
|
||||
tagsProperty.ClearArray();
|
||||
property.serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
private void OnSelectEverything(object data)
|
||||
{
|
||||
var property = (SerializedProperty)data;
|
||||
var tagsProperty = property.FindPropertyRelative("m_tags");
|
||||
property.serializedObject.Update();
|
||||
tagsProperty.ClearArray();
|
||||
var allTags = UnityEditorInternal.InternalEditorUtility.tags;
|
||||
tagsProperty.arraySize = allTags.Length;
|
||||
for (int i = 0; i < allTags.Length; i++)
|
||||
{
|
||||
tagsProperty.GetArrayElementAtIndex(i).stringValue = allTags[i];
|
||||
}
|
||||
property.serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
private void OnSelectTag(object data)
|
||||
{
|
||||
var menuItemInfo = (MenuItemTagInfo)data;
|
||||
var selectedIndex = menuItemInfo.allTagsIndex;
|
||||
var allTags = UnityEditorInternal.InternalEditorUtility.tags;
|
||||
if (0 <= selectedIndex && selectedIndex < allTags.Length)
|
||||
{
|
||||
var selectedTag = allTags[selectedIndex];
|
||||
var tagsProperty = menuItemInfo.property.FindPropertyRelative("m_tags");
|
||||
int indexInTagsProperty = -1;
|
||||
for (int i = 0; i < tagsProperty.arraySize; i++)
|
||||
{
|
||||
if (string.Equals(tagsProperty.GetArrayElementAtIndex(i).stringValue, selectedTag))
|
||||
{
|
||||
indexInTagsProperty = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
tagsProperty.serializedObject.Update();
|
||||
if (indexInTagsProperty == -1)
|
||||
{
|
||||
// Add:
|
||||
tagsProperty.arraySize++;
|
||||
tagsProperty.GetArrayElementAtIndex(tagsProperty.arraySize - 1).stringValue = selectedTag;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delete:
|
||||
tagsProperty.DeleteArrayElementAtIndex(indexInTagsProperty);
|
||||
}
|
||||
tagsProperty.serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2dfee8025c152284d88e0a153cfb30c6
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Editor/UnityEvents/TagMaskDrawer.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d5343f589cb0763408d0d03ff14197ea
|
||||
folderAsset: yes
|
||||
timeCreated: 1549415914
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,82 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Uses the MessageSystem to keep data synchronized between a source and a listener.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")] // Use wrapper instead.
|
||||
public class DataSynchronizer : MonoBehaviour, IMessageHandler
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Message that data source sends to inform listeners that the value changed.
|
||||
/// </summary>
|
||||
public const string DataSourceValueChangedMessage = "Data Source Value Changed";
|
||||
|
||||
/// <summary>
|
||||
/// Message that listeners send to request this data synchronizer to change the data source's value.
|
||||
/// </summary>
|
||||
public const string RequestDataSourceChangeValueMessage = "Request Data Source Change Value";
|
||||
|
||||
[Tooltip("A name to associate with the data source. Data change messages that reference this name will invoke the value update events.")]
|
||||
[SerializeField]
|
||||
private string m_dataSourceName;
|
||||
|
||||
[SerializeField]
|
||||
private ObjectUnityEvent m_onRequestDataSourceChangeValue = new ObjectUnityEvent();
|
||||
|
||||
/// <summary>
|
||||
/// A name to associate with the data source. Data change messages that reference this name will invoke the value update events.
|
||||
/// </summary>
|
||||
public string dataSourceName
|
||||
{
|
||||
get { return m_dataSourceName; }
|
||||
set { m_dataSourceName = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Event to send to data source to request it to change value.
|
||||
/// </summary>
|
||||
public ObjectUnityEvent onRequestDataSourceChangeValue
|
||||
{
|
||||
get { return m_onRequestDataSourceChangeValue; }
|
||||
set { m_onRequestDataSourceChangeValue = value; }
|
||||
}
|
||||
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
MessageSystem.AddListener(this, RequestDataSourceChangeValueMessage, dataSourceName);
|
||||
}
|
||||
|
||||
protected virtual void OnDisable()
|
||||
{
|
||||
MessageSystem.RemoveListener(this, RequestDataSourceChangeValueMessage, dataSourceName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles messages requesting to change the value of the data source. On receipt of the
|
||||
/// RequestDataSourceChangeValueMessage, invokes the onRequestDataSourceChangeValue event,
|
||||
/// passing the first argument of the message as the new value.
|
||||
/// </summary>
|
||||
/// <param name="messageArgs">First argument is the new value.</param>
|
||||
public void OnMessage(MessageArgs messageArgs)
|
||||
{
|
||||
onRequestDataSourceChangeValue.Invoke(messageArgs.firstValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When the data source has changed its value, it should call this method to inform listeners.
|
||||
/// </summary>
|
||||
/// <param name="newValue">The data source's new value.</param>
|
||||
public void DataSourceValueChanged(object newValue)
|
||||
{
|
||||
MessageSystem.SendMessage(this, DataSourceValueChangedMessage, dataSourceName, newValue);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cdcf52bf8761a4a4399a14ff13b13c75
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Message System/DataSynchronizer.cs
|
||||
uploadId: 667566
|
@ -0,0 +1,18 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
namespace PixelCrushers
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Interface for MessageSystem message handlers.
|
||||
/// </summary>
|
||||
public interface IMessageHandler
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles a message that the message handler is listening for.
|
||||
/// </summary>
|
||||
/// <param name="messageArgs">The message that was sent to the MessageSystem.</param>
|
||||
void OnMessage(MessageArgs messageArgs);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 724cd730cf793a948b7e455d28be0088
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 11672
|
||||
packageName: Dialogue System for Unity
|
||||
packageVersion: 2.2.46.1
|
||||
assetPath: Assets/Plugins/Pixel Crushers/Common/Scripts/Message System/IMessageHandler.cs
|
||||
uploadId: 667566
|