Browse Source

Merge pull request #35 from snozbot/VisualScripting

merging Fungus 2 branch back to master
master
chrisgregan 10 years ago
parent
commit
d0b739fbbf
  1. 2
      Assets/Example.meta
  2. 2
      Assets/Example/Audio.meta
  3. BIN
      Assets/Example/Audio/UpATree.ogg
  4. 2
      Assets/Example/Audio/UpATree.ogg.meta
  5. 2
      Assets/Example/Scenes.meta
  6. BIN
      Assets/Example/Scenes/Example.unity
  7. 2
      Assets/Example/Scenes/Example.unity.meta
  8. 2
      Assets/Example/Sprites.meta
  9. 8
      Assets/Example/Sprites/Attribution.txt
  10. 2
      Assets/Example/Sprites/Attribution.txt.meta
  11. BIN
      Assets/Example/Sprites/Bear.png
  12. 48
      Assets/Example/Sprites/Bear.png.meta
  13. BIN
      Assets/Example/Sprites/BearHead.png
  14. 5
      Assets/Example/Sprites/BearHead.png.meta
  15. BIN
      Assets/Example/Sprites/Ciara.psd
  16. 49
      Assets/Example/Sprites/Ciara.psd.meta
  17. BIN
      Assets/Example/Sprites/CiaraHead.psd
  18. 49
      Assets/Example/Sprites/CiaraHead.psd.meta
  19. BIN
      Assets/Example/Sprites/DeepForest.jpg
  20. 48
      Assets/Example/Sprites/DeepForest.jpg.meta
  21. BIN
      Assets/Example/Sprites/SanctuaryForest.jpg
  22. 48
      Assets/Example/Sprites/SanctuaryForest.jpg.meta
  23. BIN
      Assets/Example/Sprites/Shay.psd
  24. 49
      Assets/Example/Sprites/Shay.psd.meta
  25. BIN
      Assets/Example/Sprites/ShayHead.psd
  26. 49
      Assets/Example/Sprites/ShayHead.psd.meta
  27. BIN
      Assets/Example/Sprites/Skipper.psd
  28. 5
      Assets/Example/Sprites/Skipper.psd.meta
  29. BIN
      Assets/Example/Sprites/SkipperHead.psd
  30. 49
      Assets/Example/Sprites/SkipperHead.psd.meta
  31. BIN
      Assets/Example/Sprites/Waterfall.jpg
  32. 48
      Assets/Example/Sprites/Waterfall.jpg.meta
  33. BIN
      Assets/Example/Sprites/WaterfallForest.jpg
  34. 48
      Assets/Example/Sprites/WaterfallForest.jpg.meta
  35. 2
      Assets/Fungus.meta
  36. 2
      Assets/Fungus/Animation.meta
  37. 2
      Assets/Fungus/Animation/Commands.meta
  38. 42
      Assets/Fungus/Animation/Commands/SetAnimBool.cs
  39. 2
      Assets/Fungus/Animation/Commands/SetAnimBool.cs.meta
  40. 42
      Assets/Fungus/Animation/Commands/SetAnimFloat.cs
  41. 2
      Assets/Fungus/Animation/Commands/SetAnimFloat.cs.meta
  42. 42
      Assets/Fungus/Animation/Commands/SetAnimInteger.cs
  43. 2
      Assets/Fungus/Animation/Commands/SetAnimInteger.cs.meta
  44. 41
      Assets/Fungus/Animation/Commands/SetAnimTrigger.cs
  45. 2
      Assets/Fungus/Animation/Commands/SetAnimTrigger.cs.meta
  46. 2
      Assets/Fungus/Audio.meta
  47. 5
      Assets/Fungus/Audio/Audio.meta
  48. 0
      Assets/Fungus/Audio/Audio/Click.wav
  49. 0
      Assets/Fungus/Audio/Audio/Click.wav.meta
  50. 5
      Assets/Fungus/Audio/Commands.meta
  51. 40
      Assets/Fungus/Audio/Commands/PlayMusic.cs
  52. 8
      Assets/Fungus/Audio/Commands/PlayMusic.cs.meta
  53. 43
      Assets/Fungus/Audio/Commands/PlaySound.cs
  54. 8
      Assets/Fungus/Audio/Commands/PlaySound.cs.meta
  55. 39
      Assets/Fungus/Audio/Commands/SetMusicVolume.cs
  56. 8
      Assets/Fungus/Audio/Commands/SetMusicVolume.cs.meta
  57. 28
      Assets/Fungus/Audio/Commands/StopMusic.cs
  58. 8
      Assets/Fungus/Audio/Commands/StopMusic.cs.meta
  59. 2
      Assets/Fungus/Audio/Scripts.meta
  60. 14
      Assets/Fungus/Audio/Scripts/MusicController.cs
  61. 0
      Assets/Fungus/Audio/Scripts/MusicController.cs.meta
  62. 5
      Assets/Fungus/Camera.meta
  63. 5
      Assets/Fungus/Camera/Commands.meta
  64. 74
      Assets/Fungus/Camera/Commands/FadeToView.cs
  65. 8
      Assets/Fungus/Camera/Commands/FadeToView.cs.meta
  66. 61
      Assets/Fungus/Camera/Commands/MoveToView.cs
  67. 8
      Assets/Fungus/Camera/Commands/MoveToView.cs.meta
  68. 46
      Assets/Fungus/Camera/Commands/ShakeCamera.cs
  69. 8
      Assets/Fungus/Camera/Commands/ShakeCamera.cs.meta
  70. 2
      Assets/Fungus/Camera/Editor.meta
  71. 222
      Assets/Fungus/Camera/Editor/ViewEditor.cs
  72. 0
      Assets/Fungus/Camera/Editor/ViewEditor.cs.meta
  73. 2
      Assets/Fungus/Camera/Prefabs.meta
  74. BIN
      Assets/Fungus/Camera/Prefabs/View.prefab
  75. 0
      Assets/Fungus/Camera/Prefabs/View.prefab.meta
  76. 2
      Assets/Fungus/Camera/Scripts.meta
  77. 45
      Assets/Fungus/Camera/Scripts/CameraController.cs
  78. 3
      Assets/Fungus/Camera/Scripts/CameraController.cs.meta
  79. 16
      Assets/Fungus/Camera/Scripts/View.cs
  80. 0
      Assets/Fungus/Camera/Scripts/View.cs.meta
  81. 2
      Assets/Fungus/Camera/Sprites.meta
  82. 0
      Assets/Fungus/Camera/Sprites/ScreenFade.png
  83. 4
      Assets/Fungus/Camera/Sprites/ScreenFade.png.meta
  84. 0
      Assets/Fungus/Camera/Sprites/SwipePanIcon.png
  85. 0
      Assets/Fungus/Camera/Sprites/SwipePanIcon.png.meta
  86. 5
      Assets/Fungus/Dialog.meta
  87. 5
      Assets/Fungus/Dialog/Commands.meta
  88. 65
      Assets/Fungus/Dialog/Commands/AddOption.cs
  89. 8
      Assets/Fungus/Dialog/Commands/AddOption.cs.meta
  90. 154
      Assets/Fungus/Dialog/Commands/Choose.cs
  91. 8
      Assets/Fungus/Dialog/Commands/Choose.cs.meta
  92. 107
      Assets/Fungus/Dialog/Commands/Say.cs
  93. 8
      Assets/Fungus/Dialog/Commands/Say.cs.meta
  94. 38
      Assets/Fungus/Dialog/Commands/SetChooseDialog.cs
  95. 8
      Assets/Fungus/Dialog/Commands/SetChooseDialog.cs.meta
  96. 38
      Assets/Fungus/Dialog/Commands/SetSayDialog.cs
  97. 8
      Assets/Fungus/Dialog/Commands/SetSayDialog.cs.meta
  98. 5
      Assets/Fungus/Dialog/Editor.meta
  99. 44
      Assets/Fungus/Dialog/Editor/AddOptionEditor.cs
  100. 8
      Assets/Fungus/Dialog/Editor/AddOptionEditor.cs.meta
  101. Some files were not shown because too many files have changed in this diff Show More

2
Assets/Fungus/Docs.meta → Assets/Example.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: b2a1842979c244113ac31b4b37744a1d
guid: 4b09c77dc01c54b5084100479119d16d
folderAsset: yes
DefaultImporter:
userData:

2
Assets/FungusExample/Audio.meta → Assets/Example/Audio.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 23916e2f1deff4e31a36b6e75aed0906
guid: 6ec2f7eb17e1141eea07422a76e852c4
folderAsset: yes
DefaultImporter:
userData:

BIN
Assets/Example/Audio/UpATree.ogg

Binary file not shown.

2
Assets/FungusExample/Audio/effect.wav.meta → Assets/Example/Audio/UpATree.ogg.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5446370c736a84b6d9d6a9bb6f4d4521
guid: ae3aa0e9b0f0248a59548b5d9e77a6c1
AudioImporter:
serializedVersion: 4
format: 0

2
Assets/FungusExample/Scenes.meta → Assets/Example/Scenes.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 695c2b87de46948719d8d25616c55ad0
guid: 01aa5d8be39a64aefa40bbe2bb40a9d1
folderAsset: yes
DefaultImporter:
userData:

BIN
Assets/Example/Scenes/Example.unity

Binary file not shown.

2
Assets/FungusExample/Scenes/Example.unity.meta → Assets/Example/Scenes/Example.unity.meta

@ -1,4 +1,4 @@
fileFormatVersion: 2
guid: 5a6b6f6f9c1684498b25f6f41ef56995
guid: 7456307ca6764419c87a92bb5351630d
DefaultImporter:
userData:

2
Assets/Fungus/Sprites.meta → Assets/Example/Sprites.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 46997c16617ca413c9b5d94fd22aeb52
guid: aed10a27008a24d06bc8c4f3eb9c2074
folderAsset: yes
DefaultImporter:
userData:

8
Assets/Example/Sprites/Attribution.txt

@ -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

2
Assets/FungusExample/Sprites/GreenCons/MouseRunnerDotComGraphicsLicense.txt.meta → Assets/Example/Sprites/Attribution.txt.meta

@ -1,4 +1,4 @@
fileFormatVersion: 2
guid: b2e1b498f5c584f32af544c563ec0a47
guid: f35e49c61f66a4ac3a13a2f6e1424132
TextScriptImporter:
userData:

BIN
Assets/Example/Sprites/Bear.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

48
Assets/Example/Sprites/Bear.png.meta

@ -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:

BIN
Assets/Example/Sprites/BearHead.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

5
Assets/FungusExample/Sprites/MushroomLand/bg_desert.png.meta → Assets/Example/Sprites/BearHead.png.meta

@ -1,6 +1,8 @@
fileFormatVersion: 2
guid: 553ed7a6833df4e73add201fa05442d9
guid: 62955e2782fd34c5ca3e78712625ae50
TextureImporter:
fileIDToRecycleName:
21300000: BearHead
serializedVersion: 2
mipmaps:
mipMapMode: 0
@ -35,6 +37,7 @@ TextureImporter:
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8

BIN
Assets/Example/Sprites/Ciara.psd

Binary file not shown.

49
Assets/Example/Sprites/Ciara.psd.meta

@ -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:

BIN
Assets/Example/Sprites/CiaraHead.psd

Binary file not shown.

49
Assets/Example/Sprites/CiaraHead.psd.meta

@ -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:

BIN
Assets/Example/Sprites/DeepForest.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

48
Assets/Example/Sprites/DeepForest.jpg.meta

@ -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:

BIN
Assets/Example/Sprites/SanctuaryForest.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 KiB

48
Assets/Example/Sprites/SanctuaryForest.jpg.meta

@ -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:

BIN
Assets/Example/Sprites/Shay.psd

Binary file not shown.

49
Assets/Example/Sprites/Shay.psd.meta

@ -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:

BIN
Assets/Example/Sprites/ShayHead.psd

Binary file not shown.

49
Assets/Example/Sprites/ShayHead.psd.meta

@ -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:

BIN
Assets/Example/Sprites/Skipper.psd

Binary file not shown.

5
Assets/FungusExample/Sprites/MushroomLand/bg_castle.png.meta → Assets/Example/Sprites/Skipper.psd.meta

@ -1,6 +1,8 @@
fileFormatVersion: 2
guid: 59930f9d710bb4959aad3b151c20cc82
guid: ed14cc18e1e37449eb670f2613314102
TextureImporter:
fileIDToRecycleName:
21300000: Skipper
serializedVersion: 2
mipmaps:
mipMapMode: 0
@ -35,6 +37,7 @@ TextureImporter:
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8

BIN
Assets/Example/Sprites/SkipperHead.psd

Binary file not shown.

49
Assets/Example/Sprites/SkipperHead.psd.meta

@ -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:

BIN
Assets/Example/Sprites/Waterfall.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

48
Assets/Example/Sprites/Waterfall.jpg.meta

@ -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:

BIN
Assets/Example/Sprites/WaterfallForest.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

48
Assets/Example/Sprites/WaterfallForest.jpg.meta

@ -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:

2
Assets/Fungus.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 72452d0189a95436fb93c2ec54d83801
guid: 120b23b5240c94aee960b7434706811c
folderAsset: yes
DefaultImporter:
userData:

2
Assets/Fungus/Fonts/source-sans-pro.meta → Assets/Fungus/Animation.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 4dae98786fda548fba135bed70721da9
guid: 623a31d1ed64f48c18a2941fb2e6bb4b
folderAsset: yes
DefaultImporter:
userData:

2
Assets/Fungus/Scripts/Commands.meta → Assets/Fungus/Animation/Commands.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ed31c7843a16b49bb918643ab98b7f67
guid: 3e8003ca74cfb4a99983b0084a826c72
folderAsset: yes
DefaultImporter:
userData:

42
Assets/Fungus/Animation/Commands/SetAnimBool.cs

@ -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);
}
}
}

2
Assets/Fungus/Editor/PageEditor.cs.meta → Assets/Fungus/Animation/Commands/SetAnimBool.cs.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: dce33924cf6804b2c94d17784a6037d1
guid: ee63e642958494f1ebed8116ae4b1103
MonoImporter:
serializedVersion: 2
defaultReferences: []

42
Assets/Fungus/Animation/Commands/SetAnimFloat.cs

@ -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);
}
}
}

2
Assets/Fungus/Editor/RoomEditor.cs.meta → Assets/Fungus/Animation/Commands/SetAnimFloat.cs.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 0314fe408508a4b25afa76f65378a427
guid: fb1f6a369ef8c40bda77241018ab6bd6
MonoImporter:
serializedVersion: 2
defaultReferences: []

42
Assets/Fungus/Animation/Commands/SetAnimInteger.cs

@ -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);
}
}
}

2
Assets/Fungus/Legacy/Page.cs.meta → Assets/Fungus/Animation/Commands/SetAnimInteger.cs.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 627f97c837bdf479aa14a90d8ea3a736
guid: 76641c2c16481448eb6c0c1184fcdebe
MonoImporter:
serializedVersion: 2
defaultReferences: []

41
Assets/Fungus/Animation/Commands/SetAnimTrigger.cs

@ -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);
}
}
}

2
Assets/Fungus/Editor/GameEditor.cs.meta → Assets/Fungus/Animation/Commands/SetAnimTrigger.cs.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5464e5745a4da462795a6f6f5b112962
guid: 0729d4f369e6a4241a6e7e3b8b9c1933
MonoImporter:
serializedVersion: 2
defaultReferences: []

2
Assets/Fungus/Audio.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: d9780867e1f2c456a9bd67af4ed5e2e4
guid: 50aeb1f91c7cf484e85d48c7370e926f
folderAsset: yes
DefaultImporter:
userData:

5
Assets/Fungus/Audio/Audio.meta

@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: 0c0251f25261847649112eb90bdc787c
folderAsset: yes
DefaultImporter:
userData:

0
Assets/Fungus/Audio/Click.wav → Assets/Fungus/Audio/Audio/Click.wav

0
Assets/Fungus/Audio/Click.wav.meta → Assets/Fungus/Audio/Audio/Click.wav.meta

5
Assets/Fungus/Audio/Commands.meta

@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: d4ee6befb080e414984229c6b24358ae
folderAsset: yes
DefaultImporter:
userData:

40
Assets/Fungus/Audio/Commands/PlayMusic.cs

@ -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);
}
}
}

8
Assets/Fungus/Audio/Commands/PlayMusic.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1902400ccc99b45d69ad01cb86b57d0f
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

43
Assets/Fungus/Audio/Commands/PlaySound.cs

@ -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);
}
}
}

8
Assets/Fungus/Audio/Commands/PlaySound.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bd2f6be51b3d7490ba5633ee095d0391
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

39
Assets/Fungus/Audio/Commands/SetMusicVolume.cs

@ -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);
}
}
}

8
Assets/Fungus/Audio/Commands/SetMusicVolume.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e5f62b7b5779c46aba13ef24141b2729
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

28
Assets/Fungus/Audio/Commands/StopMusic.cs

@ -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);
}
}
}

8
Assets/Fungus/Audio/Commands/StopMusic.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b359b09a7ba2e4af981f07c07f8af85a
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

2
Assets/Fungus/Scripts.meta → Assets/Fungus/Audio/Scripts.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f9ded1304c85a430bbc6c65f025cf4dc
guid: 3dd9a7f66888345859cf2db40ceee354
folderAsset: yes
DefaultImporter:
userData:

14
Assets/Fungus/Scripts/MusicManager.cs → Assets/Fungus/Audio/Scripts/MusicController.cs

@ -9,21 +9,21 @@ namespace Fungus
* Music playback persists across scene loads.
*/
[RequireComponent(typeof(AudioSource))]
public class MusicManager : MonoBehaviour
public class MusicController : MonoBehaviour
{
static MusicManager instance;
static MusicController instance;
/**
* Returns the MusicManager singleton instance.
* Will create a MusicManager game object if none currently exists.
* Returns the MusicController singleton instance.
* Will create a MusicController game object if none currently exists.
*/
static public MusicManager GetInstance()
static public MusicController GetInstance()
{
if (instance == null)
{
GameObject go = new GameObject("MusicManager");
GameObject go = new GameObject("MusicController");
DontDestroyOnLoad(go);
instance = go.AddComponent<MusicManager>();
instance = go.AddComponent<MusicController>();
}
return instance;

0
Assets/Fungus/Scripts/MusicManager.cs.meta → Assets/Fungus/Audio/Scripts/MusicController.cs.meta

5
Assets/Fungus/Camera.meta

@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: 6e9a956b0b8294e4f82ab030bb93a8e4
folderAsset: yes
DefaultImporter:
userData:

5
Assets/Fungus/Camera/Commands.meta

@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: 42741b4e7e5d44f8b8268e93d23ee33e
folderAsset: yes
DefaultImporter:
userData:

74
Assets/Fungus/Camera/Commands/FadeToView.cs

@ -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);
}
}
}

8
Assets/Fungus/Camera/Commands/FadeToView.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 437f9a4e3dbc647f9bdce95308418bff
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

61
Assets/Fungus/Camera/Commands/MoveToView.cs

@ -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);
}
}
}

8
Assets/Fungus/Camera/Commands/MoveToView.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 45c952ea1ad444e479b570fa242679c5
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

46
Assets/Fungus/Camera/Commands/ShakeCamera.cs

@ -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);
}
}
}

8
Assets/Fungus/Camera/Commands/ShakeCamera.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 616cd37e21c7645c58a89edf5abee56f
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

2
Assets/Fungus/Editor.meta → Assets/Fungus/Camera/Editor.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: b7cb2aa1c114f44b89b82bc527e85bab
guid: 3d2b8d81dbfb54c02a92a0966802a55a
folderAsset: yes
DefaultImporter:
userData:

222
Assets/Fungus/Camera/Editor/ViewEditor.cs

@ -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;
}
}

0
Assets/Fungus/Editor/ViewEditor.cs.meta → Assets/Fungus/Camera/Editor/ViewEditor.cs.meta

2
Assets/Fungus/Prefabs.meta → Assets/Fungus/Camera/Prefabs.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: dd60c6b3baeb0475db2ac8ac965401c4
guid: 10dcdae42763d4e44af47c20af580910
folderAsset: yes
DefaultImporter:
userData:

BIN
Assets/Fungus/Prefabs/View.prefab → Assets/Fungus/Camera/Prefabs/View.prefab

Binary file not shown.

0
Assets/Fungus/Prefabs/View.prefab.meta → Assets/Fungus/Camera/Prefabs/View.prefab.meta

2
Assets/FungusExample/Scripts.meta → Assets/Fungus/Camera/Scripts.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 48785157e076a44009fad585c2ab2735
guid: e3391e010f66a4399adbe2bd0de43a83
folderAsset: yes
DefaultImporter:
userData:

45
Assets/Fungus/Scripts/CameraController.cs → Assets/Fungus/Camera/Scripts/CameraController.cs

@ -36,6 +36,9 @@ namespace Fungus
[HideInInspector]
public bool swipePanActive;
[HideInInspector]
public bool waiting;
float fadeAlpha = 0f;
// Swipe panning control
@ -52,6 +55,37 @@ namespace Fungus
Dictionary<string, CameraView> storedViews = new Dictionary<string, CameraView>();
static CameraController instance;
/**
* Returns the CameraController singleton instance.
* Will create a CameraController game object if none currently exists.
*/
static public CameraController GetInstance()
{
if (instance == null)
{
GameObject go = new GameObject("CameraController");
instance = go.AddComponent<CameraController>();
}
return instance;
}
public static Texture2D CreateColorTexture(Color color, int width, int height)
{
Color[] pixels = new Color[width * height];
for (int i = 0; i < pixels.Length; i++)
{
pixels[i] = color;
}
Texture2D texture = new Texture2D(width, height, TextureFormat.ARGB32, false);
texture.SetPixels(pixels);
texture.Apply();
return texture;
}
void OnGUI()
{
if (swipePanActive)
@ -75,7 +109,8 @@ namespace Fungus
}
// Draw full screen fade texture
if (fadeAlpha < 1f)
if (fadeAlpha < 1f &&
screenFadeTexture != null)
{
// 1 = scene fully visible
// 0 = scene fully obscured
@ -99,6 +134,7 @@ namespace Fungus
public void FadeToView(View view, float fadeDuration, Action fadeAction)
{
swipePanActive = false;
fadeAlpha = 1f;
// Fade out
Fade(0f, fadeDuration / 2f, delegate {
@ -166,6 +202,11 @@ namespace Fungus
SetCameraZ();
}
public void PanToView(View view, float duration, Action arriveAction)
{
PanToPosition(view.transform.position, view.transform.rotation, view.viewSize, duration, arriveAction);
}
/**
* Moves camera from current position to a target position over a period of time.
*/
@ -267,7 +308,7 @@ namespace Fungus
Camera.main.transform.position = Vector3.Lerp(startPos, endPos, Mathf.SmoothStep(0f, 1f, t));
Camera.main.transform.rotation = Quaternion.Lerp(startRot, endRot, Mathf.SmoothStep(0f, 1f, t));
SetCameraZ();
if (arrived &&
arriveAction != null)
{

3
Assets/Fungus/Scripts/CameraController.cs.meta → Assets/Fungus/Camera/Scripts/CameraController.cs.meta

@ -3,7 +3,8 @@ guid: efb7bb24722d4469bbd789bd2e01db19
MonoImporter:
serializedVersion: 2
defaultReferences:
- fadeTexture: {fileID: 2800000, guid: f6c7b1f3a78a24703b70c746d8b9c768, type: 3}
- screenFadeTexture: {fileID: 2800000, guid: f6c7b1f3a78a24703b70c746d8b9c768, type: 3}
- swipePanIcon: {fileID: 2800000, guid: 41bc737f4dc1b40db872aca00bcd7d4b, type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:

16
Assets/Fungus/Scripts/View.cs → Assets/Fungus/Camera/Scripts/View.cs

@ -22,26 +22,14 @@ namespace Fungus
* e.g. a 4:3 aspect ratio = 1.333
*/
[Tooltip("Aspect ratio of the primary view rectangle. (e.g. 4:3 aspect ratio = 1.333)")]
public float primaryAspectRatio = (4f / 3f);
/**
* Color of the primary view rectangle.
*/
[Tooltip("Color of the primary view rectangle.")]
public Color primaryColor = Color.green;
public Vector2 primaryAspectRatio = new Vector2(4, 3);
/**
* Aspect ratio of the secondary view rectangle.
* e.g. a 2:1 aspect ratio = 2/1 = 2.0
*/
[Tooltip("Aspect ratio of the secondary view rectangle. (e.g. 2:1 aspect ratio = 2.0)")]
public float secondaryAspectRatio = (2f / 1f);
/**
* Color of the secondary view rectangle.
*/
[Tooltip("Color of the secondary view rectangle.")]
public Color secondaryColor = Color.grey;
public Vector2 secondaryAspectRatio = new Vector2(2, 1);
void Update()
{

0
Assets/Fungus/Scripts/View.cs.meta → Assets/Fungus/Camera/Scripts/View.cs.meta

2
Assets/FungusExample/Sprites.meta → Assets/Fungus/Camera/Sprites.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: b0748817ba5034a03bb11cf6052fd465
guid: 8dea678f784954ce3b1e6b1845374ef0
folderAsset: yes
DefaultImporter:
userData:

0
Assets/Fungus/Textures/ScreenFade.png → Assets/Fungus/Camera/Sprites/ScreenFade.png

4
Assets/Fungus/Textures/ScreenFade.png.meta → Assets/Fungus/Camera/Sprites/ScreenFade.png.meta

@ -1,6 +1,7 @@
fileFormatVersion: 2
guid: f6c7b1f3a78a24703b70c746d8b9c768
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
@ -20,7 +21,7 @@ TextureImporter:
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
textureFormat: -3
maxTextureSize: 1024
textureSettings:
filterMode: -1
@ -35,6 +36,7 @@ TextureImporter:
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: -1

0
Assets/Fungus/Textures/SwipePanIcon.png → Assets/Fungus/Camera/Sprites/SwipePanIcon.png

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

0
Assets/Fungus/Textures/SwipePanIcon.png.meta → Assets/Fungus/Camera/Sprites/SwipePanIcon.png.meta

5
Assets/Fungus/Dialog.meta

@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: 382433a04f0cc44d1b777c359b0242a3
folderAsset: yes
DefaultImporter:
userData:

5
Assets/Fungus/Dialog/Commands.meta

@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: 0bb03bbaacb014e7399075a2d6ecad3f
folderAsset: yes
DefaultImporter:
userData:

65
Assets/Fungus/Dialog/Commands/AddOption.cs

@ -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);
}
}
}

8
Assets/Fungus/Dialog/Commands/AddOption.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9a61ea20fbb744ca2a363c33ad65cd89
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

154
Assets/Fungus/Dialog/Commands/Choose.cs

@ -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);
}
}
}

8
Assets/Fungus/Dialog/Commands/Choose.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d1dc785fd3508440db335f3b5654c96c
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

107
Assets/Fungus/Dialog/Commands/Say.cs

@ -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);
}
}
}

8
Assets/Fungus/Dialog/Commands/Say.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ec422cd568a9c4a31ad7c36d0572b9da
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

38
Assets/Fungus/Dialog/Commands/SetChooseDialog.cs

@ -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);
}
}
}

8
Assets/Fungus/Dialog/Commands/SetChooseDialog.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 926adf8389384479eb93ef4d6ce8eb33
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

38
Assets/Fungus/Dialog/Commands/SetSayDialog.cs

@ -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);
}
}
}

8
Assets/Fungus/Dialog/Commands/SetSayDialog.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 60846452b4dd44937b12b1c00111d8fc
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

5
Assets/Fungus/Dialog/Editor.meta

@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: 805471f08101f4ad8a705fc863435758
folderAsset: yes
DefaultImporter:
userData:

44
Assets/Fungus/Dialog/Editor/AddOptionEditor.cs

@ -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();
}
}
}

8
Assets/Fungus/Dialog/Editor/AddOptionEditor.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 40a93fe42338b42e7a0215379d219400
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save