@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: b2a1842979c244113ac31b4b37744a1d |
||||
guid: 4b09c77dc01c54b5084100479119d16d |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 23916e2f1deff4e31a36b6e75aed0906 |
||||
guid: 6ec2f7eb17e1141eea07422a76e852c4 |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 5446370c736a84b6d9d6a9bb6f4d4521 |
||||
guid: ae3aa0e9b0f0248a59548b5d9e77a6c1 |
||||
AudioImporter: |
||||
serializedVersion: 4 |
||||
format: 0 |
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 695c2b87de46948719d8d25616c55ad0 |
||||
guid: 01aa5d8be39a64aefa40bbe2bb40a9d1 |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
@ -1,4 +1,4 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 5a6b6f6f9c1684498b25f6f41ef56995 |
||||
guid: 7456307ca6764419c87a92bb5351630d |
||||
DefaultImporter: |
||||
userData: |
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 46997c16617ca413c9b5d94fd22aeb52 |
||||
guid: aed10a27008a24d06bc8c4f3eb9c2074 |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
@ -0,0 +1,8 @@
|
||||
Creative Commons / Public Domain artwork used with permission. |
||||
Mnay thanks to the authors for sharing! |
||||
|
||||
http://denmanrooke.com/creativecommons/ |
||||
http://syntetyc.deviantart.com/art/Waterfall-forest-214723814 |
||||
http://syntetyc.deviantart.com/art/Green-Forest-206321928 |
||||
http://syntetyc.deviantart.com/art/Sanctuary-Forest-207795795 |
||||
http://syntetyc.deviantart.com/art/Deep-Forest-204641620 |
@ -1,4 +1,4 @@
|
||||
fileFormatVersion: 2 |
||||
guid: b2e1b498f5c584f32af544c563ec0a47 |
||||
guid: f35e49c61f66a4ac3a13a2f6e1424132 |
||||
TextScriptImporter: |
||||
userData: |
After Width: | Height: | Size: 232 KiB |
@ -0,0 +1,48 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 1844620fa148d4dc89443ca7b33205e1 |
||||
TextureImporter: |
||||
fileIDToRecycleName: |
||||
21300000: Bear |
||||
serializedVersion: 2 |
||||
mipmaps: |
||||
mipMapMode: 0 |
||||
enableMipMap: 0 |
||||
linearTexture: 0 |
||||
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: -3 |
||||
maxTextureSize: 2048 |
||||
textureSettings: |
||||
filterMode: -1 |
||||
aniso: 1 |
||||
mipBias: -1 |
||||
wrapMode: 1 |
||||
nPOTScale: 0 |
||||
lightmap: 0 |
||||
compressionQuality: 50 |
||||
spriteMode: 1 |
||||
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: 8 |
||||
buildTargetSettings: [] |
||||
spriteSheet: |
||||
sprites: [] |
||||
spritePackingTag: |
||||
userData: |
After Width: | Height: | Size: 33 KiB |
@ -0,0 +1,49 @@
|
||||
fileFormatVersion: 2 |
||||
guid: c784f0adc2ce544be915fc26a2b4b510 |
||||
TextureImporter: |
||||
fileIDToRecycleName: |
||||
21300000: UrchinGirl |
||||
21300002: Ciara |
||||
serializedVersion: 2 |
||||
mipmaps: |
||||
mipMapMode: 0 |
||||
enableMipMap: 0 |
||||
linearTexture: 0 |
||||
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: -3 |
||||
maxTextureSize: 1024 |
||||
textureSettings: |
||||
filterMode: -1 |
||||
aniso: 1 |
||||
mipBias: -1 |
||||
wrapMode: 1 |
||||
nPOTScale: 0 |
||||
lightmap: 0 |
||||
compressionQuality: 50 |
||||
spriteMode: 1 |
||||
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: 8 |
||||
buildTargetSettings: [] |
||||
spriteSheet: |
||||
sprites: [] |
||||
spritePackingTag: |
||||
userData: |
@ -0,0 +1,49 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 05ccd53483a554ca9b31f685fa76154a |
||||
TextureImporter: |
||||
fileIDToRecycleName: |
||||
21300000: UrchinGirlProfile |
||||
21300002: CiaraHead |
||||
serializedVersion: 2 |
||||
mipmaps: |
||||
mipMapMode: 0 |
||||
enableMipMap: 0 |
||||
linearTexture: 0 |
||||
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: -3 |
||||
maxTextureSize: 1024 |
||||
textureSettings: |
||||
filterMode: -1 |
||||
aniso: 1 |
||||
mipBias: -1 |
||||
wrapMode: 1 |
||||
nPOTScale: 0 |
||||
lightmap: 0 |
||||
compressionQuality: 50 |
||||
spriteMode: 1 |
||||
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: 8 |
||||
buildTargetSettings: [] |
||||
spriteSheet: |
||||
sprites: [] |
||||
spritePackingTag: |
||||
userData: |
After Width: | Height: | Size: 174 KiB |
@ -0,0 +1,48 @@
|
||||
fileFormatVersion: 2 |
||||
guid: d3b6d7e5887554602baab879da8171d7 |
||||
TextureImporter: |
||||
fileIDToRecycleName: |
||||
21300000: DeepForest |
||||
serializedVersion: 2 |
||||
mipmaps: |
||||
mipMapMode: 0 |
||||
enableMipMap: 0 |
||||
linearTexture: 0 |
||||
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: -3 |
||||
maxTextureSize: 2048 |
||||
textureSettings: |
||||
filterMode: -1 |
||||
aniso: 1 |
||||
mipBias: -1 |
||||
wrapMode: 1 |
||||
nPOTScale: 0 |
||||
lightmap: 0 |
||||
compressionQuality: 50 |
||||
spriteMode: 1 |
||||
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: 8 |
||||
buildTargetSettings: [] |
||||
spriteSheet: |
||||
sprites: [] |
||||
spritePackingTag: |
||||
userData: |
After Width: | Height: | Size: 326 KiB |
@ -0,0 +1,48 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 2230440f02def4c728f10bdb641df3a7 |
||||
TextureImporter: |
||||
fileIDToRecycleName: |
||||
21300000: SanctuaryForest |
||||
serializedVersion: 2 |
||||
mipmaps: |
||||
mipMapMode: 0 |
||||
enableMipMap: 0 |
||||
linearTexture: 0 |
||||
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: -3 |
||||
maxTextureSize: 2048 |
||||
textureSettings: |
||||
filterMode: -1 |
||||
aniso: 1 |
||||
mipBias: -1 |
||||
wrapMode: 1 |
||||
nPOTScale: 0 |
||||
lightmap: 0 |
||||
compressionQuality: 50 |
||||
spriteMode: 1 |
||||
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: 8 |
||||
buildTargetSettings: [] |
||||
spriteSheet: |
||||
sprites: [] |
||||
spritePackingTag: |
||||
userData: |
@ -0,0 +1,49 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 6b100daff28d04f69a49015f83966425 |
||||
TextureImporter: |
||||
fileIDToRecycleName: |
||||
21300000: Roamer |
||||
21300002: Shay |
||||
serializedVersion: 2 |
||||
mipmaps: |
||||
mipMapMode: 0 |
||||
enableMipMap: 0 |
||||
linearTexture: 0 |
||||
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: -3 |
||||
maxTextureSize: 1024 |
||||
textureSettings: |
||||
filterMode: -1 |
||||
aniso: 1 |
||||
mipBias: -1 |
||||
wrapMode: 1 |
||||
nPOTScale: 0 |
||||
lightmap: 0 |
||||
compressionQuality: 50 |
||||
spriteMode: 1 |
||||
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: 8 |
||||
buildTargetSettings: [] |
||||
spriteSheet: |
||||
sprites: [] |
||||
spritePackingTag: |
||||
userData: |
@ -0,0 +1,49 @@
|
||||
fileFormatVersion: 2 |
||||
guid: f7484a661774243b193bebc6e3ae5120 |
||||
TextureImporter: |
||||
fileIDToRecycleName: |
||||
21300000: RoamerProfile |
||||
21300002: ShayHead |
||||
serializedVersion: 2 |
||||
mipmaps: |
||||
mipMapMode: 0 |
||||
enableMipMap: 0 |
||||
linearTexture: 0 |
||||
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: -3 |
||||
maxTextureSize: 1024 |
||||
textureSettings: |
||||
filterMode: -1 |
||||
aniso: 1 |
||||
mipBias: -1 |
||||
wrapMode: 1 |
||||
nPOTScale: 0 |
||||
lightmap: 0 |
||||
compressionQuality: 50 |
||||
spriteMode: 1 |
||||
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: 8 |
||||
buildTargetSettings: [] |
||||
spriteSheet: |
||||
sprites: [] |
||||
spritePackingTag: |
||||
userData: |
@ -0,0 +1,49 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 3c64e30cbefbe4e768ef68d85c85061e |
||||
TextureImporter: |
||||
fileIDToRecycleName: |
||||
21300000: SkipperProfile |
||||
21300002: SkipperHead |
||||
serializedVersion: 2 |
||||
mipmaps: |
||||
mipMapMode: 0 |
||||
enableMipMap: 0 |
||||
linearTexture: 0 |
||||
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: -3 |
||||
maxTextureSize: 1024 |
||||
textureSettings: |
||||
filterMode: -1 |
||||
aniso: 1 |
||||
mipBias: -1 |
||||
wrapMode: 1 |
||||
nPOTScale: 0 |
||||
lightmap: 0 |
||||
compressionQuality: 50 |
||||
spriteMode: 1 |
||||
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: 8 |
||||
buildTargetSettings: [] |
||||
spriteSheet: |
||||
sprites: [] |
||||
spritePackingTag: |
||||
userData: |
After Width: | Height: | Size: 1.7 MiB |
@ -0,0 +1,48 @@
|
||||
fileFormatVersion: 2 |
||||
guid: e54c2166ac91140689c6f04097cab20e |
||||
TextureImporter: |
||||
fileIDToRecycleName: |
||||
21300000: Waterfall |
||||
serializedVersion: 2 |
||||
mipmaps: |
||||
mipMapMode: 0 |
||||
enableMipMap: 0 |
||||
linearTexture: 0 |
||||
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: -3 |
||||
maxTextureSize: 2048 |
||||
textureSettings: |
||||
filterMode: -1 |
||||
aniso: 1 |
||||
mipBias: -1 |
||||
wrapMode: 1 |
||||
nPOTScale: 0 |
||||
lightmap: 0 |
||||
compressionQuality: 50 |
||||
spriteMode: 1 |
||||
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: 8 |
||||
buildTargetSettings: [] |
||||
spriteSheet: |
||||
sprites: [] |
||||
spritePackingTag: |
||||
userData: |
After Width: | Height: | Size: 268 KiB |
@ -0,0 +1,48 @@
|
||||
fileFormatVersion: 2 |
||||
guid: abf7ee5b818ac485980005a2e5066fb0 |
||||
TextureImporter: |
||||
fileIDToRecycleName: |
||||
21300000: WaterfallForest |
||||
serializedVersion: 2 |
||||
mipmaps: |
||||
mipMapMode: 0 |
||||
enableMipMap: 0 |
||||
linearTexture: 0 |
||||
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: -3 |
||||
maxTextureSize: 2048 |
||||
textureSettings: |
||||
filterMode: -1 |
||||
aniso: 1 |
||||
mipBias: -1 |
||||
wrapMode: 1 |
||||
nPOTScale: 0 |
||||
lightmap: 0 |
||||
compressionQuality: 50 |
||||
spriteMode: 1 |
||||
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: 8 |
||||
buildTargetSettings: [] |
||||
spriteSheet: |
||||
sprites: [] |
||||
spritePackingTag: |
||||
userData: |
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 72452d0189a95436fb93c2ec54d83801 |
||||
guid: 120b23b5240c94aee960b7434706811c |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 4dae98786fda548fba135bed70721da9 |
||||
guid: 623a31d1ed64f48c18a2941fb2e6bb4b |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: ed31c7843a16b49bb918643ab98b7f67 |
||||
guid: 3e8003ca74cfb4a99983b0084a826c72 |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
@ -0,0 +1,42 @@
|
||||
using UnityEngine; |
||||
using System; |
||||
using System.Collections; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Animation", |
||||
"Set Anim Bool", |
||||
"Sets a boolean parameter on an animator to control an animation")] |
||||
public class SetAnimBool : Command |
||||
{ |
||||
public Animator animator; |
||||
public string parameterName; |
||||
public BooleanData value; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
if (animator != null) |
||||
{ |
||||
animator.SetBool(parameterName, value.Value); |
||||
} |
||||
|
||||
Continue(); |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
if (animator == null) |
||||
{ |
||||
return "Error: No animator selected"; |
||||
} |
||||
|
||||
return animator.name + " (" + parameterName + ")"; |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(170, 204, 169, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: dce33924cf6804b2c94d17784a6037d1 |
||||
guid: ee63e642958494f1ebed8116ae4b1103 |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
@ -0,0 +1,42 @@
|
||||
using UnityEngine; |
||||
using System; |
||||
using System.Collections; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Animation", |
||||
"Set Anim Float", |
||||
"Sets a float parameter on an animator to control an animation")] |
||||
public class SetAnimFloat : Command |
||||
{ |
||||
public Animator animator; |
||||
public string parameterName; |
||||
public FloatData value; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
if (animator != null) |
||||
{ |
||||
animator.SetFloat(parameterName, value.Value); |
||||
} |
||||
|
||||
Continue(); |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
if (animator == null) |
||||
{ |
||||
return "Error: No animator selected"; |
||||
} |
||||
|
||||
return animator.name + " (" + parameterName + ")"; |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(170, 204, 169, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 0314fe408508a4b25afa76f65378a427 |
||||
guid: fb1f6a369ef8c40bda77241018ab6bd6 |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
@ -0,0 +1,42 @@
|
||||
using UnityEngine; |
||||
using System; |
||||
using System.Collections; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Animation", |
||||
"Set Anim Integer", |
||||
"Sets an integer parameter on an animator to control an animation")] |
||||
public class SetAnimInteger : Command |
||||
{ |
||||
public Animator animator; |
||||
public string parameterName; |
||||
public IntegerData value; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
if (animator != null) |
||||
{ |
||||
animator.SetInteger(parameterName, value.Value); |
||||
} |
||||
|
||||
Continue(); |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
if (animator == null) |
||||
{ |
||||
return "Error: No animator selected"; |
||||
} |
||||
|
||||
return animator.name + " (" + parameterName + ")"; |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(170, 204, 169, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 627f97c837bdf479aa14a90d8ea3a736 |
||||
guid: 76641c2c16481448eb6c0c1184fcdebe |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
@ -0,0 +1,41 @@
|
||||
using UnityEngine; |
||||
using System; |
||||
using System.Collections; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Animation", |
||||
"Set Anim Trigger", |
||||
"Sets a trigger parameter on an animator to control an animation")] |
||||
public class SetAnimTrigger : Command |
||||
{ |
||||
public Animator animator; |
||||
public string parameterName; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
if (animator != null) |
||||
{ |
||||
animator.SetTrigger(parameterName); |
||||
} |
||||
|
||||
Continue(); |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
if (animator == null) |
||||
{ |
||||
return "Error: No animator selected"; |
||||
} |
||||
|
||||
return animator.name + " (" + parameterName + ")"; |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(170, 204, 169, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 5464e5745a4da462795a6f6f5b112962 |
||||
guid: 0729d4f369e6a4241a6e7e3b8b9c1933 |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: d9780867e1f2c456a9bd67af4ed5e2e4 |
||||
guid: 50aeb1f91c7cf484e85d48c7370e926f |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
||||
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 0c0251f25261847649112eb90bdc787c |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: d4ee6befb080e414984229c6b24358ae |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
@ -0,0 +1,40 @@
|
||||
using UnityEngine; |
||||
using System.Collections; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Audio", |
||||
"Play Music", |
||||
"Plays game music. If any game music is already playing, it is stopped. Music continues playing across scene loads.")] |
||||
public class PlayMusic : Command |
||||
{ |
||||
public AudioClip musicClip; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
MusicController musicController = MusicController.GetInstance(); |
||||
if (musicController != null) |
||||
{ |
||||
musicController.PlayMusic(musicClip); |
||||
} |
||||
|
||||
Continue(); |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
if (musicClip == null) |
||||
{ |
||||
return "Error: No music clip selected"; |
||||
} |
||||
|
||||
return musicClip.name; |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(242, 209, 176, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 1902400ccc99b45d69ad01cb86b57d0f |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
@ -0,0 +1,43 @@
|
||||
using UnityEngine; |
||||
using System.Collections; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Audio", |
||||
"Play Sound", |
||||
"Plays a sound effect. Multiple sound effects can play at the same time.")] |
||||
public class PlaySound : Command |
||||
{ |
||||
public AudioClip soundClip; |
||||
|
||||
[Range(0,1)] |
||||
public float volume = 1; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
MusicController musicController = MusicController.GetInstance(); |
||||
if (musicController != null) |
||||
{ |
||||
musicController.PlaySound(soundClip, volume); |
||||
} |
||||
|
||||
Continue(); |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
if (soundClip == null) |
||||
{ |
||||
return "Error: No music clip selected"; |
||||
} |
||||
|
||||
return soundClip.name; |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(242, 209, 176, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: bd2f6be51b3d7490ba5633ee095d0391 |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
@ -0,0 +1,39 @@
|
||||
using UnityEngine; |
||||
using System.Collections; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Audio", |
||||
"Set Music Volume", |
||||
"Sets the game music volume level.")] |
||||
public class SetMusicVolume : Command |
||||
{ |
||||
[Range(0,1)] |
||||
public float volume = 1; |
||||
|
||||
[Range(0,30)] |
||||
public float fadeDuration; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
MusicController musicController = MusicController.GetInstance(); |
||||
if (musicController != null) |
||||
{ |
||||
musicController.SetMusicVolume(volume, fadeDuration); |
||||
} |
||||
|
||||
Continue(); |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
return "Set to " + volume + " over " + fadeDuration + " seconds."; |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(242, 209, 176, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: e5f62b7b5779c46aba13ef24141b2729 |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
@ -0,0 +1,28 @@
|
||||
using UnityEngine; |
||||
using System.Collections; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Audio", |
||||
"Stop Music", |
||||
"Stops the currently playing game music.")] |
||||
public class StopMusic : Command |
||||
{ |
||||
public override void OnEnter() |
||||
{ |
||||
MusicController musicController = MusicController.GetInstance(); |
||||
if (musicController != null) |
||||
{ |
||||
musicController.StopMusic(); |
||||
} |
||||
|
||||
Continue(); |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(242, 209, 176, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: b359b09a7ba2e4af981f07c07f8af85a |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: f9ded1304c85a430bbc6c65f025cf4dc |
||||
guid: 3dd9a7f66888345859cf2db40ceee354 |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 6e9a956b0b8294e4f82ab030bb93a8e4 |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 42741b4e7e5d44f8b8268e93d23ee33e |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
@ -0,0 +1,74 @@
|
||||
using UnityEngine; |
||||
using System; |
||||
using System.Collections; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Camera", |
||||
"Fade To View", |
||||
"Fades the camera out and in again at a location specified by a View object.")] |
||||
public class FadeToView : Command |
||||
{ |
||||
public float duration = 1f; |
||||
public Fungus.View targetView; |
||||
public bool waitUntilFinished = true; |
||||
public Color fadeColor = Color.black; |
||||
public Texture2D fadeTexture; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
if (targetView == null) |
||||
{ |
||||
Continue(); |
||||
return; |
||||
} |
||||
|
||||
CameraController cameraController = CameraController.GetInstance(); |
||||
|
||||
if (waitUntilFinished) |
||||
{ |
||||
cameraController.waiting = true; |
||||
} |
||||
|
||||
if (fadeTexture) |
||||
{ |
||||
cameraController.screenFadeTexture = fadeTexture; |
||||
} |
||||
else |
||||
{ |
||||
cameraController.screenFadeTexture = CameraController.CreateColorTexture(fadeColor, 32, 32); |
||||
} |
||||
|
||||
cameraController.FadeToView(targetView, duration, delegate { |
||||
if (waitUntilFinished) |
||||
{ |
||||
cameraController.waiting = false; |
||||
Continue(); |
||||
} |
||||
}); |
||||
|
||||
if (!waitUntilFinished) |
||||
{ |
||||
Continue(); |
||||
} |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
if (targetView == null) |
||||
{ |
||||
return "Error: No view selected"; |
||||
} |
||||
else |
||||
{ |
||||
return targetView.name; |
||||
} |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(216, 228, 170, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 437f9a4e3dbc647f9bdce95308418bff |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
@ -0,0 +1,61 @@
|
||||
using UnityEngine; |
||||
using System; |
||||
using System.Collections; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Camera", |
||||
"Move To View", |
||||
"Moves the camera to a location specified by a View object.")] |
||||
public class MoveToView : Command |
||||
{ |
||||
public float duration = 1; |
||||
public Fungus.View targetView; |
||||
public bool waitUntilFinished = true; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
CameraController cameraController = CameraController.GetInstance(); |
||||
|
||||
if (waitUntilFinished) |
||||
{ |
||||
cameraController.waiting = true; |
||||
} |
||||
|
||||
Vector3 targetPosition = targetView.transform.position; |
||||
Quaternion targetRotation = targetView.transform.rotation; |
||||
float targetSize = targetView.viewSize; |
||||
|
||||
cameraController.PanToPosition(targetPosition, targetRotation, targetSize, duration, delegate { |
||||
if (waitUntilFinished) |
||||
{ |
||||
cameraController.waiting = false; |
||||
Continue(); |
||||
} |
||||
}); |
||||
|
||||
if (!waitUntilFinished) |
||||
{ |
||||
Continue(); |
||||
} |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
if (targetView == null) |
||||
{ |
||||
return "Error: No view selected"; |
||||
} |
||||
else |
||||
{ |
||||
return targetView.name; |
||||
} |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(216, 228, 170, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 45c952ea1ad444e479b570fa242679c5 |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
@ -0,0 +1,46 @@
|
||||
using UnityEngine; |
||||
using System; |
||||
using System.Collections; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Camera", |
||||
"Shake Camera", |
||||
"Applies a camera shake effect to the main camera.")] |
||||
public class ShakeCamera : Command |
||||
{ |
||||
public float duration = 0.5f; |
||||
public Vector2 amount = new Vector2(1, 1); |
||||
public bool waitUntilFinished; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
iTween.ShakePosition(Camera.main.gameObject, new Vector3(amount.x, amount.y, 0), duration); |
||||
|
||||
if (waitUntilFinished) |
||||
{ |
||||
Invoke("OnWaitComplete", duration); |
||||
} |
||||
else |
||||
{ |
||||
Continue(); |
||||
} |
||||
} |
||||
|
||||
void OnWaitComplete() |
||||
{ |
||||
Continue(); |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
return "For " + duration + " seconds."; |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(216, 228, 170, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 616cd37e21c7645c58a89edf5abee56f |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: b7cb2aa1c114f44b89b82bc527e85bab |
||||
guid: 3d2b8d81dbfb54c02a92a0966802a55a |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
@ -0,0 +1,222 @@
|
||||
using UnityEditor; |
||||
using UnityEngine; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
using Fungus; |
||||
|
||||
[CanEditMultipleObjects] |
||||
[CustomEditor (typeof(View))] |
||||
public class ViewEditor : Editor |
||||
{ |
||||
static Color viewColor = Color.yellow; |
||||
|
||||
SerializedProperty primaryAspectRatioProp; |
||||
SerializedProperty secondaryAspectRatioProp; |
||||
|
||||
// Draw Views when they're not selected |
||||
[DrawGizmo(GizmoType.NotSelected | GizmoType.SelectedOrChild)] |
||||
static void RenderCustomGizmo(Transform objectTransform, GizmoType gizmoType) |
||||
{ |
||||
View view = objectTransform.gameObject.GetComponent<View>(); |
||||
if (view != null) |
||||
{ |
||||
DrawView(view); |
||||
} |
||||
} |
||||
|
||||
Vector2 LookupAspectRatio(int index) |
||||
{ |
||||
switch (index) |
||||
{ |
||||
default: |
||||
case 1: |
||||
return new Vector2(4, 3); |
||||
case 2: |
||||
return new Vector2(3, 2); |
||||
case 3: |
||||
return new Vector2(16, 10); |
||||
case 4: |
||||
return new Vector2(17, 10); |
||||
case 5: |
||||
return new Vector2(16, 9); |
||||
case 6: |
||||
return new Vector2(2, 1); |
||||
case 7: |
||||
return new Vector2(3, 4); |
||||
case 8: |
||||
return new Vector2(2, 3); |
||||
case 9: |
||||
return new Vector2(10, 16); |
||||
case 10: |
||||
return new Vector2(10, 17); |
||||
case 11: |
||||
return new Vector2(9, 16); |
||||
case 12: |
||||
return new Vector2(1, 2); |
||||
} |
||||
} |
||||
|
||||
void OnEnable() |
||||
{ |
||||
primaryAspectRatioProp = serializedObject.FindProperty ("primaryAspectRatio"); |
||||
secondaryAspectRatioProp = serializedObject.FindProperty ("secondaryAspectRatio"); |
||||
} |
||||
|
||||
public override void OnInspectorGUI() |
||||
{ |
||||
serializedObject.Update(); |
||||
|
||||
EditorGUI.BeginChangeCheck(); |
||||
|
||||
string[] ratios = { "<None>", "Landscape / 4:3", "Landscape / 3:2", "Landscape / 16:10", "Landscape / 17:10", "Landscape / 16:9", "Landscape / 2:1", "Portrait / 3:4", "Portrait / 2:3", "Portrait / 10:16", "Portrait / 10:17", "Portrait / 9:16", "Portrait / 1:2" }; |
||||
|
||||
EditorGUILayout.PropertyField(primaryAspectRatioProp, new GUIContent("Primary Aspect Ratio", "Width and height values that define the primary aspect ratio (e.g. 4:3)")); |
||||
int primaryIndex = EditorGUILayout.Popup("Select Aspect Ratio", 0, ratios); |
||||
if (primaryIndex > 0) |
||||
{ |
||||
primaryAspectRatioProp.vector2Value = LookupAspectRatio(primaryIndex); |
||||
} |
||||
EditorGUILayout.Separator(); |
||||
|
||||
EditorGUILayout.PropertyField(secondaryAspectRatioProp, new GUIContent("Secondary Aspect Ratio", "Width and height values that define the primary aspect ratio (e.g. 4:3)")); |
||||
int secondaryIndex = EditorGUILayout.Popup("Select Aspect Ratio", 0, ratios); |
||||
if (secondaryIndex > 0) |
||||
{ |
||||
secondaryAspectRatioProp.vector2Value = LookupAspectRatio(secondaryIndex); |
||||
} |
||||
EditorGUILayout.Separator(); |
||||
|
||||
if (EditorGUI.EndChangeCheck()) |
||||
{ |
||||
// Avoid divide by zero errors |
||||
if (primaryAspectRatioProp.vector2Value.y == 0) |
||||
{ |
||||
primaryAspectRatioProp.vector2Value = new Vector2(primaryAspectRatioProp.vector2Value.x, 1f); |
||||
} |
||||
if (secondaryAspectRatioProp.vector2Value.y == 0) |
||||
{ |
||||
secondaryAspectRatioProp.vector2Value = new Vector2(secondaryAspectRatioProp.vector2Value.x, 1f); |
||||
} |
||||
|
||||
SceneView.RepaintAll(); |
||||
} |
||||
|
||||
serializedObject.ApplyModifiedProperties(); |
||||
} |
||||
|
||||
void OnSceneGUI () |
||||
{ |
||||
View t = target as View; |
||||
if (t.enabled) |
||||
{ |
||||
EditViewBounds(); |
||||
} |
||||
|
||||
if (GUI.changed) |
||||
{ |
||||
EditorUtility.SetDirty(target); |
||||
} |
||||
} |
||||
|
||||
void EditViewBounds() |
||||
{ |
||||
View view = target as View; |
||||
|
||||
DrawView(view); |
||||
|
||||
Vector3 pos = view.transform.position; |
||||
|
||||
float viewSize = CalculateLocalViewSize(view); |
||||
|
||||
Vector3[] handles = new Vector3[2]; |
||||
handles[0] = view.transform.TransformPoint(new Vector3(0, -viewSize, 0)); |
||||
handles[1] = view.transform.TransformPoint(new Vector3(0, viewSize, 0)); |
||||
|
||||
Handles.color = Color.white; |
||||
|
||||
for (int i = 0; i < 2; ++i) |
||||
{ |
||||
Vector3 newPos = Handles.FreeMoveHandle(handles[i], |
||||
Quaternion.identity, |
||||
HandleUtility.GetHandleSize(pos) * 0.1f, |
||||
Vector3.zero, |
||||
Handles.CubeCap); |
||||
if (newPos != handles[i]) |
||||
{ |
||||
Undo.RecordObject(view, "Changed view size"); |
||||
view.viewSize = (newPos - pos).magnitude; |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public static void DrawView(View view) |
||||
{ |
||||
float height = CalculateLocalViewSize(view); |
||||
float widthA = height * (view.primaryAspectRatio.x / view.primaryAspectRatio.y); |
||||
float widthB = height * (view.secondaryAspectRatio.x / view.secondaryAspectRatio.y); |
||||
|
||||
Color transparent = new Color(1,1,1,0f); |
||||
Color fill = viewColor; |
||||
Color outline = viewColor; |
||||
|
||||
if (Selection.activeGameObject == view.gameObject) |
||||
{ |
||||
fill = outline = Color.green; |
||||
} |
||||
|
||||
fill.a = 0.1f; |
||||
outline.a = 0.5f; |
||||
|
||||
// Draw left box |
||||
{ |
||||
Vector3[] verts = new Vector3[4]; |
||||
verts[0] = view.transform.TransformPoint(new Vector3(-widthB, -height, 0)); |
||||
verts[1] = view.transform.TransformPoint(new Vector3(-widthB, height, 0)); |
||||
verts[2] = view.transform.TransformPoint(new Vector3(-widthA, height, 0)); |
||||
verts[3] = view.transform.TransformPoint(new Vector3(-widthA, -height, 0)); |
||||
|
||||
Handles.DrawSolidRectangleWithOutline(verts, fill, transparent); |
||||
} |
||||
|
||||
// Draw right box |
||||
{ |
||||
Vector3[] verts = new Vector3[4]; |
||||
verts[0] = view.transform.TransformPoint(new Vector3(widthA, -height, 0)); |
||||
verts[1] = view.transform.TransformPoint(new Vector3(widthA, height, 0)); |
||||
verts[2] = view.transform.TransformPoint(new Vector3(widthB, height, 0)); |
||||
verts[3] = view.transform.TransformPoint(new Vector3(widthB, -height, 0)); |
||||
|
||||
Handles.DrawSolidRectangleWithOutline(verts, fill, transparent); |
||||
} |
||||
|
||||
// Draw inner box |
||||
{ |
||||
Vector3[] verts = new Vector3[4]; |
||||
verts[0] = view.transform.TransformPoint(new Vector3(-widthA, -height, 0)); |
||||
verts[1] = view.transform.TransformPoint(new Vector3(-widthA, height, 0)); |
||||
verts[2] = view.transform.TransformPoint(new Vector3(widthA, height, 0)); |
||||
verts[3] = view.transform.TransformPoint(new Vector3(widthA, -height, 0)); |
||||
|
||||
Handles.DrawSolidRectangleWithOutline(verts, transparent, outline ); |
||||
} |
||||
|
||||
// Draw outer box |
||||
{ |
||||
Vector3[] verts = new Vector3[4]; |
||||
verts[0] = view.transform.TransformPoint(new Vector3(-widthB, -height, 0)); |
||||
verts[1] = view.transform.TransformPoint(new Vector3(-widthB, height, 0)); |
||||
verts[2] = view.transform.TransformPoint(new Vector3(widthB, height, 0)); |
||||
verts[3] = view.transform.TransformPoint(new Vector3(widthB, -height, 0)); |
||||
|
||||
Handles.DrawSolidRectangleWithOutline(verts, transparent, outline ); |
||||
} |
||||
} |
||||
|
||||
// Calculate view size in local coordinates |
||||
// Kinda expensive, but accurate and only called in editor. |
||||
static float CalculateLocalViewSize(View view) |
||||
{ |
||||
return view.transform.InverseTransformPoint(view.transform.position + new Vector3(0, view.viewSize, 0)).magnitude; |
||||
} |
||||
} |
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: dd60c6b3baeb0475db2ac8ac965401c4 |
||||
guid: 10dcdae42763d4e44af47c20af580910 |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 48785157e076a44009fad585c2ab2735 |
||||
guid: e3391e010f66a4399adbe2bd0de43a83 |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: b0748817ba5034a03bb11cf6052fd465 |
||||
guid: 8dea678f784954ce3b1e6b1845374ef0 |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 382433a04f0cc44d1b777c359b0242a3 |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 0bb03bbaacb014e7399075a2d6ecad3f |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
@ -0,0 +1,65 @@
|
||||
using UnityEngine; |
||||
using System; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Dialog", |
||||
"Add Option", |
||||
"Adds an option for the player to select, displayed by the next Say command.")] |
||||
public class AddOption : Command |
||||
{ |
||||
public string optionText; |
||||
public Sequence targetSequence; |
||||
|
||||
public bool hideOnSelected; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
if (hideOnSelected && |
||||
targetSequence.GetExecutionCount() > 0) |
||||
{ |
||||
Continue(); |
||||
return; |
||||
} |
||||
|
||||
Choose.Option option = new Choose.Option(); |
||||
option.optionText = optionText; |
||||
option.targetSequence = targetSequence; |
||||
Choose.options.Add(option); |
||||
|
||||
Continue(); |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
string summaryText = optionText; |
||||
|
||||
if (targetSequence == null) |
||||
{ |
||||
summaryText += " ( <Continue> )"; |
||||
} |
||||
else |
||||
{ |
||||
summaryText += " (" + targetSequence.name + ")"; |
||||
} |
||||
|
||||
return summaryText; |
||||
} |
||||
|
||||
public override void GetConnectedSequences(ref List<Sequence> connectedSequences) |
||||
{ |
||||
if (targetSequence != null) |
||||
{ |
||||
connectedSequences.Add(targetSequence); |
||||
} |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(184, 210, 235, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 9a61ea20fbb744ca2a363c33ad65cd89 |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
@ -0,0 +1,154 @@
|
||||
using UnityEngine; |
||||
using System; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Dialog", |
||||
"Choose", |
||||
"Presents a list of options for the player to choose from, with an optional timeout. Add options using preceding AddOption commands.")] |
||||
public class Choose : Command |
||||
{ |
||||
public class Option |
||||
{ |
||||
public string optionText; |
||||
public Sequence targetSequence; |
||||
} |
||||
|
||||
static public List<Option> options = new List<Option>(); |
||||
|
||||
[TextArea(5,10)] |
||||
public string chooseText; |
||||
|
||||
public Character character; |
||||
public AudioClip voiceOverClip; |
||||
public float timeoutDuration; |
||||
|
||||
bool showBasicGUI; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
ChooseDialog dialog = SetChooseDialog.activeDialog; |
||||
showBasicGUI = false; |
||||
if (dialog == null) |
||||
{ |
||||
showBasicGUI = true; |
||||
return; |
||||
} |
||||
|
||||
if (options.Count == 0) |
||||
{ |
||||
Continue(); |
||||
} |
||||
else |
||||
{ |
||||
dialog.ShowDialog(true); |
||||
dialog.SetCharacter(character); |
||||
|
||||
List<ChooseDialog.Option> dialogOptions = new List<ChooseDialog.Option>(); |
||||
foreach (Option option in options) |
||||
{ |
||||
ChooseDialog.Option dialogOption = new ChooseDialog.Option(); |
||||
dialogOption.text = option.optionText; |
||||
Sequence onSelectSequence = option.targetSequence; |
||||
|
||||
dialogOption.onSelect = delegate { |
||||
|
||||
dialog.ShowDialog(false); |
||||
|
||||
if (onSelectSequence == null) |
||||
{ |
||||
Continue (); |
||||
} |
||||
else |
||||
{ |
||||
ExecuteSequence(onSelectSequence); |
||||
} |
||||
}; |
||||
|
||||
dialogOptions.Add(dialogOption); |
||||
} |
||||
|
||||
options.Clear(); |
||||
|
||||
if (voiceOverClip != null) |
||||
{ |
||||
MusicController.GetInstance().PlaySound(voiceOverClip, 1f); |
||||
} |
||||
|
||||
dialog.Choose(chooseText, dialogOptions, timeoutDuration, delegate { |
||||
dialog.ShowDialog(false); |
||||
Continue(); |
||||
}); |
||||
} |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
return "\"" + chooseText + "\""; |
||||
} |
||||
|
||||
public override void GetConnectedSequences (ref List<Sequence> connectedSequences) |
||||
{ |
||||
foreach (Option option in options) |
||||
{ |
||||
if (option.targetSequence != null) |
||||
{ |
||||
connectedSequences.Add(option.targetSequence); |
||||
} |
||||
} |
||||
} |
||||
|
||||
void OnGUI() |
||||
{ |
||||
if (!showBasicGUI) |
||||
{ |
||||
return; |
||||
} |
||||
|
||||
// Draw a basic GUI to use when no uGUI dialog has been set |
||||
// Does not support drawing character images |
||||
|
||||
GUILayout.BeginHorizontal(GUILayout.Width(Screen.width)); |
||||
GUILayout.FlexibleSpace(); |
||||
|
||||
GUILayout.BeginVertical(GUILayout.Height(Screen.height)); |
||||
GUILayout.FlexibleSpace(); |
||||
|
||||
GUILayout.BeginVertical(new GUIStyle(GUI.skin.box)); |
||||
|
||||
if (character != null) |
||||
{ |
||||
GUILayout.Label(character.nameText); |
||||
GUILayout.Space(10); |
||||
} |
||||
|
||||
GUILayout.Label(chooseText); |
||||
|
||||
foreach (Option option in options) |
||||
{ |
||||
if (GUILayout.Button(option.optionText)) |
||||
{ |
||||
options.Clear(); |
||||
showBasicGUI = false; |
||||
ExecuteSequence(option.targetSequence); |
||||
} |
||||
} |
||||
|
||||
GUILayout.EndVertical(); |
||||
|
||||
GUILayout.FlexibleSpace(); |
||||
GUILayout.EndVertical(); |
||||
|
||||
GUILayout.FlexibleSpace(); |
||||
GUILayout.EndHorizontal(); |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(184, 210, 235, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: d1dc785fd3508440db335f3b5654c96c |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
@ -0,0 +1,107 @@
|
||||
using UnityEngine; |
||||
using System; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Dialog", |
||||
"Say", |
||||
"Writes a line of story text to the dialog. A list of options can be specified for the player to choose from. Use a non-zero timeout to give the player a limited time to choose.")] |
||||
public class Say : Command |
||||
{ |
||||
[TextArea(5,10)] |
||||
public string storyText; |
||||
|
||||
public Character character; |
||||
public AudioClip voiceOverClip; |
||||
public bool showOnce; |
||||
int executionCount; |
||||
|
||||
bool showBasicGUI; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
if (showOnce && executionCount > 0) |
||||
{ |
||||
Continue(); |
||||
return; |
||||
} |
||||
|
||||
executionCount++; |
||||
|
||||
SayDialog dialog = SetSayDialog.activeDialog; |
||||
showBasicGUI = false; |
||||
if (dialog == null) |
||||
{ |
||||
showBasicGUI = true; |
||||
return; |
||||
} |
||||
|
||||
dialog.SetCharacter(character); |
||||
|
||||
dialog.ShowDialog(true); |
||||
|
||||
if (voiceOverClip != null) |
||||
{ |
||||
MusicController.GetInstance().PlaySound(voiceOverClip, 1f); |
||||
} |
||||
|
||||
dialog.Say(storyText, delegate { |
||||
dialog.ShowDialog(false); |
||||
Continue(); |
||||
}); |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
return "\"" + storyText + "\""; |
||||
} |
||||
|
||||
void OnGUI() |
||||
{ |
||||
if (!showBasicGUI) |
||||
{ |
||||
return; |
||||
} |
||||
|
||||
// Draw a basic GUI to use when no uGUI dialog has been set |
||||
// Does not support drawing character images |
||||
|
||||
GUILayout.BeginHorizontal(GUILayout.Width(Screen.width)); |
||||
GUILayout.FlexibleSpace(); |
||||
|
||||
GUILayout.BeginVertical(GUILayout.Height(Screen.height)); |
||||
GUILayout.FlexibleSpace(); |
||||
|
||||
GUILayout.BeginVertical(new GUIStyle(GUI.skin.box)); |
||||
|
||||
if (character != null) |
||||
{ |
||||
GUILayout.Label(character.nameText); |
||||
GUILayout.Space(10); |
||||
} |
||||
|
||||
GUILayout.Label(storyText); |
||||
if (GUILayout.Button("Continue")) |
||||
{ |
||||
showBasicGUI = false; |
||||
Continue(); |
||||
} |
||||
|
||||
GUILayout.EndVertical(); |
||||
|
||||
GUILayout.FlexibleSpace(); |
||||
GUILayout.EndVertical(); |
||||
|
||||
GUILayout.FlexibleSpace(); |
||||
GUILayout.EndHorizontal(); |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(184, 210, 235, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: ec422cd568a9c4a31ad7c36d0572b9da |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
@ -0,0 +1,38 @@
|
||||
using UnityEngine; |
||||
using System; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Dialog", |
||||
"Set Choose Dialog", |
||||
"Sets the active dialog to use for displaying story text with the Choose command.")] |
||||
public class SetChooseDialog : Command |
||||
{ |
||||
public ChooseDialog chooseDialog; |
||||
static public ChooseDialog activeDialog; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
activeDialog = chooseDialog; |
||||
Continue(); |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
if (chooseDialog == null) |
||||
{ |
||||
return "Error: No dialog selected"; |
||||
} |
||||
|
||||
return chooseDialog.name; |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(184, 210, 235, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 926adf8389384479eb93ef4d6ce8eb33 |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
@ -0,0 +1,38 @@
|
||||
using UnityEngine; |
||||
using System; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Dialog", |
||||
"Set Say Dialog", |
||||
"Sets the active dialog to use for displaying story text with the Say command.")] |
||||
public class SetSayDialog : Command |
||||
{ |
||||
public SayDialog sayDialog; |
||||
static public SayDialog activeDialog; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
activeDialog = sayDialog; |
||||
Continue(); |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
if (sayDialog == null) |
||||
{ |
||||
return "Error: No dialog selected"; |
||||
} |
||||
|
||||
return sayDialog.name; |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(184, 210, 235, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 60846452b4dd44937b12b1c00111d8fc |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 805471f08101f4ad8a705fc863435758 |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
userData: |
@ -0,0 +1,44 @@
|
||||
using UnityEditor; |
||||
using UnityEditorInternal; |
||||
using UnityEngine; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
using Rotorz.ReorderableList; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
|
||||
[CustomEditor (typeof(AddOption))] |
||||
public class AddOptionEditor : CommandEditor |
||||
{ |
||||
SerializedProperty optionTextProp; |
||||
SerializedProperty hideOnSelectedProp; |
||||
SerializedProperty targetSequenceProp; |
||||
|
||||
void OnEnable() |
||||
{ |
||||
optionTextProp = serializedObject.FindProperty("optionText"); |
||||
hideOnSelectedProp = serializedObject.FindProperty("hideOnSelected"); |
||||
targetSequenceProp = serializedObject.FindProperty("targetSequence"); |
||||
} |
||||
|
||||
public override void DrawCommandGUI() |
||||
{ |
||||
serializedObject.Update(); |
||||
|
||||
AddOption t = target as AddOption; |
||||
|
||||
EditorGUILayout.PropertyField(optionTextProp, new GUIContent("Option Text", "Text to display on the option button.")); |
||||
|
||||
SequenceEditor.SequenceField(targetSequenceProp, |
||||
new GUIContent("Target Sequence", "Sequence to execute when this option is selected by the player."), |
||||
new GUIContent("<Continue>"), |
||||
t.GetFungusScript()); |
||||
|
||||
EditorGUILayout.PropertyField(hideOnSelectedProp, new GUIContent("Hide On Selected", "Hide this option forever once the player has selected it.")); |
||||
|
||||
serializedObject.ApplyModifiedProperties(); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 40a93fe42338b42e7a0215379d219400 |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |