diff --git a/Fungus Basics/.gitignore b/Fungus Basics/.gitignore new file mode 100644 index 0000000..ee7c00e --- /dev/null +++ b/Fungus Basics/.gitignore @@ -0,0 +1,74 @@ +# ---> Unity +# This .gitignore file should be placed at the root of your Unity project directory +# +# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore +# +/[Ll]ibrary/ +/[Tt]emp/ +/[Oo]bj/ +/[Bb]uild/ +/[Bb]uilds/ +/[Ll]ogs/ +/[Uu]ser[Ss]ettings/ + +# MemoryCaptures can get excessive in size. +# They also could contain extremely sensitive data +/[Mm]emoryCaptures/ + +# Recordings can get excessive in size +/[Rr]ecordings/ + +# Uncomment this line if you wish to ignore the asset store tools plugin +# /[Aa]ssets/AssetStoreTools* + +# Autogenerated Jetbrains Rider plugin +/[Aa]ssets/Plugins/Editor/JetBrains* + +# Visual Studio cache directory +.vs/ + +# Gradle cache directory +.gradle/ + +# Autogenerated VS/MD/Consulo solution and project files +ExportedObj/ +.consulo/ +*.csproj +*.unityproj +*.sln +*.suo +*.tmp +*.user +*.userprefs +*.pidb +*.booproj +*.svd +*.pdb +*.mdb +*.opendb +*.VC.db + +# Unity3D generated meta files +*.pidb.meta +*.pdb.meta +*.mdb.meta + +# Unity3D generated file on crash reports +sysinfo.txt + +# Builds +*.apk +*.aab +*.unitypackage +*.app + +# Crashlytics generated file +crashlytics-build.properties + +# Packed Addressables +/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* + +# Temporary auto-generated Android Assets +/[Aa]ssets/[Ss]treamingAssets/aa.meta +/[Aa]ssets/[Ss]treamingAssets/aa/* + diff --git a/Fungus Basics/Assets/Fungus.meta b/Fungus Basics/Assets/Fungus.meta new file mode 100644 index 0000000..163520c --- /dev/null +++ b/Fungus Basics/Assets/Fungus.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 120b23b5240c94aee960b7434706811c +folderAsset: yes +DefaultImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Audio.meta b/Fungus Basics/Assets/Fungus/Audio.meta new file mode 100644 index 0000000..ebac8dc --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Audio.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 50aeb1f91c7cf484e85d48c7370e926f +folderAsset: yes +DefaultImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Audio/Click.wav b/Fungus Basics/Assets/Fungus/Audio/Click.wav new file mode 100644 index 0000000..c20f06b Binary files /dev/null and b/Fungus Basics/Assets/Fungus/Audio/Click.wav differ diff --git a/Fungus Basics/Assets/Fungus/Audio/Click.wav.meta b/Fungus Basics/Assets/Fungus/Audio/Click.wav.meta new file mode 100644 index 0000000..c8b9390 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Audio/Click.wav.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c18ae2c530c264a6880266d5e0a71337 +AudioImporter: + serializedVersion: 4 + format: -1 + quality: -.280000001 + stream: 1 + 3D: 0 + forceToMono: 0 + useHardware: 0 + loopable: 0 + userData: diff --git a/Fungus Basics/Assets/Fungus/Audio/Click2.wav b/Fungus Basics/Assets/Fungus/Audio/Click2.wav new file mode 100644 index 0000000..4c5761c Binary files /dev/null and b/Fungus Basics/Assets/Fungus/Audio/Click2.wav differ diff --git a/Fungus Basics/Assets/Fungus/Audio/Click2.wav.meta b/Fungus Basics/Assets/Fungus/Audio/Click2.wav.meta new file mode 100644 index 0000000..cfc7c42 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Audio/Click2.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 14a396b1562834718b2d52b9c4639264 +timeCreated: 1440511211 +licenseType: Free +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 1 + sampleRateSetting: 0 + sampleRateOverride: 0 + compressionFormat: 0 + quality: .5 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Audio/HighVoice.wav b/Fungus Basics/Assets/Fungus/Audio/HighVoice.wav new file mode 100644 index 0000000..a1ee752 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/Audio/HighVoice.wav differ diff --git a/Fungus Basics/Assets/Fungus/Audio/HighVoice.wav.meta b/Fungus Basics/Assets/Fungus/Audio/HighVoice.wav.meta new file mode 100644 index 0000000..28679d2 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Audio/HighVoice.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 774486030b696474e8b3cf7f178123da +timeCreated: 1440509679 +licenseType: Free +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 1 + sampleRateSetting: 0 + sampleRateOverride: 0 + compressionFormat: 0 + quality: .5 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Audio/LowVoice.wav b/Fungus Basics/Assets/Fungus/Audio/LowVoice.wav new file mode 100644 index 0000000..63293ed Binary files /dev/null and b/Fungus Basics/Assets/Fungus/Audio/LowVoice.wav differ diff --git a/Fungus Basics/Assets/Fungus/Audio/LowVoice.wav.meta b/Fungus Basics/Assets/Fungus/Audio/LowVoice.wav.meta new file mode 100644 index 0000000..81a388b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Audio/LowVoice.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: c53b7c20372e444c6bd7f2ac0729bbe2 +timeCreated: 1440509678 +licenseType: Free +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 1 + sampleRateSetting: 0 + sampleRateOverride: 0 + compressionFormat: 0 + quality: .5 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Audio/MidVoice.wav b/Fungus Basics/Assets/Fungus/Audio/MidVoice.wav new file mode 100644 index 0000000..fe6e9a4 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/Audio/MidVoice.wav differ diff --git a/Fungus Basics/Assets/Fungus/Audio/MidVoice.wav.meta b/Fungus Basics/Assets/Fungus/Audio/MidVoice.wav.meta new file mode 100644 index 0000000..4a22ebe --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Audio/MidVoice.wav.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f637c5ce9d10e45c7855ed89bfc6b97e +AudioImporter: + serializedVersion: 4 + format: -1 + quality: .5 + stream: 1 + 3D: 0 + forceToMono: 0 + useHardware: 0 + loopable: 0 + userData: diff --git a/Fungus Basics/Assets/Fungus/Docs.meta b/Fungus Basics/Assets/Fungus/Docs.meta new file mode 100644 index 0000000..8e8f39e --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Docs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5441286d76a2f47c7a2ea683709ea59e +folderAsset: yes +timeCreated: 1473781211 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Docs/CHANGELOG.txt b/Fungus Basics/Assets/Fungus/Docs/CHANGELOG.txt new file mode 100644 index 0000000..47b6fb9 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Docs/CHANGELOG.txt @@ -0,0 +1,1007 @@ +Changelog {#changelog} +========= + +Unreleased +====== + +v3.13.8 +====== + +## Fixed + + - Fixed Editor Gui Layout error in 2021.x and up. Thanks to breadnone. + +v3.13.7 +====== + +## Fixed + - Add missing VariableDrawer for ObjectVariable. Thanks to CG-Tespy. + - Fix double duplication of blocks in flowchart window. Thanks to ongjinwen. + - Dialog ClickAnywhere not supports ignore click delay. Thanks to breadnone. + - SetNextLineFlag only flags if Dialog is actually active/writing. Thanks to breadnone. + - TextAdapter with TMPro, now forces mesh update on text change. Fixes cases where a Say/Writer would expect RevealedCharacters to be current but would be previous frame stale value. + - Camera Fade clears local callback before execution, fixes #973. + - Force portraits undimmed on change sprite. + - Correct CommandList focus and selection when adding a new command. Thanks to Arylos07. + +## Changed + - Block will LogError when an exception is caught from a Command being Executed. + - WriterAudio.GetSecondsRemaining reports 0 if not playing. Thanks to KVinS. + - Add special case that skips variation logic for sequences that contains no elements, making no change. + - Add NotifyEnd to Writer WaitForInputAndClear logic. Thanks to wolfrug. + - Drag event handlers now only trigger from direct drags, not just movement. Thanks to CG-Tespy. + - NarrativeLogMenu can limit the length of it's output, quick fix for narrative logs that would overflow the max ushort vert limit. Thanks to breadnone. + +v3.13.6 +====== + +## Fixed + + - LoadVariable leaves variable unchanged if key not found, previously was setting to default. Thanks to CG-Tespy. + - Portrait MoveToFront now correctly moves holder rather than underlying image itself. Thanks to iwanPlays. + +v3.13.5 +====== + +## Fixed + + - TextAdapter use of Visible Characters null and bounds checked, required for TMPro 3.x + - FlowchartWindow styles force set expected values, seems required to deal with changes to UI style defaults in more recent Unity. + - InvokeMethod command uses more explicit search and more informative log if error is found in editor. + + +v3.13.4 +====== + +## Fixed + + - Set actions on Property commands targeting structs now save changes. Previously the target variable was not being copied back to the internal struct, causing changes to be discarded. Impacts the following Property Commands, Color, Matrix, Quaternion, Vector2, Vector3, Vector4. + - Writer with 0 speed and TMPro text correctly writes at infinite speed, previously was infinite loop. + - Collection Contains* commands now actually show the field to store boolean result. + - Writer with TMPro text now correctly calls NotifyGlyph and less susceptible to nested rich text tag confusion. + +## Changed + + - Conversation System finding character by name now uses an exact match with fallback to previous StartsWith. Thanks to hsandt. + - Flowchart Window labels no longer forced white, to better accomidate dark theme as of Unity 2019.4.8 + + +v3.13.3 +====== + +## Fixed + + - View Gizmo Drawer specifies type of View, no longer tries to run for every object in scene. + - TMProLinkAnim dictionary errors caused by duplicate entries when Domain Reload is disabled, Thanks to yano. + - Divide Equal now uses Unicode characters in place of ASCII slash in menus, so it shows correctly. + +v3.13.2 +====== + +## Fixed + +- Restore string VariableSubstitution in use of AnyVariableDataPair, found in SetVariable and VariableCondition (#841) +- Float variable comparison, typo causing comparison to self instead of rhs(#836) + +v3.13.1 +====== + +## Fixed + +- Build error in JsonChecker caused by missing asmdef in newer Unity versions. (#833) + +v3.13.0 +====== + +## Added + +- Conditional Commands now support multiple comparisons as a chain of && or ||. Thanks to preda2or, and AcademyOfF +- IWriterListener OnAllWorldsWritten fires when there are no words left to be written but writer may still have pending waits +- Entry based NarrativeLog alternate. Thanks to cg-tespy +- Option to grid snap blocks in the FlowchartWindow. +- TMPro Text animation via link text. +- Fungus Collection, varaibles, default types, and commands. +- Github Issue and PR templates. + +## Fixed + +- Portrait image shown as white when cycled through rapidly. +- Flowchart Window Search box steals focus +- Mushroom icon placement incorrect on some versions of Unity. Thanks to TonyJeffree +- Text and Background colour readability across Unity Versions and Pro skin. Thanks to DesperateHouseDev +- VariableData indents incorrect. +- Fix reshow of hidden portrait in Conversation. Thanks to jusw85 +- FlowchartWindow search pop not showing on newer Unity versions. +- VS Solution file fix for Unity 2019.3.12 +- Inspector DeleteSave button now deletes now more aware of target platform. +- Fungus VariableData single and mutliline variable drawing in more recent Unity versions. +- Possible null ref in Conversation editor during variable match check +- Block connections not drawing if origin block is not drawn. + +## Changed + +- Portraits are now all cached when requested under their own gameobjects and toggle active. +- Fungus Docs moved to github wiki +- JSONObject lib updated to newer version. Thanks to qrostar. +- CameraManager and View now use Tween types. +- Dragable EventHandlers now support an array of target dragables. Thanks to SarveshBajaj +- Flowchart GetVariables by type. Thanks to cg-tespy +- A null FungusVariables will now report their string value as Null instead of an empty string. +- Develop updated to Unity 2019.3.13 +- Demo scenes rebuilt in minimum supported Unity version. +- Block selector now orders blocks by name. +- Block search now supports partial matches. +- Update to c#4 +- Updates to Contributing, Code of Conduct. +- Menu command has a button to add a block for it to target. +- Character selector now sorts names. +- Portrait selector now sorts names. +- Update header license +- Writer uses InvariantCulture when parsing floats to avoid unexpected behaviour under changing system cultures. + +v3.12.0 +====== + +## Added + +- Search should search commands, not just block names (#775). Thanks to AcademyOfF +- Debug additions (#777) righclicking context menus additions and improvements on commands, blocks, and variables +- BlockCallers can be seen within the block inspector +- Variable referencers can be seen logged to the console +- Added a custom script importer for lua files. Thanks to Matthew Barnes +- Added Asmdefs +- Fungus Editor Prefs button to locate FungusEditorResources and changelog + +## Fixed + +- Defines and fallbacks for 2017 and 2018 (#781) +- CommandListAdapter sync command selection bidirectionally with selection in underlying reorderablelist +- Command text with 'Error:' shows red +- HighSpeedWriterFix; corrected rate of characters and more than 1 character per frame issue. +- FilterBlocks during SceneChange, now refresh as expected +- Command and Variables outside of Fungus assembly now locate +- Character selection preventing edits bug +- Restore Edit Mode Tests + +## Changed + +- FungusManager.cs Use "double checked locking" algorithm to implement the singleton for "FungusManager" class, which can improve performance. Thanks to AndyHan1001 +- CommandSearchHeightFallback on some versions of Unity editor inspector height is not returning correctly so we make an educated guess if it seems unreliable +- More elaborated use of text in TMPro demo +- Block Inspector forces type at creation. Thanks to Michaelwolf95 +- Warning when requesting menu elements that are not avaialble, such as more menu items that you have created. +- Fungus Docs can now generate in github markdown format + + +v3.11.5 {#v3.11.5} +====== + +## Fixed + +- Mushroom icon for the inspector moved in 2019 as to not overlap the new visibility toggle Unity has added. #745 +- FlowchartWindow MutliSelect now more strictly manages selectedness #744 +- Portrait sprite issue in Unity 2019 #743 + +## Changed + +- Experimental Searchable menus are now enabled by default #746 + +v3.11.4 {#v3.11.4} +====== + +## Changed + +- Updated project to Unity 2019.1.0f2 +- Updated to .NET 4.x +- Updated reference docs + +v3.11.3 {#v3.11.3} +====== + +## Fixed + +- Additional null checks around Flowchart.selectedBlocks and Flowchart.selectedCommands. + +v3.11.2 {#v3.11.2} +====== + +## Fixed + +- Static list caching in editor. + +## Changed + +- Spacing in debug output related to Block find and execute warnings and failures. + +v3.11.1 {#v3.11.1} +====== + +## Fixed + +- Compile error in Unity 2018.3.6f1 + +v3.11.0 {#v3.11.0} +====== + +## Added + +- SetSprite: changes the image on the SpriteRenderer of one or more GameObjects +- SetUIImage: changes the image on the Image of one or more GameObjects (Joerg Burbach) +- Commands to store FungusVariable.ToString into a StringVariable and to parse a string into an Int or Float FungusVariable + +## Fixed + +- #729 VariableEditor popup name and key concat no longer has spaces, allows the PopUp to correctly nest items with the same parent +- #732 BlockInspector correct top panel height in 2018_3 BlockEditor only force unique name if it has changed +- BlockInspector and BlockEditor changes to display correctly in 2019.1.0a13 + +## Changed + +- #728 FlowchartWindow performance for 100s of blocks +- #727 Support use of TMPro in Set Text, Get Text and Narrative Log Menu commands +- #733 Command can now cache a list of referenced variables that are checked by the variablelistadapter for highlighting +- Flowchart can identify add variables found via the substitute regex +- Commands that use SubstituteVariables on their string data use the new caching method so they can highlight variables that will be used during substitution +- #733 HasReference added to many commands that lacked them or had only partially checked vars + +v3.10.0 {#v3_10_0} +====== + +## Added +- #725 Added Stop Then Call mode in Call command. Stops the calling Block immediately, instead of waiting a frame. +- #718 Say and Menu dialogs now support TextMeshPro directly + - TextMeshPro demo scene - A default say dialog but with TextMeshPro Text UI elements in place of uGUI Text + - A default menu dialog but with TextMeshPro Text UI elements in place of uGUI Text + - TextAdapter can be asked to include children in text output search MenuDialogue now uses TextAdapter rather than assuming UI.Text +- #720 Variable reference allows for selecting a flowchart a targeting a specific fungus variable for use from c# +- #705 Added FirstPersonDemo examples +- New audio commands: Play Ambience Sound, Stop Ambience Sound, Play Random sound. + +## Fixed +- #717 Control Audio > Play Loop volume is always 1 +- #723 Unity 2018.3 Warnings +- #711 Beeps in WriterAudio ignores last sound in array +- PLay Sound Effect volume is now independent of Set Music Volume setting +- Correct width calc on smaller width inspectors +- #708 Specifically identify choice blocks as hexagons in documentation + +## Changed +- #721 Conversation text can now contain colons within the text body itself +- #719 Change FlowchartMenuItem.SpawnPrefab to GameObject.Inst rather than PrefabUtil to avoid exception modifications.empty +- #709 Command searchable pop up + - Added Fungus Preferences setting to enable Searchable PopupMenus +- #694 Adding Random Sound Command and Ambiance Sounds - thanks to Hector Castelli +- #704 Replaced Rotorz Reorderable List with Unity's InternalReorderable list +- ExceuteOnEvent dropdown is searchable -can double click to circumvent the search drop down -can remove event by setting None -use search similar to add command method + +Changelog {#changelog} +========= +[TOC] + +v3.9.1 {#v3_9_1} +====== + +## Added +- Text Variation Handler: Adds Ink-style text variation in Say, Menu and Conversation commands. #695 + +## Fixed +- Fixed Reorderable List control errors in 2018.2. Compatible with 2017.4, 2018.1 2018.2 #697 + +v3.9.0 {#v3_9_0} +====== + +## Added +- Conversation command supports setting default clear, wait for input and fade options #673 +- Added Fungus Priority Signals #671 #670 + - allows fungus to notify the outside world that it is doing something of priority so the outside world can pause +- Added GetKey fungus command. #683 + - Supports positive and negative keybindings output to a bool, float or int variable + - Supports checking for pressed, release and current state + - Uses keycode with optional fallback to key name +- Disabled Flowcharts and EventHandlers. #682 +- Added Dialog history on Save Menu UI #675 +- Added BlockReference, a simple data type with a property drawer that makes it easier to select a target fungus block from external c# scripts. #669 +- Added comparison (equals and not equals) as well as assign functionality to most variable types. #668 + +## Changed +- Updated to Unity 2018.1 #681 +- Conversation Manager Regex now allows - and _ within say params group. #692 +- Conversation example scene makes some basic use of new Conversation features +- Update LeanTween to 2.46 #689 +- PortraitController forces alpha and color tweens to be non recursive. +- Updated playground demos + - Football uses GetKey instead of GetAxis (get axis was failing in some packages as inputmanager axis were not imported) + - Defender had a bug due to a change in how unity syncs 'up' between transform and rb2d + +## Fixed +- ElseIfs now confirm that the previous condition was at the same indent as themselves. #693 +- NarrativeLog is tolerant of null Name or Story fields #690 +- Force the hierarchy icon list to refresh when a script a is loaded/changed #672 +- Eventhandlers no longer fire when the flowchart is disabled #682 +- StopFlowchart can continue now #685 +- Fixed stray \\ that were not being stripped on Mac OS, when importing editor resources. #686 + +v3.8.0 {#v3_8_0} +====== + +Many thanks to contributors stevehalliwell, FrederickKDP, MeMark2, KVinS, charblar, FatPuzo for their work on this release! + +## Added +- Added Flowchart.HasBlock() and ExecuteIfHasBlock() methods +- Added Global Variable support. Variables have new 'Global' variable scope. +- Added GlobalVar demo scene + +## Changed +- Updated project version to Unity 2017.4.0f1 +- Refactored the set variable system to make it easier to add variable comparison options +- Added comparison and setting of GameObjects variables +- Updated Batch for newer versions of Unity3D web player #650 + +## Fixed +- Fixed compile errors in Unity 2018.1 beta +- Fixed compiler warnings in Untity2017.3 +- Fixed repeat play of music #659 +- Fixed conflicting EditorResource folder issue #664 +- Fixed SaveMenu DontDestroyOnLoad problems #661 +- Fixed docs: the block name in 6 of "Connections between Blocks" section from "Block2" to "Start" #663 +- Fixed lua say() function to match new say method parameters + +v3.7.0 {#v3_7_0} +====== + +Many thanks to maintainer Steve Halliwell for all the amazing new functionality in this release! + +## Added +- Added Playground examples showing 3 simple arcade games made using Fungus +- Added Rigidbody2D variable type +- Added Vector3 FungusCommands - Fields, Normalise, Convert to Vector2, Arithetic +- Added TransformProperty FungusCommand. Get and Set a transform's fields and properties. Does not currently support rotation, localRotation nor the Mat4x4 commands as we do not have the appropriate FungusVariables to store them in +- Added FungusCommand to Reload Current Scene +- Added Rigidbody2D FungusCommands - AddForce, AddTorque, StopMotion +- Added Input GetAxis fungusCommand, fetch Input.GetAxis and store in a FloatData +- SpawnObject FungusCommand can now store the gameobject it instantiates and can spawn at itself +- Destroy FungusCommand can now be told to pass down a delay to Destroy +- Added Fungus Commands for most of MathF +- Added Math demo scene +- Added Mouse fungus event demo scene +- Added Monobehaviour fungus event handlers and physics demo scene +- Added LeanTween commands and demo scene that approximates the old iTween demo +- Added SpeakingCharacter property to SayDialog +- Added Fungus panel in editor preferences +- Added option to toggle off the fungus icon in the hierarchy in case it conflicts with other tools or is just undesired +- Added TextTag WVO WaitForVoiceOver #572 +- Added ability to show variable list in the Flowchart Inspector #643 +- OpenURL FungusCommand renamed, fixes #554 #642 + +## Changed +- SaveManager now uses json files in a FungusSaves sub directory for all platforms but webplayer & webgl which still use playerprefs +- GetCommandInfo returns the highest priority CommandInfo to better support multiple names while maintaining what is shown in the inspector +- Allow multiple CommandInfos to be added to a class SpawnObject can now also be found under GameObject/Instantiate +- Changed Fungus icon loading to use FungusEditorResources + +## Fixed +- Fixed typo in BlockEditor.BlockField() #633 +- Fixed custom editor for ElseIf command #630 +- Fixed Prefab Variable Dereferencing #618 +- Fixed typo in Set Interactable description #647 +- Fixed choice dialogues were not set to stay during the MenuDialogue #640 +- Fixed camera fading and panning at the same time (thanks to iBicha!) #624 +- Fixed warnings on Unity 2017.2 + +v3.6.0 {#v3_6_0} +====== + +## Added +- Support use of \n newline character in Say and Conversation text +- Added Fungus-Playmaker integration package in Fungus/Integrations/PlayMaker #602 - thanks Nilihum +- Added Delete Save Data button to Save Menu inspector. +- Variable substitution works in Set Variable (String) command +- New "BlockNameAndCustom" Keymode for Save Point command, use both block name and custom key together. #597 - thanks Trieger +- Added portrait DimColor #601 - thanks MorningFunGame +- Lua If and Lua Else If commands #609 - thanks PillowFightIo +- Stop a named Block in a Flowchart +- Added utility to convert all files to Mac line endings + +## Changed +- Made all methods virtual in SayDialog.cs #607 thanks PillowFightIo +- Updated project to Unity 5.6.1, fixed some warnings. +- Use transform.Find instead of deprecated transform.FindChild +- Replaced some uses of slow GameObject.FindObjectOfType() and FindDerivedTypes() + +## Fixed +- Fixed Write command "Clear Text" option not working #594 +- Fixed portrait hide bug in conversation #590 - thanks to lealeelu +- Fixed stopping audio in conversation #592 - thanks to lealeelu +- Fixed can't use FungusLua separately to rest of Fungus #596 +- Fixed can't inspect disabled Flowchart #598 +- Fixed Cmd+Left Click doesn't register as right click on OSX #595 +- Fixed luautils won't work on FungusLua standalone #604 +- Fixed Save Menu: clicking to left of collapsed menu clicks hidden buttons #615 +- Fixed Localization only localizes character name, not story text #611, #614 + +v3.5.1 {#v3_5_1} +====== + +## Changed +- Added Save Data Key property to Save Menu to support multiple games in the same Unity project. + +v3.5.0 {#v3_5_0} +====== + +## Added +- Save game system. Use Save Point command and Save Menu prefab to easily add saving support with rewind / fast forward support. +- Added new menu options for spawning SaveMenu and SavedObjects prefabs +- New Save Game example scene +- Added documentation for Save System. +- Option to Close Other Say Dialogs when one Say Dialog becomes active. +- Select a start Label in Call command properties + +Thanks to contributor [zvinless](https://github.com/zvinless): +- Custom block tints can now be toggled per block in the block inspector. +- Added multi-select feature for blocks via action key/shift+click and click+drag +- Block movement and context menu options now affect all selected blocks +- Added Flowchart window toolbar in place of floating UI +- Flowchart window search filter to quickly find Blocks +- Added keyboard shortcuts and more context menu options for Blocks (copy, cut, duplicate, delete, select all) + +Thanks to contributor [sp-francisco-ruiz](https://github.com/sp-francisco-ruiz): +- Add a new Event Dispatcher to the FungusManager singleton +- Change Draggable2D and Clickable2D to use the new EventDispatcher for efficient calls for events. + +## Changed +- Moved Center button from Flowchart properties to new Flowchart window toolbar +- Flowchart’s SelectedBlock property now refers to the active selected block rather than the sole selected block. +- Updated coding standard with backwards compatibility & contributing notes +- Flowchart window now zoom in/out by mouse cursor or center rather than upper left corner +- All editor textures are now be accessible as properties in FungusEditorResources. +- Use Tools -> Fungus -> Utilities -> UpdateEditorResourcesScript to automatically update these editor textures +- Increased height of multi-line text box for StringDataMulti +- Updated curves, connection points, and grid background rendering with better approach +- Refactored Flowchart window to simplify event handling +- Bumped flowchart version to 2 to upgrade previously serialized selected blocks +- Flowchart context menu now appears on mouse up to better support panning + +## Fixed +- Fixed nested while loops don't loop correctly #562 +- Fixed Sprite Object click skips writing Say Text #576 +- Fixed setmenudialog() lua function does not set main active menu dialog #578 +- Fixed Unity Test Tools compatibility issue with Unity 5.5.0f +- Fixed spine integration to work with latest version of Spine runtime +- Fixed Block connections not highlighting when command selected +- Fixed centered text shifts position when written by Say command #569 +- Fixed Say text appears for single frame when using Say command #575 +- Fixed MenuDialog Lua Bug #565 +- Fixed using say in lua doesn't automatically spawn an EventSystem #571 +- Fixed cannot divide an integer by an integer using Set Variable #579 +- Fixed tabs in conversation text from Lua #574 +- Fixed Flowchart prefab's block show as empty on the Inspector #583 +- Fixed typo in Game Started Wait Frames property name +- Fixed Fungus ignores existing “SayDialog” and creates another one #555 +- Change CSVParser to use Regex.Split (way faster for large CSV files) +- Fixed missing sprite assets in Asset Store version. +- Fixed onComplete callback in MusicManager.SetAudioVolume when duration is 0 +- Removed TestRunner game objects from DragAndDrop examples. + +v3.4.0 {#v3_4_0} +====== + +## Known Issues +- FungusLua generates runtime errors running Lua when using .NET scripting backend. The IL2CPP backend works fine. + +## Added +- Added accessors for GameObject and Transform variables in Flowchart.cs +- Added Flowchart.HasVariable() and GetVariableNames() - thanks murnyipl! +- Added WaitForFrames property to GameStarted event handler. Default is wait for 1 frame (should reduce startup order issues). + +## Changed +- Upgraded to Moonsharp 2.0. Moonsharp source code is now included in Fungus/Thirdparty/MoonSharp +- Removed MoonSharp assembly from link.xml +- Converted MoonSharp line endings to OSX for consistency with rest of project. +- Updated documentation for Lua debugger (using VS Code) +- Removed LuaEnvironment Remote Debugger option. A VS Code debug server always starts when running in the editor. +- SayDialog now supports full variable substitution when setting character names. + +## Fixed + +- Fixed Command properties not copied when copying commands #546 +- Fixed PODTypeFactory and FungusPrefs classes are not registered #549 +- Fixed for compile errors on .NET Core scripting backend +- Fixed LuaBindings registered types in example scenes +- Fixed MoonSharp warning when not building for an AOT platform +- Fixed minor issues in some example scenes (e.g. missing sprite refs) + +v3.3.0 {#v3_3_0} +====== + +## Known Issues +- FungusLua does not work in WebGL builds due to issues in MoonSharp 1.8.0.0 +- Forum thread: http://fungusgames.com/forum/#!/general:fungus-lua-and-web-gl-uni +- FungusLua does not compile for Windows Store platform using .net scripting backend. Use the IL2CPP backend instead. + +## Added +- Added test for StopTweens does not stop a Tween with loop enabled #529 +- Added signals (pub-sub system) for Writer and Block events #539 +- All interfaces now have their own source files. +- Added monodevelop project for editing docs files. +- Added Flip option (<<< and >>>) to conversation system #527 +- Added WaitFrames command to wait for a number of frames +- Added GetToggleState, SetToggleState commands and ToggleChanged event handler +- Added Writer.Paused property to pause a writer from code. + +## Changed + +- Tidied up Fungus folder structure to organize scripts more logically +- Migrated documentation to use Doxygen for help and API docs +- Lots of misc improvements to documentation +- Updated to MoonSharp 1.8.0.0 +- Documented using string facing parameter in stage.show() Lua function. +- Documented <<< and >>> tags for conversation system. +- Documented all public members for API docs. +- All serialized fields are now protected, exposed via public properties as needed. +- Moved all enums to namespace scope. +- Moved global constants to FungusConstants static class. +- Moved editor resources to the main resources folder +- Fungus editor code moved to Fungus.EditorUtils namespace +- Convert singletons to use a single FungusManager singleton #540 +- Renamed CameraController to CameraManager and MusicController to MusicManager +- Changed float constant comparisons to use Mathf.Approximately +- Added #region Public members to all non-editor classes +- StringFormatter, TextTagParser and FungusPrefs classes are now static +- Merged MenuDialog extension methods (used for Lua) with main MenuDialog class. +- Change all public methods to use virtual +- Removed all unnecessary using statements. +- All class and member comments use standard c# xml comment style +- Replaced foreach loops with for loops (avoids allocation for iterator) +- Added changelog to Doxygen documentation + +## Fixed + +- Fixed Setting facing in lua only works if portraits are set to “FRONT” #528 +- Fixed Say command completes instantly after menu choice #533 +- Fixed broken mouse pointer in WebGL build of Drag and Drop +- Fixed ObjectField nulls reference if object is disabled #536 +- Updated Unity Test Tools to v1.5.9 +- Fixed missing Process class error in Unity5.5b3 +- Fixed Spine.Unity namespace problem in integration scripts +- Fix Regex for character names with "." & "'" #531 (thanks to Sercan Altun) + Old Regex expression did not capture Character names with "." and "'". As a result characters with names like "Mr. Jones" or "Ab'ar" were not registering correctly. +- Fixed Lua setlanguage() function +- Fixed namespace issue in Spine integration. +- Fixes all integration tests to pass when run on Windows Standalone. +- Fixed Block inspector displayed for inactive flowchart #544 + +v3.2.0 {#v3_2_0} +====== + +## Known Issues +- FungusLua does not work in WebGL builds due to issues in MoonSharp 1.6.0.0 + Forum thread: http://fungusgames.com/forum/#!/general:fungus-lua-and-web-gl-uni + +## Added +- Added choose() and choosetimer() Lua functions for displaying list of menu options. +- Added Conversation command and Lua function to perform long dialogue exchanges in a single command. +- Added new Conversation examples + +## Changed +- Clickable2D and Dragable2D components can now use legacy input or EventSystem events / raycasts. +- Added DragAndDrop(EventSystem) example scene to show how to use the EventSystem option. +- Made it easier to resize the default SayDialog +- Updated Narrative examples to use the easier choose() function instead of menu() +- Force MenuDialog to become active when using AddOption from Lua. +- Converted tabs to spaces in all source files +- Ensure the character cache is populated before accessing it +- Added Serializable attribute to all variable classes. + +## Fixed +- Added link.xml file to fix FungusLua not running on iOS builds +- Portrait hide bug in Conversation Function #526 +- Unresponsive SayDialog after ClearMenu or *.StopAllBlocks(); #518 +- Can't select a Public variable from another flowchart #522 +- NullReferenceException with nameText in SayDialog #517 +- StackOverflowException in Writer with customized text object #516 +- stage.Show() not fading in a previously faded out character if portrait hasn't changed. +- Missing .Value on _parameterName property. +- Fixed missing component warnings +- Updated MoonSharp to v1.6.0.0 (this time without changing the meta files). + +v3.1.0 {#v3_1_0} +====== + +## Added + +- Flowchart automatically registers with LuaEnvironment for ExecuteLua commands #485 +- Clickable2D and Draggable2D can now use EventSystem events to block clicks on UI elements. Added new drag and drop demo scene to illustrate. + +## Changed + +- Default dialog image is now sliced, so can be resized to any width / height required. +- Upgraded MoonSharp to v1.6.0.0 +- Added [System.Serializable] attribute to all Variable classes. + +## Fixed + +- Default dialog box now fits in a 5:4 ratio display #515 +- Dialog input causing an exception if no Event System is present in scene. +- Missing module variable on round() function +- Menu() Lua function only works once #511 +- Compile error for folks upgrading using the Fungus 3 unitypackage + +v3.0.0 {#v3_0_0} +====== + +Major release with powerful new Lua scripting support and many small improvements and fixes. +This release should be backwards compatible with projects created using Fungus 2. If you have any upgrading issues let us know on the forum. + +Many thanks to the amazing Fungus community for all the suggestions, bug reports and encouragement! + +Awesome github contributors: +- Leah Lee: https://github.com/lealeelu +- Gerardo Marset: https://github.com/ideka +- Konrad Gadzina: https://github.com/FeniXb3 +- Kal O' Brien: https://github.com/kalenobrien15 +- Hawmalt: https://github.com/hawmalt + +## Added +- FungusLua: Lua scripting support for Fungus via wrapper components for using MoonSharp in Unity. #281, #317, #334, #237, #235, #232, #224 + - LuaEnvironment component: Execution environment for running Lua scripts. + - LuaUtils component: Extends LuaEnvironment with lots of useful features. + - LuaBindings: Maps Unity objects & components to Lua variables for use in Lua scripts. + - LuaScript: Runs Lua code from a text file or from a string property. + - LuaStore: Stores variables in a global table which persists across scene loads. + - FungusModule: A set of utility functions for scripting Unity and Fungus from Lua. + - FungusPrefs: An improved version of PlayerPrefs that can be easily used from Lua. + - ExecuteHandler: Listens for any standard Unity event and calls a method on a component in the gameobject. #247 + - ExecuteLua command: Run some Lua script in a Fungus command. Return values can be stored in Fungus variables. + - PODTypeFactory: Utility factory class for instantiating Plain-Old-Data (POD) types like Color, Vector3, etc. + - Lots of FungusLua example scenes + - Fungus documentation now has an extensive section on LuaScripting. +- StringDataMulti: Like StringData, but uses a multi-line textbox in the inspector. +- StopBlock command: Stop executing the named block. +- Improved string substitution system. Now works with Lua global variables and Lua string table, as well as Flowchart variables. +- Extend the string substitution system yourself using the new ISubstitutionHandler interface. +- Added TaskManager library to Thirdparty folder. Allows better control over coroutine execution. +- Show Line Numbers option in Flowchart. Shows the command index in the inspector (off by default). #231 +- Play Animation State command. Plays an animation state directly without a transition. #378 +- Open URL command #382 +- Links to community articles in the help docs #385 +- InfoText.cs component for displaying help information in the top-left of screen +- "Play from Selected" and "Stop All and Play" context menu options in Block command list +- Added Command Index property to Call command +- LuaStore example scene to demonstrate persisting Lua variables between scene loads +- Use stage.show(), stage.showPortrait & stage.hide() to control stage & portraits from Lua #490 + See FungusExamples/FungusLua/Narrative/PortraitController.unity example scene +- Portrait functionality moved to new PortraitController utility class for easier scripting. +- Say and Menu Dialogs now support standard input manager (joystick / controller support) #507 #210 +- Menu options can now be picked with keyboard only +- Fast forward using Shift in Say Dialogs is now done using the Cancel input (Escape key by default). + +## Changed +- Draggable sprite anchors at exact point user clicked. +- Replaced string with StringData, int with IntegerData, etc. in many command properties. Use variables or constants. +- Block.Execute renamed to Block.StartExecute, can now specify a command index to start at. +- Say command: Set the Character using an object field or the dropdown menu. Can now select Character prefabs. +- Improved Flowchart UpdateVersion system +- Portrait image is now hidden at startup in SayDialog +- Use DialogAudio volume property for starting volume on voiceover audio +- WriterAudio now respects the volume property in all cases +- Added short open source license info header to all source files +- SetAudioVolume.waitUntilFinished property #495 +- String substitution uses StringBuilder to avoid string allocations (reduce garbage collection) #490 +- Embed string substitution keys in substitution text (recursive substitution up to 5 levels) #488 + +## Fixed +- SetDraggable2D filename now matches class name. +- Unity 5.4 beta errors & warnings +- CsvParser.cs and InvokeMethod lineendings should be consistent with rest of project. +- Faulty indent levels when inspector is not displayed #380 +- Hide Portrait before Show Portrait breaks portrait system #384 +- Private variable values being reset with multiple flowcharts #389 +- Stage objects blocking raycasts #391 +- Writer voiceover clip always stops when text stops #393 +- Size tag in UI text is not supported #400 +- Clickable sprites can be clicked through UI objects #377 +- Don't destroy sprite objects in Scene Loader #386 +- Add links to community articles in the help docs #385 +- Control volume bug #464 +- Unity Test Tools compile errors in Unity 5.0 +- Edge of inspector window clipped incorreclty in Unity 5.4 beta #425 +- Child Object gets deleted when having a flowchart on parent and child. #475 +- Fixed command summary incorrect for Fade UI command #486 +- No Music clip selected error summary in Play Sound command +- Jump command properties incorrect when block duplicated #504 +- menu() Lua command interactable param has no effect #493 +- Set Anim Integer/Float/Bool lose property settings #492 +- Can't select ExecuteBlock from Unity Event #496 +- Fixed aliased commandIndex property in Call command. + +## Other closed issues +- GameObjects get duplicated when flowchart is on a different scene #373 +- TextMesh Pro integration #214 +- Clickable3D component #195 + +v2.4.0 {#v2_4_0} +====== + +## Added +- FungusLua: Lua scripting support for Fungus via wrapper components for using MoonSharp in Unity. #281, #317, #334, #237, #235, #232, #224 + - LuaEnvironment component: Execution environment for running Lua scripts. + - LuaUtils component: Extends LuaEnvironment with lots of useful features. + - LuaBindings: Maps Unity objects & components to Lua variables for use in Lua scripts. + - LuaScript: Runs Lua code from a text file or from a string property. + - LuaStore: Stores variables in a global table which persists across scene loads. + - FungusModule: A set of utility functions for scripting Unity and Fungus from Lua. + - FungusPrefs: An improved version of PlayerPrefs that can be easily used from Lua. + - ExecuteHandler: Listens for any standard Unity event and calls a method on a component in the gameobject. #247 + - ExecuteLua command: Run some Lua script in a Fungus command. Return values can be stored in Fungus variables. + - PODTypeFactory: Utility factory class for instantiating Plain-Old-Data (POD) types like Color, Vector3, etc. + - Lots of FungusLua example scenes + - Fungus documentation now has an extensive section on LuaScripting. +- StringDataMulti: Like StringData, but uses a multi-line textbox in the inspector. +- StopBlock command: Stop executing the named block. +- Improved string substitution system. Now works with Lua global variables and Lua string table. +- Extend the string substitution system yourself using the new ISubstitutionHandler interface. +- Added TaskManager library to Thirdparty folder. Allows better control over coroutine execution. +- Show Line Numbers option in Flowchart. Shows the command index in the inspector (off by default). #231 +- Play Animation State command. Plays an animation state directly without a transition. #378 +- Open URL command #382 +- Links to community articles in the help docs #385 +- InfoText.cs component for displaying help information in the top-left of screen +- "Play from Selected" and "Stop All and Play" context menu options in Block command list + +## Changed +- Draggable sprite anchors at exact point user clicked. +- Replaced string with StringData, int with IntegerData, etc. in many command properties. +- Bock.Execute renamed to Block.StartExecute, can now specify a command index to start at. +- Say command: Set the Character using an object field or the dropdown menu. Can now select Character prefabs. +- Improved Flowchart UpdateVersion system +- Portrait image is now hidden at startup in SayDialog +- Use DialogAudio volume property for starting volume on voiceover audio +- WriterAudio now respects the volume property in all cases + +## Fixed +- SetDraggable2D filename now matches class name. +- Unity 5.4 beta errors & warnings +- CsvParser.cs and InvokeMethod lineendings should be consistent with rest of project. +- Faulty indent levels when inspector is not displayed #380 +- Hide Portrait before Show Portrait breaks portrait system #384 +- Private variable values being reset with multiple flowcharts #389 +- Stage objects blocking raycasts #391 +- Writer voiceover clip always stops when text stops #393 +- Size tag in UI text is not supported #400 +- Clickable sprites can be clicked through UI objects #377 +- Don't destroy sprite objects in Scene Loader #386 +- Add links to community articles in the help docs #385 +- Control volume bug #464 +- Unity Test Tools compile errors in Unity 5.0 +- Edge of inspector window clipped incorreclty in Unity 5.4 beta #425 + +## Other closed issues +- GameObjects get duplicated when flowchart is on a different scene #373 +- TextMesh Pro integration #214 +- Clickable3D component #195 + +v2.3.1 {#v2_3_1} +====== + +## Fixed +- Can't click on Say Dialog when a Menu Dialog is active #374 +- Set Audio Pitch: OnComplete not called when duration = 0 #369 +- Fade To View can sometimes not work in Unity 5.3 #370 + +v2.3.0 {#v2_3_0} +====== + +## Added +- SetDraggable2D command #191 +- WaitInput command #276 +- Fade UI command to fade UI objects #349 +- Read Text File command to read a text file into a string variable #344 +- Added Set Audio Pitch command #340 +- 'Center View' button to center Flowchart window on all Blocks #302 +- Added Clear Menu command #300 +- Set Slider Value command #297 +- Stop Flowchart command #289 +- Integration with Esoteric Spine animation system (available in Fungus/Integrations/Spine folder) + +## Changed +- Added null checks in Flowchart variable accessors +- Set Say Dialog property for characters +- Can now specify the gameobject to shake for punch tag in Writer component +- PlayMusic command has a loop property +- Updated reorderable list control to v0.4.3 +- Updated to LeanTween 2.30 +- Added HasExecutingBlocks() and GetExecutingBlocks() to Flowchart class +- Remove unused Text Width Scale property on Say Dialog +- Can now specify a camera to use with Camera command (not just main) #319 #307 +- Can now disable Camera Z being forced by View commands #319 +- Text tags now support multiple parameters. +- Write command now works with Text Mesh Pro text objects. +- Writer.InstantComplete property controls click-to-complete writing. +- Shake tag shakes camera instead of Writer game object. + +## Fixed +- Ensure parentBlock is set when block executes #320 +- While loop with following If doesn't loop correctly #354 +- Auto cross fade music in Play Music command #199 +- Play Music call doesn't restart if same music already playing +- Play Music call doesn't restart if same music already playing +- Concurrent Say commands on same Say Dialog should interrupt #356 +- CustomGUI class not in Fungus namespace #353 +- Whitespace trimming after {wc} & {c} tags #346 +- iTween commands on the same gameobject can conflict #342 #303 +- Show Sprite should affect child sprites #338 +- Null reference if command classes have same name #312 +- End command indents when not matched with an If #308 +- Draggable objects behaving incorrectly #310 +- Inactive localizeable game objects are now also cached #322 +- SceneManager warnings in Unity 5.3 +- Fixed Windows store build 268 +- Fixed Writer beep timing issues in WebGL #295 +- Removed say command from Flowchart prefab + +v2.2.2 {#v2_2_2} +====== + +## Added + +- Stop Flowchart command and Flowchart.StopAllBlocks() method #288 + +## Changed + +- Only the first Flowchart added to a scene will have a default GameStarted event handler. +- Null items in variable list are cleaned up on enable. + +## Fixed + +- Flowchart objects break when made into a prefab #275 +- Localization language does not persist between scenes #271 +- Voiceover clips not playing correctly in Say command #273 +- Changing portrait facing flips incorrectly #190 +- Variable substitution in Menu command #263 +- Null variable reference when substituting variables #278 +- Removed empty gameobject in sherlock demo +- Removed unused GameStarted component from built-in Flowchart prefab + +v2.2.1 {#v2_2_1} +====== + +## Added + +- Set Interactable command to control UI button, input field, etc. interactivity #178 +- Button Clicked event handler to execute a block when a UI button is clicked +- End Edit event handler to execute a block when user presses enter in an input field +- Hide specific commands & categories in the Add Command menu by setting the Hide Commands property on Flowchart + +## Changed + +- Improved Enter Name example to demonstrate the new Write, Get Text, Set Text, Set Interactable, etc. commands. +- Removed punctuation pause for last character in a sentence #168 +- Removed unsupported 'shiver' item from tag help description in Say and Write commands +- Moved LICENSE and README inside the Fungus folder #185 + +## Fixed + +- Concurrent Say calls cause Say Dialog to freeze up #156 +- Null reference error after editing Flowchart code #181 +- Markup text visible if rich text not enabled when using Write command #176 +- ControlAudio waitUntilFinished property doesn't wait for correct time #174 +- Removed legacy hidden objects in example scenes #159 +- Undo for delete command doesn't work #161 +- Flowchart in The Hunter example has Hide Components set to false #150 + +v2.2.0 {#v2_2_0} +====== + +## Added + +- Write command for writing text to any text object +- Writer, Writer Audio components for writing text to any text object with lots of new configuration options. +- Say Dialog class has been split into Say Dialog, Dialog Input components +- Dialog Input supports multiple input types; clicks & key presses +- Can hold down shift while pressing a key to fast forward through dialog text +- Say Dialog now adjusts Story Text rect when character image is visible. +- Added Stop() method to Say Dialog and Writer to cancel writing immediately +- Fullscreen command. https://trello.com/c/aA5GQlua +- InputText example in FungusExamples +- Localization support for the Set Text and Write commands. +- Custom commands can integrate with the localisation system by implementing the ILocalizable interface. +- Invoke Event command for calling script methods with a parameter using Unity's EventSystem. +- Invoke Method command for calling script methods with multiple parameters using reflection. +- Can now use UnityEvent variables in custom commands +- Flowchart versioning and initialization +- Menu command now has an Interactable property to add disabled menu options. https://trello.com/c/bFjmGfBc +- Set Sprite Order command. https://trello.com/c/5yZ88Rh0 +- Added Set Sorting Layer command to set renderer sorting layer +- Set Mouse Cursor command and drag and drop support +- Constructors and implicit operators for all Fungus variable types +- Quit command to quit application - https://trello.com/c/qIVLgrDx +- New Fungus/UI command category +- Added ComboBox to Thirdparty folder +- Added Tools > Fungus > Create > Fungus Logo menu option + +## Changed + +- Simplifed Say Dialog hierarchy structure to be easier to customise +- Say Dialog continue image is now a UI button +- Say Dialog automatically fades in / out when writing +- Updated The Facility example to work with new Say Dialog design +- Updated Drag And Drop example to use new Set Mouse Cursor command +- Improved rendering efficiency of Block inspector window. +- Improved shift-selecting commands in Block inspector. +- Portrait command now moves portraits using world position instead of anchored position +- Portrait cross fading is now done using image alpha instead of a custom shader +- Stage Show / Hide is now done by tweening the CanvasGroup alpha. +- Portrait MoveSpeed is now MoveDuration +- Portrait WaitUntilFinished option now works robustly +- Additional flowcharts added to the scene no longer have their initial block start with the default 'Game Started' event. +- Command array properties can now be flagged to use the reorderable list control +- Custom commands can override IsPropertyVisible() to hide specific properties as needed. +- SetActive command shows state in summary +- Block Event Handler for additional Flowcharts now defaults to none. +- Can assign default values to public Fungus variable properties +- Can access Fungus variable values directly without using .Value accessor. +- Say Command fade in / out replaced with automatic fading and Fade When Done property +- Get Text and Set Text command now work on any text object (UI text, UI input fields & 3D text mesh) + +## Fixed + +- Shake Camera command timing issue #137 +- CSV parser doesn't handle Windows-style line endings #131 +- Intermittent init order issue with caching localizeable objects +- Control Audio stopping all untagged audiosources #132 +- Intermittent null reference error from command editors +- Draggable objects don't return to start pos if drag completes #130 +- Moving and fading portraits at the same time +- Character portrait images have display artefacts #92 +- Duplicate Block option does not do a deep copy #129 +- Event System not created after Load Scene #121 +- Voice over audio only works every second time #126 +- Editing multiline command properties in block inspector. +- Compile error when Fungus is used with "Draw On Screen" asset #120 +- Null reference exception when spawning Fungus objects in Unity 5.1 +- Story text box width is restored when using a character with no portrait #141 +- Block inspector window resizes when using cut, copy, paste shortcuts #145 +- Objects spawned from Tools > Fungus > Create menu center correctly in Unity 5.1.3f + +## Process Changes + +We are now using the Unity Test Tools framework for unit and integration testing. +All new features and bug fixes now have automated tests where possible. + +## Upgrade Notes + +We made a LOT of improvements to the Say Dialogs in this release. Unfortunately these changes are likely to break existing customised Say Dialogs. If you upgrade an existing Fungus project and find the Say Dialog are no longer working you will need to delete your Say Dialogs and create new ones. + +v2.1.0 {#v2_1_0} +====== + +First release on Unity Asset Store! + +## Added + +- Added Flowchart.FindBlock so you can check if a Block is executing before you try to execute it. +- Cleanup any unreferenced components in Flowchart when scene loads + +## Changed + +- Call Method can now execute after a delay +https://trello.com/c/a333r2QA + +- Can now control swipe pan speed in Start Swipe command +https://trello.com/c/TmG9SiIa + +- Improved layout of Flowchart name and description +https://trello.com/c/vwnzaOh2 + +## Removed + +- Removed obsolete commands and other dead code + +## Fixed +- Fixed using iTween and Portrait commands in same Flowchart causes null exception #116 +- Fixed whitespace and newlines not being trimmed after {wc} & {c} tags in story text #115 +- Fixed Standard Text import strips out newline characters #114 +- Fixed {x} text tag causing a null reference error #113 +- Fixed Flowchart.ExecuteBlock() not being usable with UI events (e.g. a UI button event) #112 +- Fixed Set Draggable command causing null exception error #111 +- Fixed conflicting Block & command item ids (was breaking localization text export) #110 diff --git a/Fungus Basics/Assets/Fungus/Docs/CHANGELOG.txt.meta b/Fungus Basics/Assets/Fungus/Docs/CHANGELOG.txt.meta new file mode 100644 index 0000000..9e74dcf --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Docs/CHANGELOG.txt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c35cb3df0536b47ab858a7af04b14164 +timeCreated: 1433597476 +licenseType: Free +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Docs/LICENSE.txt b/Fungus Basics/Assets/Fungus/Docs/LICENSE.txt new file mode 100644 index 0000000..006576c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Docs/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Chris Gregan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Fungus Basics/Assets/Fungus/Docs/LICENSE.txt.meta b/Fungus Basics/Assets/Fungus/Docs/LICENSE.txt.meta new file mode 100644 index 0000000..a327908 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Docs/LICENSE.txt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5f60cf750399a4be5b3e3bea9a57a3f8 +timeCreated: 1432311050 +licenseType: Free +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Docs/README.txt b/Fungus Basics/Assets/Fungus/Docs/README.txt new file mode 100644 index 0000000..723f8bd --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Docs/README.txt @@ -0,0 +1,37 @@ +Fungus +====== + +The goal of Fungus is to provide a free, open source tool for creating interactive storytelling games in Unity 3D. +Fungus is designed to be easy to learn for beginners to Unity 3D, especially for people with no coding experience. + +For power users, it provides an intuitive, fast workflow for visual scripting and interactive storytelling. +Fungus is being used to create Visual Novels, Point and Click Adventure Games, Childrens Stories, Hidden Object Games, +eLearning apps and also some frankly weird stuff which defies classification :) + +- Author: Chris Gregan +- Website: fungusgames.com +- Email: chris@snozbot.com +- Twitter: @gofungus +- Facebook: facebook.com/fungusgames + +Instructions +============ + +Installation instructions and tutorial videos are available on the official Fungus website. +http://fungusgames.com/learn + +Support +======= + +If you have questions about Fungus, please search our forum first as someone may have had the same issue already. If you can't find an answer please start a new discussion and we'll answer you as soon as we can. Fungus is designed for beginners and we love to hear from users so please don't be shy about posting! +http://fungusgames.com/forum + +Contributing +============ + +Many thanks to everyone who has contributed code to the project. +https://github.com/snozbot/fungus/graphs/contributors + +If you would like to contribute a bug fix or new feature, please submit a pull request on github (https://github.com/snozbot/fungus) + +And if you are interested in contributing in some other way (art, audio, documentation, pizza) just email me at chris@snozbot.com. diff --git a/Fungus Basics/Assets/Fungus/Docs/README.txt.meta b/Fungus Basics/Assets/Fungus/Docs/README.txt.meta new file mode 100644 index 0000000..70ffe8f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Docs/README.txt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b21045f2b204b490c8d7595b4def46fd +timeCreated: 1431619113 +licenseType: Free +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources.meta b/Fungus Basics/Assets/Fungus/EditorResources.meta new file mode 100644 index 0000000..81e8ab7 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5ff164265158945c18b7d438b570ba22 +folderAsset: yes +timeCreated: 1478502248 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/FungusEditorResources.asset b/Fungus Basics/Assets/Fungus/EditorResources/FungusEditorResources.asset new file mode 100644 index 0000000..6cda160 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/FungusEditorResources.asset @@ -0,0 +1,69 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2af387304e4b454b9ce8b815799cad0, type: 3} + m_Name: FungusEditorResources + m_EditorClassIdentifier: + updateOnReloadScripts: 0 + add: + free: {fileID: 2800000, guid: 24a867d6b4cdda04cb3aa3350f9ec7d0, type: 3} + pro: {fileID: 2800000, guid: 4e43c476b4a7a49a08c37378fb01ce99, type: 3} + add_small: + free: {fileID: 2800000, guid: 288aff1a0e5c14fd3a0039d24149df73, type: 3} + pro: {fileID: 2800000, guid: 64534dfaa17844231a9a9dd2df89d0db, type: 3} + delete: + free: {fileID: 2800000, guid: d6fc8a97e8a5b0947a49b780f787e504, type: 3} + pro: {fileID: 2800000, guid: 29c4d29b1678042a5b3516c732ccc507, type: 3} + down: + free: {fileID: 2800000, guid: 51a973f446c2e664582861480cce6215, type: 3} + pro: {fileID: 2800000, guid: 5a87a7d3683164a238377d948572805f, type: 3} + duplicate: + free: {fileID: 2800000, guid: c97f334c466215a4f93eff31de3c1591, type: 3} + pro: {fileID: 2800000, guid: 2f17490d993c84bd7872ef6588ffba47, type: 3} + fungus_mushroom: + free: {fileID: 2800000, guid: 1c99c9bf7557e23469ed5dfce00504c0, type: 3} + pro: {fileID: 2800000, guid: 6368c1c16ebb1694091262337e4f8c44, type: 3} + up: + free: {fileID: 2800000, guid: 8f1242ad894201f43b2b6d52fd990f77, type: 3} + pro: {fileID: 2800000, guid: 2a76a781db2994b33b83cd84b8835da7, type: 3} + bullet_point: + free: {fileID: 2800000, guid: 4ef739c68bb234717a60a2bb83ff8602, type: 3} + pro: {fileID: 0} + choice_node_off: + free: {fileID: 2800000, guid: 7b6fc04aac74540e39e9502da5312ce7, type: 3} + pro: {fileID: 0} + choice_node_on: + free: {fileID: 2800000, guid: cfc05494b71a0446182868aab5f7febf, type: 3} + pro: {fileID: 0} + command_background: + free: {fileID: 2800000, guid: a5c9a4271b3de4e4f86eff7f8a1bd768, type: 3} + pro: {fileID: 0} + connection_point: + free: {fileID: 2800000, guid: f08a4c27d7efe4aa6a35348a4e8aec8f, type: 3} + pro: {fileID: 0} + event_node_off: + free: {fileID: 2800000, guid: 0e16a209826864df7b05f6d3901aae7a, type: 3} + pro: {fileID: 0} + event_node_on: + free: {fileID: 2800000, guid: 9434488a4efb54da5986eba5d5619baf, type: 3} + pro: {fileID: 0} + play_big: + free: {fileID: 2800000, guid: bff2ba39f5f4448589e80522ebfcd0a0, type: 3} + pro: {fileID: 0} + play_small: + free: {fileID: 2800000, guid: a48a2b9b06deb469d9da1777b094521b, type: 3} + pro: {fileID: 0} + process_node_off: + free: {fileID: 2800000, guid: ea3a4228e6c214149bfe5c741b56ae0c, type: 3} + pro: {fileID: 0} + process_node_on: + free: {fileID: 2800000, guid: c2dceb780784240ccbe8d3cde89f7671, type: 3} + pro: {fileID: 0} diff --git a/Fungus Basics/Assets/Fungus/EditorResources/FungusEditorResources.asset.meta b/Fungus Basics/Assets/Fungus/EditorResources/FungusEditorResources.asset.meta new file mode 100644 index 0000000..1cdb5d0 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/FungusEditorResources.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 29cae11326cb84802b83fc3ff25a47e8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons.meta b/Fungus Basics/Assets/Fungus/EditorResources/Icons.meta new file mode 100644 index 0000000..bd6c0d5 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Icons.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 6ae11e36c1f504a5db97beed10849329 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro.meta b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro.meta new file mode 100644 index 0000000..9dab8a9 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5e5a1319ef7f546a7affe3baabd5fba6 +folderAsset: yes +timeCreated: 1478502692 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/add.png b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/add.png new file mode 100644 index 0000000..23646d9 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/add.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/add.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/add.png.meta new file mode 100644 index 0000000..422af79 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/add.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: 4e43c476b4a7a49a08c37378fb01ce99 +timeCreated: 1478502692 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/add_small.png b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/add_small.png new file mode 100644 index 0000000..cf6b201 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/add_small.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/add_small.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/add_small.png.meta new file mode 100644 index 0000000..4c2c0a2 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/add_small.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: 64534dfaa17844231a9a9dd2df89d0db +timeCreated: 1478502692 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/delete.png b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/delete.png new file mode 100644 index 0000000..5cba698 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/delete.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/delete.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/delete.png.meta new file mode 100644 index 0000000..da79210 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/delete.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: 29c4d29b1678042a5b3516c732ccc507 +timeCreated: 1478502692 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/down.png b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/down.png new file mode 100644 index 0000000..b84dbd5 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/down.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/down.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/down.png.meta new file mode 100644 index 0000000..9dba1d7 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/down.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: 5a87a7d3683164a238377d948572805f +timeCreated: 1478502692 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/duplicate.png b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/duplicate.png new file mode 100644 index 0000000..7a36f57 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/duplicate.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/duplicate.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/duplicate.png.meta new file mode 100644 index 0000000..bbf8b3b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/duplicate.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: 2f17490d993c84bd7872ef6588ffba47 +timeCreated: 1478502692 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/fungus_mushroom.png b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/fungus_mushroom.png new file mode 100644 index 0000000..ab22ce9 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/fungus_mushroom.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/fungus_mushroom.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/fungus_mushroom.png.meta new file mode 100644 index 0000000..360d5b0 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/fungus_mushroom.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: 6368c1c16ebb1694091262337e4f8c44 +timeCreated: 1500456217 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + filterMode: 1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 1024 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 1024 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Android + maxTextureSize: 1024 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: WebGL + maxTextureSize: 1024 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/up.png b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/up.png new file mode 100644 index 0000000..e88161c Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/up.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/up.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/up.png.meta new file mode 100644 index 0000000..2371a0d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Icons/Pro/up.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: 2a76a781db2994b33b83cd84b8835da7 +timeCreated: 1478502692 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/add.png b/Fungus Basics/Assets/Fungus/EditorResources/Icons/add.png new file mode 100644 index 0000000..b53da01 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Icons/add.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/add.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Icons/add.png.meta new file mode 100644 index 0000000..9e3f7df --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Icons/add.png.meta @@ -0,0 +1,53 @@ +fileFormatVersion: 2 +guid: 24a867d6b4cdda04cb3aa3350f9ec7d0 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 1024 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/add_small.png b/Fungus Basics/Assets/Fungus/EditorResources/Icons/add_small.png new file mode 100644 index 0000000..bd4e001 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Icons/add_small.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/add_small.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Icons/add_small.png.meta new file mode 100644 index 0000000..81c827b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Icons/add_small.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 288aff1a0e5c14fd3a0039d24149df73 +timeCreated: 1434110599 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/delete.png b/Fungus Basics/Assets/Fungus/EditorResources/Icons/delete.png new file mode 100644 index 0000000..12aa318 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Icons/delete.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/delete.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Icons/delete.png.meta new file mode 100644 index 0000000..540f115 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Icons/delete.png.meta @@ -0,0 +1,53 @@ +fileFormatVersion: 2 +guid: d6fc8a97e8a5b0947a49b780f787e504 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 1024 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/down.png b/Fungus Basics/Assets/Fungus/EditorResources/Icons/down.png new file mode 100644 index 0000000..082e3bd Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Icons/down.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/down.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Icons/down.png.meta new file mode 100644 index 0000000..86e4046 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Icons/down.png.meta @@ -0,0 +1,53 @@ +fileFormatVersion: 2 +guid: 51a973f446c2e664582861480cce6215 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 1024 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/duplicate.png b/Fungus Basics/Assets/Fungus/EditorResources/Icons/duplicate.png new file mode 100644 index 0000000..19fdf96 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Icons/duplicate.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/duplicate.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Icons/duplicate.png.meta new file mode 100644 index 0000000..9be12c7 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Icons/duplicate.png.meta @@ -0,0 +1,53 @@ +fileFormatVersion: 2 +guid: c97f334c466215a4f93eff31de3c1591 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 1024 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/fungus_mushroom.png b/Fungus Basics/Assets/Fungus/EditorResources/Icons/fungus_mushroom.png new file mode 100644 index 0000000..ab22ce9 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Icons/fungus_mushroom.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/fungus_mushroom.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Icons/fungus_mushroom.png.meta new file mode 100644 index 0000000..6433d92 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Icons/fungus_mushroom.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: 1c99c9bf7557e23469ed5dfce00504c0 +timeCreated: 1500455974 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + filterMode: 1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 1024 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 1024 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Android + maxTextureSize: 1024 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: WebGL + maxTextureSize: 1024 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/up.png b/Fungus Basics/Assets/Fungus/EditorResources/Icons/up.png new file mode 100644 index 0000000..031add3 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Icons/up.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Icons/up.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Icons/up.png.meta new file mode 100644 index 0000000..0a7f9f8 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Icons/up.png.meta @@ -0,0 +1,53 @@ +fileFormatVersion: 2 +guid: 8f1242ad894201f43b2b6d52fd990f77 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 1024 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures.meta b/Fungus Basics/Assets/Fungus/EditorResources/Textures.meta new file mode 100644 index 0000000..b6f21a0 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Textures.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ad80fa4e16e424c1baf05fbd3125b7fa +folderAsset: yes +timeCreated: 1477810347 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/bullet_point.png b/Fungus Basics/Assets/Fungus/EditorResources/Textures/bullet_point.png new file mode 100644 index 0000000..bcafc73 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Textures/bullet_point.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/bullet_point.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Textures/bullet_point.png.meta new file mode 100644 index 0000000..300a162 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Textures/bullet_point.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 4ef739c68bb234717a60a2bb83ff8602 +timeCreated: 1479950896 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 0 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/choice_node_off.png b/Fungus Basics/Assets/Fungus/EditorResources/Textures/choice_node_off.png new file mode 100644 index 0000000..9be699d Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Textures/choice_node_off.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/choice_node_off.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Textures/choice_node_off.png.meta new file mode 100644 index 0000000..5aaef8d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Textures/choice_node_off.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: 7b6fc04aac74540e39e9502da5312ce7 +timeCreated: 1477811818 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 0 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/choice_node_on.png b/Fungus Basics/Assets/Fungus/EditorResources/Textures/choice_node_on.png new file mode 100644 index 0000000..a41445f Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Textures/choice_node_on.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/choice_node_on.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Textures/choice_node_on.png.meta new file mode 100644 index 0000000..f28b9be --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Textures/choice_node_on.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: cfc05494b71a0446182868aab5f7febf +timeCreated: 1477811867 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 0 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/command_background.png b/Fungus Basics/Assets/Fungus/EditorResources/Textures/command_background.png new file mode 100644 index 0000000..23017f5 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Textures/command_background.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/command_background.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Textures/command_background.png.meta new file mode 100644 index 0000000..561633a --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Textures/command_background.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: a5c9a4271b3de4e4f86eff7f8a1bd768 +timeCreated: 1477809339 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 0 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/connection_point.png b/Fungus Basics/Assets/Fungus/EditorResources/Textures/connection_point.png new file mode 100644 index 0000000..5a6719e Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Textures/connection_point.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/connection_point.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Textures/connection_point.png.meta new file mode 100644 index 0000000..51982bb --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Textures/connection_point.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: f08a4c27d7efe4aa6a35348a4e8aec8f +timeCreated: 1478932274 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/event_node_off.png b/Fungus Basics/Assets/Fungus/EditorResources/Textures/event_node_off.png new file mode 100644 index 0000000..cc1379e Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Textures/event_node_off.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/event_node_off.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Textures/event_node_off.png.meta new file mode 100644 index 0000000..e1976cf --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Textures/event_node_off.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: 0e16a209826864df7b05f6d3901aae7a +timeCreated: 1477810004 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 0 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/event_node_on.png b/Fungus Basics/Assets/Fungus/EditorResources/Textures/event_node_on.png new file mode 100644 index 0000000..23e997c Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Textures/event_node_on.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/event_node_on.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Textures/event_node_on.png.meta new file mode 100644 index 0000000..9d55de6 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Textures/event_node_on.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: 9434488a4efb54da5986eba5d5619baf +timeCreated: 1477809339 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 0 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/play_big.png b/Fungus Basics/Assets/Fungus/EditorResources/Textures/play_big.png new file mode 100644 index 0000000..6987c7a Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Textures/play_big.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/play_big.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Textures/play_big.png.meta new file mode 100644 index 0000000..4ad0c86 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Textures/play_big.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: bff2ba39f5f4448589e80522ebfcd0a0 +timeCreated: 1477809339 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 0 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/play_small.png b/Fungus Basics/Assets/Fungus/EditorResources/Textures/play_small.png new file mode 100644 index 0000000..781d267 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Textures/play_small.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/play_small.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Textures/play_small.png.meta new file mode 100644 index 0000000..6cc6248 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Textures/play_small.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: a48a2b9b06deb469d9da1777b094521b +timeCreated: 1477809339 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 0 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/process_node_off.png b/Fungus Basics/Assets/Fungus/EditorResources/Textures/process_node_off.png new file mode 100644 index 0000000..a395371 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Textures/process_node_off.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/process_node_off.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Textures/process_node_off.png.meta new file mode 100644 index 0000000..219859f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Textures/process_node_off.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: ea3a4228e6c214149bfe5c741b56ae0c +timeCreated: 1477809339 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 0 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/process_node_on.png b/Fungus Basics/Assets/Fungus/EditorResources/Textures/process_node_on.png new file mode 100644 index 0000000..426fc7f Binary files /dev/null and b/Fungus Basics/Assets/Fungus/EditorResources/Textures/process_node_on.png differ diff --git a/Fungus Basics/Assets/Fungus/EditorResources/Textures/process_node_on.png.meta b/Fungus Basics/Assets/Fungus/EditorResources/Textures/process_node_on.png.meta new file mode 100644 index 0000000..9b5a040 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/EditorResources/Textures/process_node_on.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: c2dceb780784240ccbe8d3cde89f7671 +timeCreated: 1477809339 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 0 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Fonts.meta b/Fungus Basics/Assets/Fungus/Fonts.meta new file mode 100644 index 0000000..42a4ef0 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Fonts.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: a316c7b38ecb7431a8e6e953b048ba66 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Fonts/Amaranth.meta b/Fungus Basics/Assets/Fungus/Fonts/Amaranth.meta new file mode 100644 index 0000000..2bd0514 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Fonts/Amaranth.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 617f3657eb270446596b1d50e54a600f +folderAsset: yes +DefaultImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Bold.otf b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Bold.otf new file mode 100644 index 0000000..b8b09a8 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Bold.otf differ diff --git a/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Bold.otf.meta b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Bold.otf.meta new file mode 100644 index 0000000..c928dab --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Bold.otf.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 64bd3e45f7a714f16b3c213f55f17fea +TrueTypeFontImporter: + serializedVersion: 2 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 1 + characterPadding: 0 + includeFontData: 1 + use2xBehaviour: 0 + fontNames: [] + customCharacters: + fontRenderingMode: 0 + userData: diff --git a/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-BoldItalic.otf b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-BoldItalic.otf new file mode 100644 index 0000000..610667d Binary files /dev/null and b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-BoldItalic.otf differ diff --git a/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-BoldItalic.otf.meta b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-BoldItalic.otf.meta new file mode 100644 index 0000000..ee237e6 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-BoldItalic.otf.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 30083fe2d35a6490b8f1e57e0d830527 +TrueTypeFontImporter: + serializedVersion: 2 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 1 + characterPadding: 0 + includeFontData: 1 + use2xBehaviour: 0 + fontNames: [] + customCharacters: + fontRenderingMode: 0 + userData: diff --git a/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Italic.otf b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Italic.otf new file mode 100644 index 0000000..2dfaca7 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Italic.otf differ diff --git a/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Italic.otf.meta b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Italic.otf.meta new file mode 100644 index 0000000..61f9cf9 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Italic.otf.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: b4e86052de8904394807b3f10e18a9f6 +TrueTypeFontImporter: + serializedVersion: 2 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 1 + characterPadding: 0 + includeFontData: 1 + use2xBehaviour: 0 + fontNames: [] + customCharacters: + fontRenderingMode: 0 + userData: diff --git a/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Regular.otf b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Regular.otf new file mode 100644 index 0000000..22b38fd Binary files /dev/null and b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Regular.otf differ diff --git a/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Regular.otf.meta b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Regular.otf.meta new file mode 100644 index 0000000..ee057ab --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/Amaranth-Regular.otf.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: bb145366ce7024469a5758b08d31802c +TrueTypeFontImporter: + serializedVersion: 2 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 1 + characterPadding: 0 + includeFontData: 1 + use2xBehaviour: 0 + fontNames: [] + customCharacters: + fontRenderingMode: 0 + userData: diff --git a/Fungus Basics/Assets/Fungus/Fonts/Amaranth/SIL Open Font License.txt b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/SIL Open Font License.txt new file mode 100644 index 0000000..87b92c4 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/SIL Open Font License.txt @@ -0,0 +1,44 @@ +Copyright (c) 2011, Gesine Todt (hallo@gesine-todt.de), +with Reserved Font Name Amaranth. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. + +The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the copyright statement(s). + +"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. + +"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. + +5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Fonts/Amaranth/SIL Open Font License.txt.meta b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/SIL Open Font License.txt.meta new file mode 100644 index 0000000..fd8a662 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Fonts/Amaranth/SIL Open Font License.txt.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 6ae07f4b9d83d4662825fefe8ff30d45 +TextScriptImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Fonts/Exo2.meta b/Fungus Basics/Assets/Fungus/Fonts/Exo2.meta new file mode 100644 index 0000000..67bed7d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Fonts/Exo2.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: e3712f6aa5daa46efa690a7288358254 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Fonts/Exo2/Exo2-Bold.ttf b/Fungus Basics/Assets/Fungus/Fonts/Exo2/Exo2-Bold.ttf new file mode 100644 index 0000000..5e0913f Binary files /dev/null and b/Fungus Basics/Assets/Fungus/Fonts/Exo2/Exo2-Bold.ttf differ diff --git a/Fungus Basics/Assets/Fungus/Fonts/Exo2/Exo2-Bold.ttf.meta b/Fungus Basics/Assets/Fungus/Fonts/Exo2/Exo2-Bold.ttf.meta new file mode 100644 index 0000000..99e8ac2 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Fonts/Exo2/Exo2-Bold.ttf.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 38fb69338d588b64ea5f2c219db3056b +TrueTypeFontImporter: + serializedVersion: 2 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 1 + characterPadding: 0 + includeFontData: 1 + use2xBehaviour: 0 + fontNames: [] + customCharacters: + fontRenderingMode: 0 + userData: diff --git a/Fungus Basics/Assets/Fungus/Fonts/Exo2/Exo2-Regular.ttf b/Fungus Basics/Assets/Fungus/Fonts/Exo2/Exo2-Regular.ttf new file mode 100644 index 0000000..8e09f6f Binary files /dev/null and b/Fungus Basics/Assets/Fungus/Fonts/Exo2/Exo2-Regular.ttf differ diff --git a/Fungus Basics/Assets/Fungus/Fonts/Exo2/Exo2-Regular.ttf.meta b/Fungus Basics/Assets/Fungus/Fonts/Exo2/Exo2-Regular.ttf.meta new file mode 100644 index 0000000..c713bfe --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Fonts/Exo2/Exo2-Regular.ttf.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 79197ecfbc3a4294a89ce589dac02cf2 +TrueTypeFontImporter: + serializedVersion: 2 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 1 + characterPadding: 0 + includeFontData: 1 + use2xBehaviour: 0 + fontNames: [] + customCharacters: + fontRenderingMode: 0 + userData: diff --git a/Fungus Basics/Assets/Fungus/Fonts/Exo2/OFL.txt b/Fungus Basics/Assets/Fungus/Fonts/Exo2/OFL.txt new file mode 100644 index 0000000..1456c18 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Fonts/Exo2/OFL.txt @@ -0,0 +1,97 @@ +Copyright (c) , (), +with Reserved Font Name . +Copyright (c) , (), +with Reserved Font Name . +Copyright (c) , (). + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/Fungus Basics/Assets/Fungus/Fonts/Exo2/OFL.txt.meta b/Fungus Basics/Assets/Fungus/Fonts/Exo2/OFL.txt.meta new file mode 100644 index 0000000..f2c4508 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Fonts/Exo2/OFL.txt.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 7d156fd4f9c8d4276bddbf2e3c0e820b +TextScriptImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Fungus.asmdef b/Fungus Basics/Assets/Fungus/Fungus.asmdef new file mode 100644 index 0000000..3c6ad2a --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Fungus.asmdef @@ -0,0 +1,15 @@ +{ + "name": "Fungus", + "references": [ + "GUID:6055be8ebefd69e48b49212b09b47b2f" + ], + "optionalUnityReferences": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [] +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Fungus.asmdef.meta b/Fungus Basics/Assets/Fungus/Fungus.asmdef.meta new file mode 100644 index 0000000..a0675e2 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Fungus.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 007db7f7a4c8f944990d71603a110f82 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Integrations.meta b/Fungus Basics/Assets/Fungus/Integrations.meta new file mode 100644 index 0000000..d10dc02 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Integrations.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 441eed542dc8247b39df32118724f695 +folderAsset: yes +timeCreated: 1453725747 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Integrations/Playmaker.meta b/Fungus Basics/Assets/Fungus/Integrations/Playmaker.meta new file mode 100644 index 0000000..88e769b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Integrations/Playmaker.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f24b15e84ed1f42e39fd80dd9042c882 +folderAsset: yes +timeCreated: 1489513669 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Integrations/Playmaker/Fungus-PlayMaker.unitypackage.meta b/Fungus Basics/Assets/Fungus/Integrations/Playmaker/Fungus-PlayMaker.unitypackage.meta new file mode 100644 index 0000000..3560ad2 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Integrations/Playmaker/Fungus-PlayMaker.unitypackage.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 81dbcde0f90df4e9ba9ca2794490e57a +timeCreated: 1491251885 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Integrations/Playmaker/ReadMe.txt b/Fungus Basics/Assets/Fungus/Integrations/Playmaker/ReadMe.txt new file mode 100644 index 0000000..95a395b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Integrations/Playmaker/ReadMe.txt @@ -0,0 +1,25 @@ +Playmaker +============ +Playmaker is a Finite State Machine plugin for Unity that allows developers to create games using a visual scripting methodology that does away with writing code in a manner similar to Fungus. +The FSM allows the creation of various states and events for a given object that allows for the wuick and easy creation of object behaviours and AI for NPCs and enemies. +By combining the Playmaker FSM with Fungus' ability to create engaging, character driven story based games, it is hoped that developers will be able to create games that combine the best features of both. + +Installation +============ + +1. Download and install the Playmaker runtime unitypackage in your Unity project +http://sites.fastspring.com/hutonggames/product/playmaker +https://www.assetstore.unity3d.com/en/#!/content/368 + +2. Install the Fungus-PlayMaker.unitypackage in your Unity project. This file is located in the same folder as this text file. + +3. Open the Fungus-PlayMaker/Scenes/Fungus Playmaker Example Scene for an example of how to use the Spine commands + +Usage +============ + +To write Playmaker variable values to Fungus Variables, use the Action Browser > ScriptControl > Write To Fungus command. +To execute a block in a Fungus flowchart from , use the Action Browser > ScriptControl > Playmaker Execute Block command. +To trigger a global state transition in Playmaker from Fungus, use the Playmaker > Global State Transition command. +To read Fungus variable values into Playmaker Variables, use the Action Browser > ScriptControl > Receive Fungus Variable command. +To write Fungus variable values from the inspector into Playmaker global variables, use the Playmaker > Write To Playmaker command. \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Integrations/Playmaker/ReadMe.txt.meta b/Fungus Basics/Assets/Fungus/Integrations/Playmaker/ReadMe.txt.meta new file mode 100644 index 0000000..1826849 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Integrations/Playmaker/ReadMe.txt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1cd4689522982464db8b5de6a590db9b +timeCreated: 1491251886 +licenseType: Free +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Integrations/Spine.meta b/Fungus Basics/Assets/Fungus/Integrations/Spine.meta new file mode 100644 index 0000000..559c1ad --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Integrations/Spine.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 86a1109db01dd4b5e98b187cea887e04 +folderAsset: yes +timeCreated: 1453725835 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Integrations/Spine/Fungus-Spine.unitypackage.meta b/Fungus Basics/Assets/Fungus/Integrations/Spine/Fungus-Spine.unitypackage.meta new file mode 100644 index 0000000..6fead4d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Integrations/Spine/Fungus-Spine.unitypackage.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fd02c799f3f5c4c83b2fc26c105a3821 +timeCreated: 1453725747 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Integrations/Spine/Readme.txt b/Fungus Basics/Assets/Fungus/Integrations/Spine/Readme.txt new file mode 100644 index 0000000..f5de5cd --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Integrations/Spine/Readme.txt @@ -0,0 +1,18 @@ +This package contains Fungus Commands to support Spine by Esoteric Software +http://esotericsoftware.com/ + +Installation +============ + +1. Download and install the Spine runtime unitypackage in your Unity project +http://esotericsoftware.com/files/runtimes/unity/spine-unity.unitypackage + +2. Install the spine.unitypackage in your Unity project. This file is located in the same folder as this text file. + +3. Open the Fungus-Spine/Scenes/Dr Jeckle scene for an example of how to use the Spine commands + +Usage +============ + +Use the Spine > Play Spine Animation command to play an animation on a Spine object. +Use the Spine > Stop Animation command to stop a playing animation on a Spine object. diff --git a/Fungus Basics/Assets/Fungus/Integrations/Spine/Readme.txt.meta b/Fungus Basics/Assets/Fungus/Integrations/Spine/Readme.txt.meta new file mode 100644 index 0000000..3692a2f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Integrations/Spine/Readme.txt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 56e461aab09c846b6a6ac22f1514516c +timeCreated: 1453725792 +licenseType: Free +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Resources.meta b/Fungus Basics/Assets/Fungus/Resources.meta new file mode 100644 index 0000000..3b02aab --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6cc28e50d85784bb3bb7aa82a3091385 +folderAsset: yes +timeCreated: 1427468269 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs.meta new file mode 100644 index 0000000..c3723ff --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: fc921ee1d765948f0b788694e06b4a4a +folderAsset: yes +timeCreated: 1473780677 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/AudioTag.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/AudioTag.prefab new file mode 100644 index 0000000..02afd71 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/AudioTag.prefab @@ -0,0 +1,132 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &177196 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 477196} + - 114: {fileID: 11477196} + - 82: {fileID: 8249370} + m_Layer: 0 + m_Name: AudioTag + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &477196 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 177196} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.038905814, y: -4.395596, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!82 &8249370 +AudioSource: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 177196} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 0 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 +--- !u!114 &11477196 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 177196} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 335e04fbdd5260043abb299a991dcbe8, type: 3} + m_Name: + m_EditorClassIdentifier: + tagStartSymbol: '{customName}' + tagEndSymbol: '{/customName}' + replaceTagStartWith: '{audio=AudioTag}' + replaceTagEndWith: '{/audio}' +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 177196} + m_IsPrefabParent: 1 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/AudioTag.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/AudioTag.prefab.meta new file mode 100644 index 0000000..8013ddf --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/AudioTag.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 8a19432eef4e44247949edb78c590f64 +NativeFormatImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/Character.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Character.prefab new file mode 100644 index 0000000..6f3d43f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Character.prefab @@ -0,0 +1,60 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &100000 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 400000} + - 114: {fileID: 11400000} + m_Layer: 0 + m_Name: Character + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &400000 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 25fb867d2049d41f597aefdd6b19f598, type: 3} + m_Name: + m_EditorClassIdentifier: + nameText: Character Name + nameColor: {r: 1, g: 1, b: 1, a: 1} + soundEffect: {fileID: 0} + portraits: [] + portraitsFace: 0 + setSayDialog: {fileID: 0} + description: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 100000} + m_IsPrefabParent: 1 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/Character.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Character.prefab.meta new file mode 100644 index 0000000..0f1ecb9 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Character.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: b20518d45890e4be59ba82946f88026c +NativeFormatImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/ClickableSprite.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/ClickableSprite.prefab new file mode 100644 index 0000000..9d8039b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/ClickableSprite.prefab @@ -0,0 +1,105 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &100000 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 400000} + - 212: {fileID: 21200000} + - 61: {fileID: 6100000} + - 114: {fileID: 11400000} + m_Layer: 0 + m_Name: ClickableSprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &400000 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!61 &6100000 +BoxCollider2D: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_Offset: {x: 0, y: 0} + serializedVersion: 2 + m_Size: {x: 3, y: 3} +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cc03961113fa349c09cb06ef2911013d, type: 3} + m_Name: + m_EditorClassIdentifier: + clickEnabled: 1 + hoverCursor: {fileID: 0} + useEventSystem: 0 +--- !u!212 &21200000 +SpriteRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 1 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 100000} + m_IsPrefabParent: 1 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/ClickableSprite.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/ClickableSprite.prefab.meta new file mode 100644 index 0000000..aa41afa --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/ClickableSprite.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 0e6bcf37a2876432fa58eff8888bf177 +NativeFormatImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/DragTargetSprite.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/DragTargetSprite.prefab new file mode 100644 index 0000000..452249d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/DragTargetSprite.prefab @@ -0,0 +1,90 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &100000 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 400000} + - 212: {fileID: 21200000} + - 58: {fileID: 5800000} + m_Layer: 0 + m_Name: DragTargetSprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &400000 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -8.61, y: -4.47, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!58 &5800000 +CircleCollider2D: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_Offset: {x: 0, y: 0} + serializedVersion: 2 + m_Radius: 1.5 +--- !u!212 &21200000 +SpriteRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 1 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 100000} + m_IsPrefabParent: 1 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/DragTargetSprite.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/DragTargetSprite.prefab.meta new file mode 100644 index 0000000..5b09e83 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/DragTargetSprite.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b +NativeFormatImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/DraggableSprite.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/DraggableSprite.prefab new file mode 100644 index 0000000..106fd6a --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/DraggableSprite.prefab @@ -0,0 +1,126 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &100000 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 400000} + - 212: {fileID: 21200000} + - 61: {fileID: 6100000} + - 50: {fileID: 5000000} + - 114: {fileID: 11400000} + m_Layer: 0 + m_Name: DraggableSprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &400000 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.73, y: 0.36, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!50 &5000000 +Rigidbody2D: + serializedVersion: 2 + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_UseAutoMass: 0 + m_Mass: 1 + m_LinearDrag: 0 + m_AngularDrag: 0.05 + m_GravityScale: 1 + m_IsKinematic: 1 + m_Interpolate: 0 + m_SleepingMode: 1 + m_CollisionDetection: 0 + m_Constraints: 0 +--- !u!61 &6100000 +BoxCollider2D: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_Offset: {x: 0, y: 0} + serializedVersion: 2 + m_Size: {x: 3, y: 3} +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 18a0e492e94664ec0ac44d252c40e3a7, type: 3} + m_Name: + m_EditorClassIdentifier: + dragEnabled: 1 + returnOnCancelled: 1 + returnOnCompleted: 1 + returnDuration: 1 + hoverCursor: {fileID: 0} + useEventSystem: 0 +--- !u!212 &21200000 +SpriteRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 1 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 100000} + m_IsPrefabParent: 1 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/DraggableSprite.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/DraggableSprite.prefab.meta new file mode 100644 index 0000000..4ab928f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/DraggableSprite.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 4d55f86cf3b124c8fb1158da26ffa96d +NativeFormatImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/EventSystem.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/EventSystem.prefab new file mode 100644 index 0000000..0338c55 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/EventSystem.prefab @@ -0,0 +1,88 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &179528 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 479528} + - 114: {fileID: 11479524} + - 114: {fileID: 11479526} + - 114: {fileID: 11479528} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &479528 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 179528} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11479524 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 179528} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 5 +--- !u!114 &11479526 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 179528} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &11479528 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 179528} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ForceModuleActive: 0 +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 179528} + m_IsPrefabParent: 1 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/EventSystem.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/EventSystem.prefab.meta new file mode 100644 index 0000000..64bd8b5 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/EventSystem.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 6ba8287b46c1545a789e1b569cad35eb +NativeFormatImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/Flowchart.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Flowchart.prefab new file mode 100644 index 0000000..b46f5b8 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Flowchart.prefab @@ -0,0 +1,138 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &142980 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 467082} + - 114: {fileID: 11430050} + - 114: {fileID: 11433304} + - 114: {fileID: 11462346} + m_Layer: 0 + m_Name: Flowchart + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &467082 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 142980} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11430050 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 142980} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 1 + scrollPos: {x: 0, y: 0} + variablesScrollPos: {x: 0, y: 0} + variablesExpanded: 1 + blockViewHeight: 400 + zoom: 1 + scrollViewRect: + serializedVersion: 2 + x: -343 + y: -340 + width: 1114 + height: 859 + selectedBlock: {fileID: 11433304} + selectedCommands: [] + variables: [] + description: + stepPause: 0 + colorCommands: 1 + hideComponents: 1 + saveSelection: 1 + localizationId: + showLineNumbers: 0 + hideCommands: [] + luaEnvironment: {fileID: 0} + luaBindingName: flowchart +--- !u!114 &11433304 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 142980} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3} + m_Name: + m_EditorClassIdentifier: + nodeRect: + serializedVersion: 2 + x: 67 + y: 70 + width: 120 + height: 40 + itemId: 0 + blockName: New Block + description: + eventHandler: {fileID: 11462346} + commandList: [] +--- !u!114 &11462346 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 142980} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2f6487d21a03404cb21b245f0242e79, type: 3} + m_Name: + m_EditorClassIdentifier: + parentBlock: {fileID: 11433304} +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 0} + propertyPath: commandList.Array.size + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: selectedCommands.Array.size + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: hideComponents + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: selectedBlock + value: + objectReference: {fileID: 11433304} + - target: {fileID: 0} + propertyPath: commandList.Array.data[0] + value: + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: selectedCommands.Array.data[0] + value: + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 142980} + m_IsPrefabParent: 1 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/Flowchart.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Flowchart.prefab.meta new file mode 100644 index 0000000..f05a64e --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Flowchart.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5e7fbc8d4eb714b279eeeef2262c1e1a +timeCreated: 1427386150 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/FungusLogo.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/FungusLogo.prefab new file mode 100644 index 0000000..f9b7741 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/FungusLogo.prefab @@ -0,0 +1,138 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &158064 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 406310} + - 212: {fileID: 21216416} + m_Layer: 0 + m_Name: FungusLogo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &181890 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 454942} + - 212: {fileID: 21226848} + m_Layer: 0 + m_Name: CreatedWith + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &406310 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 158064} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 454942} + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!4 &454942 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 181890} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.48, y: 2.02, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 406310} + m_RootOrder: 0 +--- !u!212 &21216416 +SpriteRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 158064} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 1 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 1b656a189e6154422a74e05a56c3f245, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 +--- !u!212 &21226848 +SpriteRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 181890} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 1 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 7adcbbe62d6554d81affcab2c56ad5ac, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 158064} + m_IsPrefabParent: 1 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/FungusLogo.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/FungusLogo.prefab.meta new file mode 100644 index 0000000..8f67777 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/FungusLogo.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 613b99a82fe95405db46062e1c071434 +timeCreated: 1441210481 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/Localization.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Localization.prefab new file mode 100644 index 0000000..570bbad --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Localization.prefab @@ -0,0 +1,55 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &149266 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 480768} + - 114: {fileID: 11438504} + m_Layer: 0 + m_Name: Localization + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &480768 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 149266} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 2.0554607, y: -3.1648574, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11438504 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 149266} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5724422a635e425bae0af9ffe2615d6, type: 3} + m_Name: + m_EditorClassIdentifier: + activeLanguage: + localizationFile: {fileID: 0} +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 149266} + m_IsPrefabParent: 1 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/Localization.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Localization.prefab.meta new file mode 100644 index 0000000..a3a5880 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Localization.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ffbd0831d997545eab75c364da082c1b +timeCreated: 1428580452 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/MenuDialog.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/MenuDialog.prefab new file mode 100644 index 0000000..e7bf7e8 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/MenuDialog.prefab @@ -0,0 +1,1758 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &115094 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22415094} + - 222: {fileID: 22215100} + - 114: {fileID: 11415072} + - 114: {fileID: 11415074} + - 114: {fileID: 11415076} + m_Layer: 5 + m_Name: OptionButton5 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &115102 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22415102} + - 223: {fileID: 22315124} + - 114: {fileID: 11415088} + - 225: {fileID: 22515124} + - 114: {fileID: 11415064} + - 114: {fileID: 11415124} + m_Layer: 5 + m_Name: MenuDialog + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &115108 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22415108} + - 222: {fileID: 22215112} + - 114: {fileID: 11415102} + - 114: {fileID: 11415104} + - 114: {fileID: 11404784} + m_Layer: 5 + m_Name: TimeoutSlider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &115112 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22415112} + - 114: {fileID: 11404786} + - 114: {fileID: 11404782} + m_Layer: 0 + m_Name: ButtonGroup + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &115116 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22415116} + m_Layer: 5 + m_Name: Fill Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &115120 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22415120} + - 222: {fileID: 22215120} + - 114: {fileID: 11415118} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &115122 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22415122} + - 222: {fileID: 22215122} + - 114: {fileID: 11415120} + m_Layer: 5 + m_Name: Fill + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &141170 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22470986} + - 114: {fileID: 11451014} + - 114: {fileID: 11432608} + m_Layer: 5 + m_Name: DefaultSelectable + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &172108 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22472108} + - 222: {fileID: 22272108} + - 114: {fileID: 11472108} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &172110 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22472110} + - 222: {fileID: 22272110} + - 114: {fileID: 11472114} + - 114: {fileID: 11472112} + - 114: {fileID: 11472110} + m_Layer: 5 + m_Name: OptionButton4 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &172112 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22472112} + - 222: {fileID: 22272112} + - 114: {fileID: 11472116} + - 114: {fileID: 11472118} + - 114: {fileID: 11472120} + m_Layer: 5 + m_Name: OptionButton3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &172114 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22472114} + - 222: {fileID: 22272114} + - 114: {fileID: 11472122} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &172116 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22472116} + - 222: {fileID: 22272116} + - 114: {fileID: 11472124} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &172118 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22472118} + - 222: {fileID: 22272118} + - 114: {fileID: 11472130} + - 114: {fileID: 11472128} + - 114: {fileID: 11472126} + m_Layer: 5 + m_Name: OptionButton2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &172120 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22472120} + - 222: {fileID: 22272120} + - 114: {fileID: 11472132} + - 114: {fileID: 11472134} + - 114: {fileID: 11472136} + m_Layer: 5 + m_Name: OptionButton1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &172122 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22472122} + - 222: {fileID: 22272122} + - 114: {fileID: 11472138} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &172124 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22472124} + - 222: {fileID: 22272124} + - 114: {fileID: 11472140} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &172126 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22472126} + - 222: {fileID: 22272126} + - 114: {fileID: 11472146} + - 114: {fileID: 11472144} + - 114: {fileID: 11472142} + m_Layer: 5 + m_Name: OptionButton0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &11404782 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115112} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1741964061, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalFit: 0 + m_VerticalFit: 2 +--- !u!114 &11404784 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115108} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: 50 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &11404786 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115112} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1297475563, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 4 + m_Spacing: 5 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 +--- !u!114 &11415064 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115102} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &11415072 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115094} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.8627451} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: c207de86481ff7d48a2fba2fcc374723, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &11415074 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115094} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 2 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.14509805, g: 0.75686276, b: 0.8784314, a: 0.69803923} + m_PressedColor: {r: 0.078431375, g: 0.5137255, b: 0.6, a: 1} + m_DisabledColor: {r: 0.5882353, g: 0.64705884, b: 0.6666667, a: 0.5019608} + m_ColorMultiplier: 2 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 21300000, guid: 888feb4a32e3b564fb7e6f9b28cc8e10, + type: 3} + m_PressedSprite: {fileID: 21300000, guid: 2e33a3f531b6adc4f9d8a99c83e2ba2d, type: 3} + m_DisabledSprite: {fileID: 21300000, guid: 49d5ccdda7b99e24787c2abc3891294c, type: 3} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 11415072} + m_OnClick: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &11415076 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115094} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: 100 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &11415088 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115102} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 32 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1600, y: 1200} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 1 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &11415102 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115108} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.588} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &11415104 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115108} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -113659843, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0.2509804, g: 0.2509804, b: 0.2509804, a: 0.5019608} + m_HighlightedColor: {r: 0.5019608, g: 0.5019608, b: 0.5019608, a: 0.69803923} + m_PressedColor: {r: 0.34509805, g: 0.34509805, b: 0.34509805, a: 0.69803923} + m_DisabledColor: {r: 0.2509804, g: 0.2509804, b: 0.2509804, a: 0.5019608} + m_ColorMultiplier: 2 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 0 + m_TargetGraphic: {fileID: 11415102} + m_FillRect: {fileID: 22415122} + m_HandleRect: {fileID: 0} + m_Direction: 1 + m_MinValue: 0 + m_MaxValue: 1 + m_WholeNumbers: 0 + m_Value: 1 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Slider+SliderEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &11415118 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115120} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3} + m_FontSize: 40 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 30 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Continue +--- !u!114 &11415120 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115122} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.2, g: 0.70980394, b: 0.8980392, a: 0.94509804} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &11415124 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115102} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee8371d2b2fe14a9ca0a9465140027de, type: 3} + m_Name: + m_EditorClassIdentifier: + autoSelectFirstButton: 0 +--- !u!114 &11432608 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 141170} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1cbf240ac6442144f90a023c1b64d868, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &11451014 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 141170} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -234403039, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 11472144} + m_SelectOnDown: {fileID: 11472144} + m_SelectOnLeft: {fileID: 11472144} + m_SelectOnRight: {fileID: 11472144} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 0 + m_TargetGraphic: {fileID: 0} +--- !u!114 &11472108 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172108} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3} + m_FontSize: 40 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 30 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Continue +--- !u!114 &11472110 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172110} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: 100 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &11472112 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172110} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 2 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.14509805, g: 0.75686276, b: 0.8784314, a: 0.69803923} + m_PressedColor: {r: 0.078431375, g: 0.5137255, b: 0.6, a: 1} + m_DisabledColor: {r: 0.5882353, g: 0.64705884, b: 0.6666667, a: 0.5019608} + m_ColorMultiplier: 2 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 21300000, guid: 888feb4a32e3b564fb7e6f9b28cc8e10, + type: 3} + m_PressedSprite: {fileID: 21300000, guid: 2e33a3f531b6adc4f9d8a99c83e2ba2d, type: 3} + m_DisabledSprite: {fileID: 21300000, guid: 49d5ccdda7b99e24787c2abc3891294c, type: 3} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 11472114} + m_OnClick: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &11472114 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172110} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.8627451} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: c207de86481ff7d48a2fba2fcc374723, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &11472116 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172112} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.8627451} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: c207de86481ff7d48a2fba2fcc374723, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &11472118 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172112} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 2 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.14509805, g: 0.75686276, b: 0.8784314, a: 0.69803923} + m_PressedColor: {r: 0.078431375, g: 0.5137255, b: 0.6, a: 1} + m_DisabledColor: {r: 0.5882353, g: 0.64705884, b: 0.6666667, a: 0.5019608} + m_ColorMultiplier: 2 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 21300000, guid: 888feb4a32e3b564fb7e6f9b28cc8e10, + type: 3} + m_PressedSprite: {fileID: 21300000, guid: 2e33a3f531b6adc4f9d8a99c83e2ba2d, type: 3} + m_DisabledSprite: {fileID: 21300000, guid: 49d5ccdda7b99e24787c2abc3891294c, type: 3} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 11472116} + m_OnClick: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &11472120 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172112} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: 100 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &11472122 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172114} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3} + m_FontSize: 40 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 30 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Continue +--- !u!114 &11472124 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172116} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3} + m_FontSize: 40 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 30 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Continue +--- !u!114 &11472126 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: 100 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &11472128 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 2 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.14509805, g: 0.75686276, b: 0.8784314, a: 0.69803923} + m_PressedColor: {r: 0.078431375, g: 0.5137255, b: 0.6, a: 1} + m_DisabledColor: {r: 0.5882353, g: 0.64705884, b: 0.6666667, a: 0.5019608} + m_ColorMultiplier: 2 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 21300000, guid: 888feb4a32e3b564fb7e6f9b28cc8e10, + type: 3} + m_PressedSprite: {fileID: 21300000, guid: 2e33a3f531b6adc4f9d8a99c83e2ba2d, type: 3} + m_DisabledSprite: {fileID: 21300000, guid: 49d5ccdda7b99e24787c2abc3891294c, type: 3} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 11472130} + m_OnClick: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &11472130 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.8627451} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: c207de86481ff7d48a2fba2fcc374723, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &11472132 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172120} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.8627451} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: c207de86481ff7d48a2fba2fcc374723, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &11472134 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172120} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 2 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.14509805, g: 0.75686276, b: 0.8784314, a: 0.69803923} + m_PressedColor: {r: 0.078431375, g: 0.5137255, b: 0.6, a: 1} + m_DisabledColor: {r: 0.5882353, g: 0.64705884, b: 0.6666667, a: 0.5019608} + m_ColorMultiplier: 2 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 21300000, guid: 888feb4a32e3b564fb7e6f9b28cc8e10, + type: 3} + m_PressedSprite: {fileID: 21300000, guid: 2e33a3f531b6adc4f9d8a99c83e2ba2d, type: 3} + m_DisabledSprite: {fileID: 21300000, guid: 49d5ccdda7b99e24787c2abc3891294c, type: 3} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 11472132} + m_OnClick: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &11472136 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172120} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: 100 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &11472138 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172122} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3} + m_FontSize: 40 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 30 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Continue +--- !u!114 &11472140 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172124} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3} + m_FontSize: 40 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 30 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Continue +--- !u!114 &11472142 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172126} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: 100 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &11472144 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172126} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 2 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.14509805, g: 0.75686276, b: 0.8784314, a: 0.69803923} + m_PressedColor: {r: 0.078431375, g: 0.5137255, b: 0.6, a: 1} + m_DisabledColor: {r: 0.5882353, g: 0.64705884, b: 0.6666667, a: 0.5019608} + m_ColorMultiplier: 2 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 21300000, guid: 888feb4a32e3b564fb7e6f9b28cc8e10, + type: 3} + m_PressedSprite: {fileID: 21300000, guid: 2e33a3f531b6adc4f9d8a99c83e2ba2d, type: 3} + m_DisabledSprite: {fileID: 21300000, guid: 49d5ccdda7b99e24787c2abc3891294c, type: 3} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 11472146} + m_OnClick: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &11472146 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172126} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.8627451} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: c207de86481ff7d48a2fba2fcc374723, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &22215100 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115094} +--- !u!222 &22215112 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115108} +--- !u!222 &22215120 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115120} +--- !u!222 &22215122 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115122} +--- !u!222 &22272108 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172108} +--- !u!222 &22272110 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172110} +--- !u!222 &22272112 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172112} +--- !u!222 &22272114 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172114} +--- !u!222 &22272116 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172116} +--- !u!222 &22272118 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172118} +--- !u!222 &22272120 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172120} +--- !u!222 &22272122 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172122} +--- !u!222 &22272124 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172124} +--- !u!222 &22272126 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172126} +--- !u!223 &22315124 +Canvas: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115102} + m_Enabled: 1 + serializedVersion: 2 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 1 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_SortingLayerID: 0 + m_SortingOrder: 1 + m_TargetDisplay: 0 +--- !u!224 &22415094 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115094} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 22415120} + m_Father: {fileID: 22415112} + m_RootOrder: 5 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22415102 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115102} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 22470986} + - {fileID: 22415112} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!224 &22415108 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115108} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.9, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 22415116} + m_Father: {fileID: 22415112} + m_RootOrder: 6 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22415112 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115112} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 22472126} + - {fileID: 22472120} + - {fileID: 22472118} + - {fileID: 22472112} + - {fileID: 22472110} + - {fileID: 22415094} + - {fileID: 22415108} + m_Father: {fileID: 22415102} + m_RootOrder: 1 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -0.000018477, y: 191} + m_SizeDelta: {x: 1300, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22415116 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115116} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 22415122} + m_Father: {fileID: 22415108} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: -10} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22415120 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115120} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 22415094} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22415122 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115122} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 22415116} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 10, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22470986 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 141170} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 22415102} + m_RootOrder: 0 + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 1} +--- !u!224 &22472108 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172108} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 22472110} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22472110 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172110} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 22472108} + m_Father: {fileID: 22415112} + m_RootOrder: 4 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22472112 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172112} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 22472114} + m_Father: {fileID: 22415112} + m_RootOrder: 3 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22472114 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172114} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 22472112} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22472116 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172116} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 22472118} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22472118 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172118} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 22472116} + m_Father: {fileID: 22415112} + m_RootOrder: 2 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22472120 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172120} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 22472122} + m_Father: {fileID: 22415112} + m_RootOrder: 1 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22472122 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172122} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 22472120} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22472124 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172124} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 22472126} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22472126 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 172126} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 22472124} + m_Father: {fileID: 22415112} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!225 &22515124 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115102} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 115102} + m_IsPrefabParent: 1 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/MenuDialog.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/MenuDialog.prefab.meta new file mode 100644 index 0000000..a7c1a4f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/MenuDialog.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 9bb64c8df70904eecac3f71f81bf339b +NativeFormatImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/NarrativeLog.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/NarrativeLog.prefab new file mode 100644 index 0000000..9c94da3 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/NarrativeLog.prefab @@ -0,0 +1,434 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3892339027384508655 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3892339027384508654} + - component: {fileID: 3892339027384508652} + - component: {fileID: 3892339027384508653} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3892339027384508654 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339027384508655} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3892339028978780123} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3892339027384508652 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339027384508655} + m_CullTransparentMesh: 0 +--- !u!114 &3892339027384508653 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339027384508655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.2783019, g: 0.50158674, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!1 &3892339028022738724 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3892339028022738723} + - component: {fileID: 3892339028022738735} + - component: {fileID: 3892339028022738720} + - component: {fileID: 3892339028022738721} + - component: {fileID: 3892339028022738722} + m_Layer: 5 + m_Name: EntryDisplayHolder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3892339028022738723 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339028022738724} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3892339028978780123} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0, y: 0.000015258789} + m_SizeDelta: {x: 600, y: 0} + m_Pivot: {x: 0, y: 1} +--- !u!222 &3892339028022738735 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339028022738724} + m_CullTransparentMesh: 0 +--- !u!114 &3892339028022738720 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339028022738724} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.2783019, g: 0.50158674, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &3892339028022738721 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339028022738724} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 +--- !u!114 &3892339028022738722 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339028022738724} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalFit: 0 + m_VerticalFit: 2 +--- !u!1 &3892339028774243865 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3892339028774243842} + - component: {fileID: 3892339028774243843} + - component: {fileID: 3892339028774243844} + - component: {fileID: 3892339028774243845} + - component: {fileID: 3892339028774243846} + - component: {fileID: 3892339028774243864} + m_Layer: 5 + m_Name: NarrativeLog + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3892339028774243842 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339028774243865} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 3892339028978780123} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &3892339028774243843 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339028774243865} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &3892339028774243844 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339028774243865} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &3892339028774243845 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339028774243865} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!225 &3892339028774243846 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339028774243865} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &3892339028774243864 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339028774243865} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fde579c9edfbe7e469349e39e2a87a48, type: 3} + m_Name: + m_EditorClassIdentifier: + entryDisplayPrefab: {fileID: 2879084013005042991, guid: 243a94cf6d8dda84f8351f4289587571, + type: 3} + entryHolder: {fileID: 3892339028022738723} +--- !u!1 &3892339028978780124 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3892339028978780123} + - component: {fileID: 3892339028978780103} + - component: {fileID: 3892339028978780120} + - component: {fileID: 3892339028978780121} + - component: {fileID: 3892339028978780122} + m_Layer: 5 + m_Name: MainWindow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3892339028978780123 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339028978780124} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 3892339027384508654} + - {fileID: 3892339028022738723} + m_Father: {fileID: 3892339028774243842} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 108.70001} + m_SizeDelta: {x: 600, y: 300} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3892339028978780103 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339028978780124} + m_CullTransparentMesh: 0 +--- !u!114 &3892339028978780120 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339028978780124} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.392} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &3892339028978780121 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339028978780124} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1aa08ab6e0800fa44ae55d278d1423e3, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Content: {fileID: 3892339028022738723} + m_Horizontal: 0 + m_Vertical: 1 + m_MovementType: 2 + m_Elasticity: 0.1 + m_Inertia: 1 + m_DecelerationRate: 0.135 + m_ScrollSensitivity: 1 + m_Viewport: {fileID: 0} + m_HorizontalScrollbar: {fileID: 0} + m_VerticalScrollbar: {fileID: 0} + m_HorizontalScrollbarVisibility: 0 + m_VerticalScrollbarVisibility: 0 + m_HorizontalScrollbarSpacing: 0 + m_VerticalScrollbarSpacing: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] +--- !u!114 &3892339028978780122 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3892339028978780124} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 1 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/NarrativeLog.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/NarrativeLog.prefab.meta new file mode 100644 index 0000000..d675b9f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/NarrativeLog.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bffd475e4bfb82f49810ceafe8d17b78 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/NarrativeLogEntryDisplay.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/NarrativeLogEntryDisplay.prefab new file mode 100644 index 0000000..6f602b6 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/NarrativeLogEntryDisplay.prefab @@ -0,0 +1,269 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2333275596563789949 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8885489252217067950} + - component: {fileID: 7933068750079926288} + - component: {fileID: 4379489694222926579} + m_Layer: 5 + m_Name: NameText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8885489252217067950 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2333275596563789949} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2481548615123137394} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &7933068750079926288 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2333275596563789949} + m_CullTransparentMesh: 0 +--- !u!114 &4379489694222926579 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2333275596563789949} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 64bd3e45f7a714f16b3c213f55f17fea, type: 3} + m_FontSize: 18 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Name +--- !u!1 &3511986559566215052 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3365827255933976305} + - component: {fileID: 3857872114285753493} + - component: {fileID: 19882628764411882} + m_Layer: 5 + m_Name: StoryText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3365827255933976305 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3511986559566215052} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2481548615123137394} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3857872114285753493 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3511986559566215052} + m_CullTransparentMesh: 0 +--- !u!114 &19882628764411882 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3511986559566215052} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 64bd3e45f7a714f16b3c213f55f17fea, type: 3} + m_FontSize: 22 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: New Text +--- !u!1 &9061313995661533662 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2481548615123137394} + - component: {fileID: 3382758035194104851} + - component: {fileID: 819304301769093009} + - component: {fileID: 5508376540251964814} + - component: {fileID: 2879084013005042991} + m_Layer: 5 + m_Name: NarrativeLogEntryDisplay + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2481548615123137394 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9061313995661533662} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 8885489252217067950} + - {fileID: 3365827255933976305} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 278} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3382758035194104851 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9061313995661533662} + m_CullTransparentMesh: 0 +--- !u!114 &819304301769093009 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9061313995661533662} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!114 &5508376540251964814 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9061313995661533662} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 10 + m_Right: 10 + m_Top: 10 + m_Bottom: 10 + m_ChildAlignment: 0 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 +--- !u!114 &2879084013005042991 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9061313995661533662} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 824b58b7741a0dd4e9b43693c47b24f7, type: 3} + m_Name: + m_EditorClassIdentifier: + nameTextField: {fileID: 4379489694222926579} + storyTextField: {fileID: 19882628764411882} diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/NarrativeLogEntryDisplay.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/NarrativeLogEntryDisplay.prefab.meta new file mode 100644 index 0000000..cad28ab --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/NarrativeLogEntryDisplay.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 243a94cf6d8dda84f8351f4289587571 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/ParallaxSprite.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/ParallaxSprite.prefab new file mode 100644 index 0000000..80469ba --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/ParallaxSprite.prefab @@ -0,0 +1,90 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &100000 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 400000} + - 212: {fileID: 21200000} + - 114: {fileID: 11400000} + m_Layer: 0 + m_Name: ParallaxSprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &400000 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3afab7986c14e4b7cbd982245a28b9a5, type: 3} + m_Name: + m_EditorClassIdentifier: + backgroundSprite: {fileID: 0} + parallaxScale: {x: 0.25, y: 0} + accelerometerScale: 0.5 +--- !u!212 &21200000 +SpriteRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 1 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 1 + m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 100000} + m_IsPrefabParent: 1 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/ParallaxSprite.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/ParallaxSprite.prefab.meta new file mode 100644 index 0000000..ad410e4 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/ParallaxSprite.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: fbafb8431307c42c9b1bfb9b27f6bd98 +NativeFormatImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/SaveData.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/SaveData.prefab new file mode 100644 index 0000000..f80bbcb --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/SaveData.prefab @@ -0,0 +1,54 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1310974650352510} + m_IsPrefabParent: 1 +--- !u!1 &1310974650352510 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4704521519618994} + - component: {fileID: 114272980009688704} + m_Layer: 0 + m_Name: SaveData + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4704521519618994 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1310974650352510} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1079.5829, y: 593.8655, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &114272980009688704 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1310974650352510} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 60d92858185944732937980806717234, type: 3} + m_Name: + m_EditorClassIdentifier: + flowcharts: [] diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/SaveData.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/SaveData.prefab.meta new file mode 100644 index 0000000..4ae1a80 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/SaveData.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eae76c041b933476bbe9bdd4c3d80793 +timeCreated: 1483972230 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/SaveMenu.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/SaveMenu.prefab new file mode 100644 index 0000000..0e43163 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/SaveMenu.prefab @@ -0,0 +1,3244 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1000012899462148} + m_IsPrefabParent: 1 +--- !u!1 &1000010010131774 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012272122410} + - component: {fileID: 222000011100116716} + - component: {fileID: 114000010632254224} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010142133612 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000013492386186} + - component: {fileID: 222000013799985356} + - component: {fileID: 114000010080207576} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011114926160 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000013898185038} + - component: {fileID: 222000010789171018} + - component: {fileID: 114000013665828214} + - component: {fileID: 114000011771453486} + m_Layer: 5 + m_Name: LoadButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011815857470 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012687811630} + - component: {fileID: 222000010636408894} + - component: {fileID: 114000014272909388} + - component: {fileID: 114000012958020502} + m_Layer: 5 + m_Name: RestartButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012178065012 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012150207008} + - component: {fileID: 222000013070489478} + - component: {fileID: 114000011397682902} + - component: {fileID: 114000010610974372} + m_Layer: 5 + m_Name: SaveButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012899462148 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011191842766} + - component: {fileID: 114000010566872590} + - component: {fileID: 114232099891880756} + - component: {fileID: 223000014176703286} + - component: {fileID: 114000011070993724} + - component: {fileID: 114000011308786264} + - component: {fileID: 82000012749735044} + - component: {fileID: 114653612942904624} + m_Layer: 5 + m_Name: SaveMenu + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013007313816 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012525218478} + - component: {fileID: 222000010752835546} + - component: {fileID: 114000013144661380} + - component: {fileID: 114000013850039374} + - component: {fileID: 225000012423540070} + m_Layer: 5 + m_Name: Panel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013032760896 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000013719675004} + - component: {fileID: 222000011515314216} + - component: {fileID: 114000010615359398} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013089762296 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012590701094} + - component: {fileID: 222000012009353026} + - component: {fileID: 114000013129043042} + - component: {fileID: 114000013791261618} + m_Layer: 5 + m_Name: RewindButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013166397642 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000013748593462} + - component: {fileID: 222000010966400006} + - component: {fileID: 114000012438047488} + - component: {fileID: 114000012074514418} + - component: {fileID: 114000010366395696} + m_Layer: 5 + m_Name: MenuButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013328246242 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000013149320576} + - component: {fileID: 222000011280725060} + - component: {fileID: 114000011862434686} + - component: {fileID: 114000014122010370} + m_Layer: 5 + m_Name: FastForwardButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1016451151234458 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224054090195745834} + m_Layer: 5 + m_Name: Sliding Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1017909244067428 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224756314496247326} + - component: {fileID: 222346054301214274} + - component: {fileID: 114625242687138120} + - component: {fileID: 114305052877464294} + m_Layer: 5 + m_Name: Scrollbar Horizontal + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1064076235247030 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224656606278108370} + - component: {fileID: 222989954932444316} + - component: {fileID: 114511501333539900} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1088690678392472 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224865476632621786} + - component: {fileID: 114522020581970318} + - component: {fileID: 222356757625515164} + - component: {fileID: 114478888494047242} + - component: {fileID: 114283909382663090} + m_Layer: 5 + m_Name: DebugView + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1134525095276268 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224506178468526888} + m_Layer: 5 + m_Name: Sliding Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1142916231164870 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224160472953040096} + - component: {fileID: 222114849256167646} + - component: {fileID: 114632310104905278} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1171231265388170 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224258996373127644} + - component: {fileID: 222243915251368484} + - component: {fileID: 114119135089980988} + - component: {fileID: 114993625917992760} + m_Layer: 5 + m_Name: Scrollbar Vertical + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1210356177377382 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224353886759344458} + m_Layer: 5 + m_Name: Sliding Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1213721919401690 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224148166873360954} + - component: {fileID: 222706451263006018} + - component: {fileID: 114820767466158250} + - component: {fileID: 114795890241856860} + m_Layer: 5 + m_Name: Viewport + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1216016164557284 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224259322050551826} + - component: {fileID: 114302650921901322} + - component: {fileID: 222328673954104156} + - component: {fileID: 114044970116333216} + m_Layer: 5 + m_Name: Viewport + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1333170469647788 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224819725728513600} + - component: {fileID: 222271235964525112} + - component: {fileID: 114920314574492042} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1446634631688098 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224900434480553846} + - component: {fileID: 222213165252159728} + - component: {fileID: 114723389948375156} + - component: {fileID: 114881856777117484} + m_Layer: 5 + m_Name: Scrollbar Vertical + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1562890099353150 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224331103297166980} + - component: {fileID: 222091168920081386} + - component: {fileID: 114738251385494794} + m_Layer: 5 + m_Name: Content + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1563859998553076 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224670260353415052} + - component: {fileID: 114162492929892552} + - component: {fileID: 222849644082718540} + - component: {fileID: 114697660017191064} + - component: {fileID: 225545614455694522} + m_Layer: 5 + m_Name: NarrativeLogView + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1575375668969800 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224304764365683998} + - component: {fileID: 222516594292902920} + - component: {fileID: 114763048961342110} + - component: {fileID: 114193710787652350} + - component: {fileID: 114818094421102834} + - component: {fileID: 225210578159906698} + - component: {fileID: 114454498723883902} + m_Layer: 5 + m_Name: NarrativeLog + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1662928791296828 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224813276203911662} + - component: {fileID: 222583787261386450} + - component: {fileID: 114153843942322126} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1685645919552228 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224902324276391688} + m_Layer: 5 + m_Name: Sliding Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1791663633598476 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224673677253739666} + - component: {fileID: 222976103522131750} + - component: {fileID: 114278905042580584} + - component: {fileID: 114197002012117692} + m_Layer: 5 + m_Name: Scrollbar Horizontal + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1801582794521622 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224682822578024892} + - component: {fileID: 222456543252686318} + - component: {fileID: 114875751214506758} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1898064487847954 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224255369405830710} + - component: {fileID: 222529376750664854} + - component: {fileID: 114491427777887672} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1943371609894262 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224058802661620446} + - component: {fileID: 222870937324826524} + - component: {fileID: 114625077397298586} + - component: {fileID: 114741111563894306} + m_Layer: 5 + m_Name: Content + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1949168787226118 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224147037515329490} + - component: {fileID: 222905370124457276} + - component: {fileID: 114180359308419172} + - component: {fileID: 114153967484647106} + - component: {fileID: 114162572505854518} + m_Layer: 5 + m_Name: Buttons + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1997369251198830 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224880810258273170} + - component: {fileID: 222800070994067700} + - component: {fileID: 114056508902046002} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!82 &82000012749735044 +AudioSource: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012899462148} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 8300000, guid: 14a396b1562834718b2d52b9c4639264, type: 3} + m_PlayOnAwake: 0 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 1 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 2 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - serializedVersion: 2 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 2 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 2 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 2 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 +--- !u!114 &114000010080207576 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010142133612} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Load +--- !u!114 &114000010366395696 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013166397642} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &114000010566872590 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012899462148} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: abe25ebf9ddc8416ead6f30d4671fdbf, type: 3} + m_Name: + m_EditorClassIdentifier: + saveDataKey: save_data + loadOnStart: 0 + autoSave: 0 + restartDeletesSave: 1 + saveMenuGroup: {fileID: 225000012423540070} + saveMenuButton: {fileID: 114000012074514418} + saveButton: {fileID: 114000010610974372} + loadButton: {fileID: 114000011771453486} + rewindButton: {fileID: 114000013791261618} + forwardButton: {fileID: 114000014122010370} + restartButton: {fileID: 114000012958020502} + debugView: {fileID: 114522020581970318} +--- !u!114 &114000010610974372 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012178065012} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114000011397682902} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114000010566872590} + m_MethodName: Save + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000010615359398 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013032760896} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Restart +--- !u!114 &114000010632254224 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010010131774} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Save +--- !u!114 &114000011070993724 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012899462148} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &114000011308786264 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012899462148} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &114000011397682902 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012178065012} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 9bdedfa4650174106a3115624f193b99, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000011771453486 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011114926160} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114000013665828214} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114000010566872590} + m_MethodName: Load + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000011862434686 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013328246242} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 9bdedfa4650174106a3115624f193b99, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000012074514418 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013166397642} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114000012438047488} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114000010566872590} + m_MethodName: ToggleSaveMenu + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 114232099891880756} + m_MethodName: ToggleNarrativeLogView + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000012438047488 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013166397642} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 9bdedfa4650174106a3115624f193b99, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000012958020502 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011815857470} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114000014272909388} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114000010566872590} + m_MethodName: Restart + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000013129043042 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013089762296} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 9bdedfa4650174106a3115624f193b99, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000013144661380 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013007313816} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.392} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000013665828214 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011114926160} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 9bdedfa4650174106a3115624f193b99, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000013791261618 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013089762296} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114000013129043042} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114000010566872590} + m_MethodName: Rewind + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000013850039374 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013007313816} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -405508275, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 2 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 +--- !u!114 &114000014122010370 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013328246242} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114000011862434686} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114000010566872590} + m_MethodName: FastForward + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000014272909388 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011815857470} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 9bdedfa4650174106a3115624f193b99, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114044970116333216 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1216016164557284} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114056508902046002 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1997369251198830} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114119135089980988 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1171231265388170} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114153843942322126 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1662928791296828} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114153967484647106 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1949168787226118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -2095666955, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 1 + m_StartCorner: 1 + m_StartAxis: 0 + m_CellSize: {x: 35, y: 30} + m_Spacing: {x: 2, y: 2} + m_Constraint: 0 + m_ConstraintCount: 2 +--- !u!114 &114162492929892552 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1563859998553076} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1367256648, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Content: {fileID: 224058802661620446} + m_Horizontal: 0 + m_Vertical: 1 + m_MovementType: 2 + m_Elasticity: 0.1 + m_Inertia: 1 + m_DecelerationRate: 0.135 + m_ScrollSensitivity: 8.39 + m_Viewport: {fileID: 224148166873360954} + m_HorizontalScrollbar: {fileID: 114197002012117692} + m_VerticalScrollbar: {fileID: 114881856777117484} + m_HorizontalScrollbarVisibility: 2 + m_VerticalScrollbarVisibility: 2 + m_HorizontalScrollbarSpacing: -3 + m_VerticalScrollbarSpacing: -3 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.ScrollRect+ScrollRectEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114162572505854518 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1949168787226118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &114180359308419172 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1949168787226118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114193710787652350 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1575375668969800} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 1 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &114197002012117692 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1791663633598476} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -2061169968, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114056508902046002} + m_HandleRect: {fileID: 224880810258273170} + m_Direction: 0 + m_Value: 1 + m_Size: 1 + m_NumberOfSteps: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Scrollbar+ScrollEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114232099891880756 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012899462148} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76befdada4ed8754db75aeb0b0d42976, type: 3} + m_Name: + m_EditorClassIdentifier: + showLog: 1 + previousLines: 1 + narrativeLogView: {fileID: 114162492929892552} + narrativeLogMenuGroup: {fileID: 225210578159906698} +--- !u!114 &114278905042580584 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1791663633598476} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114283909382663090 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1088690678392472} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 1 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &114302650921901322 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1216016164557284} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1200242548, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 0 +--- !u!114 &114305052877464294 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1017909244067428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -2061169968, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114511501333539900} + m_HandleRect: {fileID: 224656606278108370} + m_Direction: 0 + m_Value: 0 + m_Size: 0.99999994 + m_NumberOfSteps: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Scrollbar+ScrollEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114454498723883902 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1575375668969800} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 15 + m_Right: 15 + m_Top: 3 + m_Bottom: 1 + m_ChildAlignment: 0 + m_Spacing: 1 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 +--- !u!114 &114478888494047242 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1088690678392472} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.392} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114491427777887672 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1898064487847954} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.9411765} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 62573ea76cbf34643bf28a259a6c901c, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114511501333539900 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1064076235247030} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114522020581970318 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1088690678392472} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1367256648, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Content: {fileID: 224331103297166980} + m_Horizontal: 1 + m_Vertical: 1 + m_MovementType: 1 + m_Elasticity: 0.1 + m_Inertia: 1 + m_DecelerationRate: 0.135 + m_ScrollSensitivity: 1 + m_Viewport: {fileID: 224259322050551826} + m_HorizontalScrollbar: {fileID: 114305052877464294} + m_VerticalScrollbar: {fileID: 114993625917992760} + m_HorizontalScrollbarVisibility: 2 + m_VerticalScrollbarVisibility: 2 + m_HorizontalScrollbarSpacing: -3 + m_VerticalScrollbarSpacing: -3 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.ScrollRect+ScrollRectEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114625077397298586 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1943371609894262} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: 'Lorem + + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor + incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud + exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute + irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia + deserunt mollit anim id est laborum. + + + Ipsum + + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor + incididunt ut labore et dolore magna aliqua. + + + Lorem + + Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat + non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + + + Ipsum + + Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat + non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.' +--- !u!114 &114625242687138120 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1017909244067428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114632310104905278 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1142916231164870} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114653612942904624 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012899462148} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -405508275, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 2 + m_Spacing: 2 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 +--- !u!114 &114697660017191064 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1563859998553076} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &114723389948375156 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1446634631688098} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114738251385494794 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1562890099353150} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: +--- !u!114 &114741111563894306 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1943371609894262} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1741964061, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalFit: 0 + m_VerticalFit: 2 +--- !u!114 &114763048961342110 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1575375668969800} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.392} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114795890241856860 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1213721919401690} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &114818094421102834 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1575375668969800} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 1 +--- !u!114 &114820767466158250 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1213721919401690} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -146154839, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &114875751214506758 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1801582794521622} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.9411765} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 62573ea76cbf34643bf28a259a6c901c, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114881856777117484 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1446634631688098} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -2061169968, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 2 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114153843942322126} + m_HandleRect: {fileID: 224813276203911662} + m_Direction: 2 + m_Value: 1 + m_Size: 0.67653704 + m_NumberOfSteps: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Scrollbar+ScrollEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114920314574492042 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1333170469647788} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.778} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 240416d45df4c6c4daec987220246861, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114993625917992760 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1171231265388170} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -2061169968, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114632310104905278} + m_HandleRect: {fileID: 224160472953040096} + m_Direction: 2 + m_Value: 1 + m_Size: 1 + m_NumberOfSteps: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Scrollbar+ScrollEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!222 &222000010636408894 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011815857470} +--- !u!222 &222000010752835546 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013007313816} +--- !u!222 &222000010789171018 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011114926160} +--- !u!222 &222000010966400006 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013166397642} +--- !u!222 &222000011100116716 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010010131774} +--- !u!222 &222000011280725060 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013328246242} +--- !u!222 &222000011515314216 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013032760896} +--- !u!222 &222000012009353026 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013089762296} +--- !u!222 &222000013070489478 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012178065012} +--- !u!222 &222000013799985356 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010142133612} +--- !u!222 &222091168920081386 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1562890099353150} +--- !u!222 &222114849256167646 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1142916231164870} +--- !u!222 &222213165252159728 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1446634631688098} +--- !u!222 &222243915251368484 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1171231265388170} +--- !u!222 &222271235964525112 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1333170469647788} +--- !u!222 &222328673954104156 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1216016164557284} +--- !u!222 &222346054301214274 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1017909244067428} +--- !u!222 &222356757625515164 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1088690678392472} +--- !u!222 &222456543252686318 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1801582794521622} +--- !u!222 &222516594292902920 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1575375668969800} +--- !u!222 &222529376750664854 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1898064487847954} +--- !u!222 &222583787261386450 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1662928791296828} +--- !u!222 &222706451263006018 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1213721919401690} +--- !u!222 &222800070994067700 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1997369251198830} +--- !u!222 &222849644082718540 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1563859998553076} +--- !u!222 &222870937324826524 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1943371609894262} +--- !u!222 &222905370124457276 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1949168787226118} +--- !u!222 &222976103522131750 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1791663633598476} +--- !u!222 &222989954932444316 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1064076235247030} +--- !u!223 &223000014176703286 +Canvas: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012899462148} + m_Enabled: 1 + serializedVersion: 2 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &224000011191842766 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012899462148} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000012525218478} + - {fileID: 224304764365683998} + - {fileID: 224147037515329490} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!224 &224000012150207008 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012178065012} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224000012272122410} + m_Father: {fileID: 224000012525218478} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012272122410 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010010131774} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000012150207008} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012525218478 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013007313816} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224000012150207008} + - {fileID: 224000013898185038} + - {fileID: 224000012687811630} + - {fileID: 224000012590701094} + - {fileID: 224000013149320576} + - {fileID: 224865476632621786} + m_Father: {fileID: 224000011191842766} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 302, y: 30} + m_Pivot: {x: 1, y: 1} +--- !u!224 &224000012590701094 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013089762296} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224255369405830710} + m_Father: {fileID: 224000012525218478} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012687811630 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011815857470} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224000013719675004} + m_Father: {fileID: 224000012525218478} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013149320576 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013328246242} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224682822578024892} + m_Father: {fileID: 224000012525218478} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013492386186 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010142133612} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000013898185038} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013719675004 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013032760896} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000012687811630} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013748593462 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013166397642} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224819725728513600} + m_Father: {fileID: 224147037515329490} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 1, y: 1} +--- !u!224 &224000013898185038 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011114926160} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224000013492386186} + m_Father: {fileID: 224000012525218478} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224054090195745834 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1016451151234458} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224813276203911662} + m_Father: {fileID: 224900434480553846} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: -20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224058802661620446 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1943371609894262} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224148166873360954} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0.000030518, y: 0} + m_SizeDelta: {x: -14.299988, y: 0} + m_Pivot: {x: 0, y: 1} +--- !u!224 &224147037515329490 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1949168787226118} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224000013748593462} + m_Father: {fileID: 224000011191842766} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 40, y: 215} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224148166873360954 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1213721919401690} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224058802661620446} + m_Father: {fileID: 224670260353415052} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 1} +--- !u!224 &224160472953040096 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1142916231164870} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224506178468526888} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224255369405830710 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1898064487847954} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000012590701094} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -0.000025272, y: 0.000025272} + m_SizeDelta: {x: 21, y: 21} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224258996373127644 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1171231265388170} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224506178468526888} + m_Father: {fileID: 224865476632621786} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: -17} + m_Pivot: {x: 1, y: 1} +--- !u!224 &224259322050551826 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1216016164557284} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224331103297166980} + m_Father: {fileID: 224865476632621786} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -17, y: -17} + m_Pivot: {x: 0, y: 1} +--- !u!224 &224304764365683998 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1575375668969800} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.9999986, y: 0.9999986, z: 0.9999986} + m_Children: + - {fileID: 224670260353415052} + m_Father: {fileID: 224000011191842766} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 687.5, y: -194.99997} + m_SizeDelta: {x: 391, y: 330} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224331103297166980 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1562890099353150} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224259322050551826} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -0.000030517578} + m_SizeDelta: {x: 0, y: 300} + m_Pivot: {x: 0, y: 1} +--- !u!224 &224353886759344458 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1210356177377382} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224656606278108370} + m_Father: {fileID: 224756314496247326} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: -20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224506178468526888 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1134525095276268} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224160472953040096} + m_Father: {fileID: 224258996373127644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: -20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224656606278108370 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1064076235247030} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224353886759344458} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0.99999994, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224670260353415052 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1563859998553076} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224148166873360954} + - {fileID: 224673677253739666} + - {fileID: 224900434480553846} + m_Father: {fileID: 224304764365683998} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 376, y: 325} + m_Pivot: {x: 0.1, y: 0.1} +--- !u!224 &224673677253739666 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1791663633598476} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224902324276391688} + m_Father: {fileID: 224670260353415052} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0, y: -329.51} + m_SizeDelta: {x: 0, y: 20} + m_Pivot: {x: 0, y: 0} +--- !u!224 &224682822578024892 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1801582794521622} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: -1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000013149320576} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0.0000076294, y: 0} + m_SizeDelta: {x: 21, y: 21} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224756314496247326 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1017909244067428} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224353886759344458} + m_Father: {fileID: 224865476632621786} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -17, y: 20} + m_Pivot: {x: 0, y: 0} +--- !u!224 &224813276203911662 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1662928791296828} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224054090195745834} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224819725728513600 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1333170469647788} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000013748593462} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0.0000046492, y: 0.0000046492} + m_SizeDelta: {x: 22.5, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224865476632621786 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1088690678392472} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224259322050551826} + - {fileID: 224756314496247326} + - {fileID: 224258996373127644} + m_Father: {fileID: 224000012525218478} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -186.18002, y: -212.91998} + m_SizeDelta: {x: 427, y: 366} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224880810258273170 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1997369251198830} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224902324276391688} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224900434480553846 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1446634631688098} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224054090195745834} + m_Father: {fileID: 224670260353415052} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 0} + m_Pivot: {x: 1, y: 1} +--- !u!224 &224902324276391688 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1685645919552228} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224880810258273170} + m_Father: {fileID: 224673677253739666} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: -20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!225 &225000012423540070 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013007313816} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!225 &225210578159906698 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1575375668969800} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!225 &225545614455694522 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1563859998553076} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/SaveMenu.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/SaveMenu.prefab.meta new file mode 100644 index 0000000..c00c253 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/SaveMenu.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bd2b99773f3e0489aae9f9b5053ad360 +timeCreated: 1481298777 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/SayDialog.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/SayDialog.prefab new file mode 100644 index 0000000..ac761bf --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/SayDialog.prefab @@ -0,0 +1,835 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &148914 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22448914} + - 222: {fileID: 22248914} + - 114: {fileID: 11448914} + - 114: {fileID: 11439142} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &155030 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22443574} + - 222: {fileID: 22257884} + - 114: {fileID: 11431470} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &180152 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22433354} + - 222: {fileID: 22268826} + - 114: {fileID: 11493918} + - 114: {fileID: 11419088} + m_Layer: 5 + m_Name: Continue + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &188894 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22488896} + - 222: {fileID: 22288894} + - 114: {fileID: 11488896} + - 114: {fileID: 11439138} + m_Layer: 5 + m_Name: StoryText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &188898 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22488894} + - 222: {fileID: 22288898} + - 114: {fileID: 11488900} + m_Layer: 5 + m_Name: NameText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &188900 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22488900} + - 222: {fileID: 22288900} + - 114: {fileID: 11488904} + - 225: {fileID: 22583964} + - 114: {fileID: 11478524} + m_Layer: 5 + m_Name: Panel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &188902 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22488902} + - 223: {fileID: 22388894} + - 114: {fileID: 11488906} + - 225: {fileID: 22588896} + - 114: {fileID: 11486804} + - 114: {fileID: 11488894} + - 114: {fileID: 11487070} + - 114: {fileID: 11404316} + - 114: {fileID: 11481894} + - 82: {fileID: 8294266} + m_Layer: 5 + m_Name: SayDialog + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!82 &8294266 +AudioSource: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188902} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 0 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 +--- !u!114 &11404316 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188902} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c4782cf42f2644447b9631f6e522160b, type: 3} + m_Name: + m_EditorClassIdentifier: + volume: 1 + loop: 1 + targetAudioSource: {fileID: 0} + audioMode: 0 + beepSounds: + - {fileID: 8300000, guid: 774486030b696474e8b3cf7f178123da, type: 3} + - {fileID: 8300000, guid: f637c5ce9d10e45c7855ed89bfc6b97e, type: 3} + - {fileID: 8300000, guid: c53b7c20372e444c6bd7f2ac0729bbe2, type: 3} + soundEffect: {fileID: 0} + inputSound: {fileID: 8300000, guid: 14a396b1562834718b2d52b9c4639264, type: 3} +--- !u!114 &11419088 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 180152} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 11493918} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 11481894} + m_MethodName: SetButtonClickedFlag + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &11431470 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 155030} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: +--- !u!114 &11439138 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188894} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: 1150 + m_PreferredHeight: 200 + m_FlexibleWidth: 1 + m_FlexibleHeight: -1 +--- !u!114 &11439142 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 148914} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: 350 + m_PreferredHeight: 350 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!114 &11448914 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 148914} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &11478524 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188900} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1862395651, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Delegates: + - eventID: 4 + callback: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 11481894} + m_MethodName: SetDialogClickedFlag + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.EventSystems.EventTrigger+TriggerEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + delegates: [] +--- !u!114 &11481894 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188902} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 43b85556abd314f3f870c18c013fdcef, type: 3} + m_Name: + m_EditorClassIdentifier: + clickMode: 1 + nextClickDelay: 0 + cancelEnabled: 1 + ignoreMenuClicks: 1 +--- !u!114 &11486804 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188902} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &11487070 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188902} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a676940fce6344af1a70043b089a6c14, type: 3} + m_Name: + m_EditorClassIdentifier: + targetTextObject: {fileID: 188894} + punchObject: {fileID: 188900} + writingSpeed: 60 + punctuationPause: 0.25 + hiddenTextColor: {r: 1, g: 1, b: 1, a: 0} + writeWholeWords: 0 + forceRichText: 1 + instantComplete: 1 +--- !u!114 &11488894 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188902} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3a0bbe22c246e4c78ad8e9816cbae9d5, type: 3} + m_Name: + m_EditorClassIdentifier: + fadeDuration: 0.25 + continueButton: {fileID: 11419088} + dialogCanvas: {fileID: 22388894} + nameText: {fileID: 11488900} + storyText: {fileID: 11488896} + characterImage: {fileID: 11448914} + fitTextWithImage: 1 +--- !u!114 &11488896 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188894} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 79197ecfbc3a4294a89ce589dac02cf2, type: 3} + m_FontSize: 45 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 4 + m_MaxSize: 50 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Story text +--- !u!114 &11488900 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188898} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25882354, g: 0.25490198, b: 0.2627451, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3} + m_FontSize: 50 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 50 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Character Name +--- !u!114 &11488904 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188900} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: e8ab00ef0d9684dcb9deb52811d91218, type: 3} + m_Type: 1 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 0 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &11488906 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188902} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 32 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1600, y: 1200} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 1 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &11493918 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 180152} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 226248ac6f184e448af731df91b91958, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &22248914 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 148914} +--- !u!222 &22257884 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 155030} +--- !u!222 &22268826 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 180152} +--- !u!222 &22288894 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188894} +--- !u!222 &22288898 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188898} +--- !u!222 &22288900 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188900} +--- !u!223 &22388894 +Canvas: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188902} + m_Enabled: 1 + serializedVersion: 2 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 1 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_SortingLayerID: 0 + m_SortingOrder: 1 + m_TargetDisplay: 0 +--- !u!224 &22433354 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 180152} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 22443574} + m_Father: {fileID: 22488896} + m_RootOrder: 0 + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: -38.900024, y: 38.074993} + m_SizeDelta: {x: 77.900024, y: 77} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22443574 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 155030} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 22433354} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22448914 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 148914} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 22488900} + m_RootOrder: 1 + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: -178.5, y: 263.13} + m_SizeDelta: {x: 357, y: 435} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22488894 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188898} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 22488900} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 586.5, y: -38.369995} + m_SizeDelta: {x: 1106, y: 71} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22488896 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188894} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 22433354} + m_Father: {fileID: 22488900} + m_RootOrder: 2 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0.78700006} + m_AnchoredPosition: {x: 3, y: 14.130005} + m_SizeDelta: {x: -61, y: -63} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &22488900 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188900} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 22488894} + - {fileID: 22448914} + - {fileID: 22488896} + m_Father: {fileID: 22488902} + m_RootOrder: 0 + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: -750.0001, y: 0} + m_SizeDelta: {x: 1500, y: 335} + m_Pivot: {x: 0, y: 0} +--- !u!224 &22488902 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188902} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 22488900} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!225 &22583964 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188900} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!225 &22588896 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 188902} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 188902} + m_IsPrefabParent: 1 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/SayDialog.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/SayDialog.prefab.meta new file mode 100644 index 0000000..0305b76 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/SayDialog.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 8a005a9e0713f4cc1b5ad29fb07657d3 +NativeFormatImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/Stage.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Stage.prefab new file mode 100644 index 0000000..9b66d21 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Stage.prefab @@ -0,0 +1,516 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &110270 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22410270} + - 222: {fileID: 22210270} + - 114: {fileID: 11410270} + m_Layer: 0 + m_Name: Right + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &110272 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22410272} + - 222: {fileID: 22210272} + - 114: {fileID: 11410272} + m_Layer: 0 + m_Name: Offscreen Left + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &110274 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 410270} + - 114: {fileID: 11410274} + m_Layer: 0 + m_Name: Stage + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &110276 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22410274} + - 223: {fileID: 22310270} + - 114: {fileID: 11410278} + - 114: {fileID: 11410276} + - 225: {fileID: 22510270} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &110278 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22410276} + - 222: {fileID: 22210274} + - 114: {fileID: 11410280} + m_Layer: 0 + m_Name: Middle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &110280 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22410278} + - 222: {fileID: 22210276} + - 114: {fileID: 11410282} + m_Layer: 0 + m_Name: Offscreen Right + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &110282 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22410280} + - 222: {fileID: 22210278} + - 114: {fileID: 11410284} + m_Layer: 0 + m_Name: Left + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &410270 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110274} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 22410274} + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11410270 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110270} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &11410272 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110272} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &11410274 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110274} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6f6478b25a400c642b2dee75f022ab12, type: 3} + m_Name: + m_EditorClassIdentifier: + portraitCanvas: {fileID: 22310270} + dimPortraits: 1 + fadeDuration: 0.75 + moveDuration: 1 + fadeEaseType: 4 + shiftOffset: {x: 0, y: 0} + defaultPosition: {fileID: 11410280} + positions: + - {fileID: 22410280} + - {fileID: 22410276} + - {fileID: 22410270} + - {fileID: 22410272} + - {fileID: 22410278} +--- !u!114 &11410276 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110276} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1600, y: 1200} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 1 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &11410278 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110276} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &11410280 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110278} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &11410282 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110280} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &11410284 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110282} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &22210270 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110270} +--- !u!222 &22210272 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110272} +--- !u!222 &22210274 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110278} +--- !u!222 &22210276 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110280} +--- !u!222 &22210278 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110282} +--- !u!223 &22310270 +Canvas: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110276} + m_Enabled: 1 + serializedVersion: 2 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 1 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &22410270 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110270} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 22410274} + m_RootOrder: 2 + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 460.43, y: -1000} + m_SizeDelta: {x: 1000, y: 1000} + m_Pivot: {x: 0.5, y: 0} +--- !u!224 &22410272 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110272} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 22410274} + m_RootOrder: 3 + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: -1300, y: -1000} + m_SizeDelta: {x: 1000, y: 1000} + m_Pivot: {x: 0.5, y: 0} +--- !u!224 &22410274 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110276} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 22410276} + - {fileID: 22410280} + - {fileID: 22410270} + - {fileID: 22410272} + - {fileID: 22410278} + m_Father: {fileID: 410270} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!224 &22410276 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110278} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 22410274} + m_RootOrder: 0 + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: -1000} + m_SizeDelta: {x: 1000, y: 1000} + m_Pivot: {x: 0.5, y: 0} +--- !u!224 &22410278 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110280} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 22410274} + m_RootOrder: 4 + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 1300, y: -1000} + m_SizeDelta: {x: 1000, y: 1000} + m_Pivot: {x: 0.5, y: 0} +--- !u!224 &22410280 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110282} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 22410274} + m_RootOrder: 1 + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: -460.43, y: -1000} + m_SizeDelta: {x: 1000, y: 1000} + m_Pivot: {x: 0.5, y: 0} +--- !u!225 &22510270 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 110276} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 0 + m_IgnoreParentGroups: 0 +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 110274} + m_IsPrefabParent: 1 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/Stage.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Stage.prefab.meta new file mode 100644 index 0000000..91a40ab --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Stage.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: c6289d5f8fa843145a2355af9cb09719 +NativeFormatImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/StagePosition.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/StagePosition.prefab new file mode 100644 index 0000000..c8cf179 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/StagePosition.prefab @@ -0,0 +1,81 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &195640 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 22495640} + - 222: {fileID: 22295640} + - 114: {fileID: 11495640} + m_Layer: 0 + m_Name: StagePosition + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &11495640 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 195640} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &22295640 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 195640} +--- !u!224 &22495640 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 195640} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 2.3166022, y: 2.3166022, z: 2.3166022} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: -590.7334, y: 483.45358} + m_SizeDelta: {x: 1000, y: 1000} + m_Pivot: {x: 0.5, y: 0} +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 195640} + m_IsPrefabParent: 1 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/StagePosition.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/StagePosition.prefab.meta new file mode 100644 index 0000000..972aa52 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/StagePosition.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 7a4c270a5c18f6549a7683844dbf9f22 +NativeFormatImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/Tag.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Tag.prefab new file mode 100644 index 0000000..21e8fd3 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Tag.prefab @@ -0,0 +1,57 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &177196 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 477196} + - 114: {fileID: 11477196} + m_Layer: 0 + m_Name: Tag + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &477196 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 177196} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11477196 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 177196} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 335e04fbdd5260043abb299a991dcbe8, type: 3} + m_Name: + m_EditorClassIdentifier: + tagStartSymbol: '{customName}' + tagEndSymbol: '{/customName}' + replaceTagStartWith: '{color=blue}' + replaceTagEndWith: '{/color}' +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 177196} + m_IsPrefabParent: 1 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/Tag.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Tag.prefab.meta new file mode 100644 index 0000000..74bb9cb --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/Tag.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 8345c33c7c8ada64083f41d452b315eb +NativeFormatImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/View.prefab b/Fungus Basics/Assets/Fungus/Resources/Prefabs/View.prefab new file mode 100644 index 0000000..d4f6a3b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/View.prefab @@ -0,0 +1,56 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &100000 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 400000} + - 114: {fileID: 11400000} + m_Layer: 0 + m_Name: View + m_TagString: Untagged + m_Icon: {fileID: 5721338939258241955, guid: 0000000000000000d000000000000000, type: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &400000 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 95c387d3e32404bcc91c60318d766bb1, type: 3} + m_Name: + m_EditorClassIdentifier: + viewSize: 1 + primaryAspectRatio: {x: 4, y: 3} + secondaryAspectRatio: {x: 2, y: 1} +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 100000} + m_IsPrefabParent: 1 diff --git a/Fungus Basics/Assets/Fungus/Resources/Prefabs/View.prefab.meta b/Fungus Basics/Assets/Fungus/Resources/Prefabs/View.prefab.meta new file mode 100644 index 0000000..3bef407 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Prefabs/View.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: e0d427add844a4d9faf970a3afa07583 +NativeFormatImporter: + userData: diff --git a/Fungus Basics/Assets/Fungus/Resources/Sprites.meta b/Fungus Basics/Assets/Fungus/Resources/Sprites.meta new file mode 100644 index 0000000..14ca07e --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Sprites.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 32f062c580ee140fdb01e9a7354fd1dc +folderAsset: yes +timeCreated: 1473780777 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Resources/Sprites/Background.png b/Fungus Basics/Assets/Fungus/Resources/Sprites/Background.png new file mode 100644 index 0000000..fe1f199 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/Resources/Sprites/Background.png differ diff --git a/Fungus Basics/Assets/Fungus/Resources/Sprites/Background.png.meta b/Fungus Basics/Assets/Fungus/Resources/Sprites/Background.png.meta new file mode 100644 index 0000000..e5172ed --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Sprites/Background.png.meta @@ -0,0 +1,94 @@ +fileFormatVersion: 2 +guid: 78bc8db714c3749cc8bd8c0b7e525b85 +TextureImporter: + internalIDToNameTable: + - first: + 213: 21300000 + second: Background + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 1024 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 1024 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Resources/Sprites/HandPointer.png b/Fungus Basics/Assets/Fungus/Resources/Sprites/HandPointer.png new file mode 100644 index 0000000..7a8eeae Binary files /dev/null and b/Fungus Basics/Assets/Fungus/Resources/Sprites/HandPointer.png differ diff --git a/Fungus Basics/Assets/Fungus/Resources/Sprites/HandPointer.png.meta b/Fungus Basics/Assets/Fungus/Resources/Sprites/HandPointer.png.meta new file mode 100644 index 0000000..62349f4 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Sprites/HandPointer.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: 22eb050bacf8c401ca8503e24bff3570 +timeCreated: 1439303347 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 1 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 512 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 7 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Resources/Sprites/MousePointer.png b/Fungus Basics/Assets/Fungus/Resources/Sprites/MousePointer.png new file mode 100644 index 0000000..67f8052 Binary files /dev/null and b/Fungus Basics/Assets/Fungus/Resources/Sprites/MousePointer.png differ diff --git a/Fungus Basics/Assets/Fungus/Resources/Sprites/MousePointer.png.meta b/Fungus Basics/Assets/Fungus/Resources/Sprites/MousePointer.png.meta new file mode 100644 index 0000000..b5bca62 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Resources/Sprites/MousePointer.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: 502e0c9b755f34db0b90bf78857d8a1c +timeCreated: 1439303347 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 1 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 7 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts.meta b/Fungus Basics/Assets/Fungus/Scripts.meta new file mode 100644 index 0000000..1013c7c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: fa184a0dd8f1c46cbb12b7fcf9b1b06a +folderAsset: yes +timeCreated: 1473770354 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands.meta new file mode 100644 index 0000000..c2b6da9 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d957a50af081d49998801a81811881fe +folderAsset: yes +timeCreated: 1473770383 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/AssertCommand.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/AssertCommand.cs new file mode 100644 index 0000000..229c3db --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/AssertCommand.cs @@ -0,0 +1,70 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Assertions; + +namespace Fungus +{ + /// + /// Assert on 2 Fungus variable values. + /// + [CommandInfo("Scripting", + "Assert", + "Assert based on compared values.")] + [AddComponentMenu("")] + public class AssertCommand : Command + { + [SerializeField] + protected StringData message; + + [SerializeField] + [VariableProperty(AllVariableTypes.VariableAny.Any)] + protected Variable a, b; + + public enum Method + { + AreEqual, + AreNotEqual, + } + + [SerializeField] + protected Method method; + + public override void OnEnter() + { + switch (method) + { + case Method.AreEqual: + Assert.AreEqual(a.GetValue(), b.GetValue()); + break; + + case Method.AreNotEqual: + Assert.AreNotEqual(a.GetValue(), b.GetValue()); + break; + + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (a == null) + return "Error: No A variable"; + if (b == null) + return "Error: No B variable"; + + return a.Key + " " + method.ToString() + " " + b.Key; + } + + public override bool HasReference(Variable variable) + { + return variable == message.stringRef || + variable == a || variable == b || + base.HasReference(variable); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/AssertCommand.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/AssertCommand.cs.meta new file mode 100644 index 0000000..a16fc06 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/AssertCommand.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c40b126bd148ae743b56bc8c00162589 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Break.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Break.cs new file mode 100644 index 0000000..b1f3603 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Break.cs @@ -0,0 +1,53 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Force a loop to terminate immediately. + /// + [CommandInfo("Flow", + "Break", + "Force a loop to terminate immediately.")] + [AddComponentMenu("")] + public class Break : Command + { + #region Public members + + //located the containing loop and tell it to end + public override void OnEnter() + { + Condition loopingCond = null; + // Find index of previous looping command + for (int i = CommandIndex - 1; i >= 0; --i) + { + Condition cond = ParentBlock.CommandList[i] as Condition; + if (cond != null && cond.IsLooping) + { + loopingCond = cond; + break; + } + } + + if (loopingCond == null) + { + // No enclosing loop command found, just continue + Debug.LogError("Break called but found no enclosing looping construct." + GetLocationIdentifier()); + Continue(); + } + else + { + loopingCond.MoveToEnd(); + } + } + + public override Color GetButtonColor() + { + return new Color32(253, 253, 150, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Break.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Break.cs.meta new file mode 100644 index 0000000..0f24a0d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Break.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c9b9c7a9785c34fc889da2b3a40344db +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Call.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Call.cs new file mode 100644 index 0000000..12a5ff5 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Call.cs @@ -0,0 +1,166 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections.Generic; +using System; + +namespace Fungus +{ + /// + /// Supported modes for calling a block. + /// + public enum CallMode + { + /// Stop executing the current block after calling. + Stop, + /// Continue executing the current block after calling + Continue, + /// Wait until the called block finishes executing, then continue executing current block. + WaitUntilFinished, + /// Stop executing the current block before attempting to call. This allows for circular calls within the same frame + StopThenCall + } + + /// + /// Execute another block in the same Flowchart as the command, or in a different Flowchart. + /// + [CommandInfo("Flow", + "Call", + "Execute another block in the same Flowchart as the command, or in a different Flowchart.")] + [AddComponentMenu("")] + public class Call : Command, IBlockCaller + { + [Tooltip("Flowchart which contains the block to execute. If none is specified then the current Flowchart is used.")] + [SerializeField] protected Flowchart targetFlowchart; + + [FormerlySerializedAs("targetSequence")] + [Tooltip("Block to start executing")] + [SerializeField] protected Block targetBlock; + + [Tooltip("Label to start execution at. Takes priority over startIndex.")] + [SerializeField] protected StringData startLabel = new StringData(); + + [Tooltip("Command index to start executing")] + [FormerlySerializedAs("commandIndex")] + [SerializeField] protected int startIndex; + + [Tooltip("Select if the calling block should stop or continue executing commands, or wait until the called block finishes.")] + [SerializeField] protected CallMode callMode; + + #region Public members + + public override void OnEnter() + { + if (targetBlock != null) + { + // Check if calling your own parent block + if (ParentBlock != null && ParentBlock.Equals(targetBlock)) + { + // Just ignore the callmode in this case, and jump to first command in list + Continue(0); + return; + } + + if(targetBlock.IsExecuting()) + { + Debug.LogWarning(targetBlock.BlockName + " cannot be called/executed, it is already running."); + Continue(); + return; + } + + // Callback action for Wait Until Finished mode + Action onComplete = null; + if (callMode == CallMode.WaitUntilFinished) + { + onComplete = delegate { + Continue(); + }; + } + + // Find the command index to start execution at + int index = startIndex; + if (startLabel.Value != "") + { + int labelIndex = targetBlock.GetLabelIndex(startLabel.Value); + if (labelIndex != -1) + { + index = labelIndex; + } + } + + if (targetFlowchart == null || + targetFlowchart.Equals(GetFlowchart())) + { + if (callMode == CallMode.StopThenCall) + { + StopParentBlock(); + } + StartCoroutine(targetBlock.Execute(index, onComplete)); + } + else + { + if (callMode == CallMode.StopThenCall) + { + StopParentBlock(); + } + // Execute block in another Flowchart + targetFlowchart.ExecuteBlock(targetBlock, index, onComplete); + } + } + + if (callMode == CallMode.Stop) + { + StopParentBlock(); + } + else if (callMode == CallMode.Continue) + { + Continue(); + } + } + + public override void GetConnectedBlocks(ref List connectedBlocks) + { + if (targetBlock != null) + { + connectedBlocks.Add(targetBlock); + } + } + + public override string GetSummary() + { + string summary = ""; + + if (targetBlock == null) + { + summary = ""; + } + else + { + summary = targetBlock.BlockName; + } + + summary += " : " + callMode.ToString(); + + return summary; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + return startLabel.stringRef == variable || base.HasReference(variable); + } + + public bool MayCallBlock(Block block) + { + return block == targetBlock; + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Call.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Call.cs.meta new file mode 100644 index 0000000..21288ec --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Call.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 050fb9e6e72f442b3b883da8a965bdeb +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/CallMethod.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/CallMethod.cs new file mode 100644 index 0000000..107a143 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/CallMethod.cs @@ -0,0 +1,78 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Calls a named method on a GameObject using the GameObject.SendMessage() system. + /// This command is called "Call Method" because a) it's more descriptive than Send Message and we're already have + /// a Send Message command for sending messages to trigger block execution. + /// + [CommandInfo("Scripting", + "Call Method", + "Calls a named method on a GameObject using the GameObject.SendMessage() system.")] + [AddComponentMenu("")] + public class CallMethod : Command + { + [Tooltip("Target monobehavior which contains the method we want to call")] + [SerializeField] protected GameObject targetObject; + + [Tooltip("Name of the method to call")] + [SerializeField] protected string methodName = ""; + + [Tooltip("Delay (in seconds) before the method will be called")] + [SerializeField] protected float delay; + + protected virtual void CallTheMethod() + { + targetObject.SendMessage(methodName, SendMessageOptions.DontRequireReceiver); + } + + #region Public members + + public override void OnEnter() + { + if (targetObject == null || + methodName.Length == 0) + { + Continue(); + return; + } + + if (Mathf.Approximately(delay, 0f)) + { + CallTheMethod(); + } + else + { + Invoke("CallTheMethod", delay); + } + + Continue(); + } + + public override string GetSummary() + { + if (targetObject == null) + { + return "Error: No target GameObject specified"; + } + + if (methodName.Length == 0) + { + return "Error: No named method specified"; + } + + return targetObject.name + " : " + methodName; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/CallMethod.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/CallMethod.cs.meta new file mode 100644 index 0000000..9fcfbe2 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/CallMethod.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 17a200dbd67304446a3019434503338a +timeCreated: 1430927467 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ClearMenu.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ClearMenu.cs new file mode 100644 index 0000000..1c53c46 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ClearMenu.cs @@ -0,0 +1,45 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Clears the options from a menu dialogue. + /// + [CommandInfo("Narrative", + "Clear Menu", + "Clears the options from a menu dialogue")] + public class ClearMenu : Command + { + [Tooltip("Menu Dialog to clear the options on")] + [SerializeField] protected MenuDialog menuDialog; + + #region Public members + + public override void OnEnter() + { + menuDialog.Clear(); + + Continue(); + } + + public override string GetSummary() + { + if (menuDialog == null) + { + return "Error: No menu dialog object selected"; + } + + return menuDialog.name; + } + + public override Color GetButtonColor() + { + return new Color32(184, 210, 235, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ClearMenu.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ClearMenu.cs.meta new file mode 100644 index 0000000..e745bb2 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ClearMenu.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 430ab3c61eef444b2aec02aee7f809bf +timeCreated: 1445258294 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection.meta new file mode 100644 index 0000000..ee30b8f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7d7820abad934b747ae1797c3aa82197 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseCommand.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseCommand.cs new file mode 100644 index 0000000..4932255 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseCommand.cs @@ -0,0 +1,35 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Base class for all FungusCollection commands + /// + [AddComponentMenu("")] + public abstract class CollectionBaseCommand : Command + { + [SerializeField] + protected CollectionData collection; + + public override Color GetButtonColor() + { + return new Color32(191, 217, 235, 255); + } + + public override bool HasReference(Variable variable) + { + return variable == collection.collectionRef; + } + + public override string GetSummary() + { + if (collection.Value == null) + return "Error: no collection selected"; + + return collection.Value.name; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseCommand.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseCommand.cs.meta new file mode 100644 index 0000000..68f6899 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseCommand.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dab2b4efcfae62841b5070c4cfec8c4a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseIntCommand.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseIntCommand.cs new file mode 100644 index 0000000..b5f790a --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseIntCommand.cs @@ -0,0 +1,42 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Base class for all FungusCollection commands that use an intvar + /// + [AddComponentMenu("")] + public abstract class CollectionBaseIntCommand : CollectionBaseCommand + { + [SerializeField] + protected IntegerData integer; + + public override void OnEnter() + { + if (collection.Value != null) + { + OnEnterInner(); + } + + Continue(); + } + + protected abstract void OnEnterInner(); + + public override bool HasReference(Variable variable) + { + return variable == integer.integerRef || base.HasReference(variable); + } + + public override string GetSummary() + { + if (collection.Value == null) + return "Error: no collection selected"; + + return integer.Value.ToString() + " on " + collection.Value.name; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseIntCommand.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseIntCommand.cs.meta new file mode 100644 index 0000000..f9e3883 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseIntCommand.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 328b7e125f24d5349be4fe583267ba1d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseTwoCollectionCommand.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseTwoCollectionCommand.cs new file mode 100644 index 0000000..0183a54 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseTwoCollectionCommand.cs @@ -0,0 +1,50 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Base class for all FungusCollection commands that require a second collection of the same type + /// + [AddComponentMenu("")] + public abstract class CollectionBaseTwoCollectionCommand : CollectionBaseCommand + { + [SerializeField] + protected CollectionData rhsCollection; + + public override void OnEnter() + { + if (collection.Value != null && rhsCollection.Value != null) + { + OnEnterInner(); + } + + Continue(); + } + + protected abstract void OnEnterInner(); + + public override bool HasReference(Variable variable) + { + return variable == rhsCollection.collectionRef || base.HasReference(variable); + } + + public override string GetSummary() + { + if (collection.Value == null) + return "Error: no collection selected"; + + if (rhsCollection.Value == null) + return "Error: no variable selected"; + + if (collection.Value.ContainedType() != rhsCollection.Value.ContainedType()) + { + return "Error: Collection types do not match. " + collection.Value.ContainedType().Name + " != " + rhsCollection.Value.ContainedType().Name; + } + + return collection.Value.name + " , " + rhsCollection.Value.name; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseTwoCollectionCommand.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseTwoCollectionCommand.cs.meta new file mode 100644 index 0000000..593556c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseTwoCollectionCommand.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c4010b5577069fc4cb9480f87ed3f73e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseVarAndIntCommand.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseVarAndIntCommand.cs new file mode 100644 index 0000000..6744aaa --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseVarAndIntCommand.cs @@ -0,0 +1,47 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Base class for all FungusCollection commands that require a compatible variable and an integer + /// + [AddComponentMenu("")] + public abstract class CollectionBaseVarAndIntCommand : CollectionBaseVarCommand + { + [SerializeField] + [VariableProperty(typeof(IntegerVariable))] + protected IntegerVariable integer; + + public override void OnEnter() + { + if (collection.Value != null && variableToUse != null && integer != null) + { + OnEnterInner(); + } + + Continue(); + } + + public override bool HasReference(Variable variable) + { + return variable == integer || base.HasReference(variable); + } + + public override string GetSummary() + { + if (collection.Value == null) + return "Error: no collection selected"; + + if (variableToUse == null) + return "Error: no variable selected"; + + if (integer == null) + return "Error: no integer selected"; + + return integer.Key + " on " + variableToUse.Key + " in " + collection.Value.name; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseVarAndIntCommand.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseVarAndIntCommand.cs.meta new file mode 100644 index 0000000..2cb1e4c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseVarAndIntCommand.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 561b53abc515d704d8845caa3b3ee26f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseVarCommand.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseVarCommand.cs new file mode 100644 index 0000000..249e2d2 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseVarCommand.cs @@ -0,0 +1,54 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Base class for all FungusCollection commands that require a compatible variable type + /// + [AddComponentMenu("")] + public abstract class CollectionBaseVarCommand : CollectionBaseCommand, ICollectionCompatible + { + [SerializeField] + [VariableProperty(compatibleVariableName = "collection")] + protected Variable variableToUse; + + public override void OnEnter() + { + if (collection.Value != null && variableToUse != null) + { + OnEnterInner(); + } + + Continue(); + } + + protected abstract void OnEnterInner(); + + public override bool HasReference(Variable variable) + { + return variable == variableToUse || base.HasReference(variable); + } + + public override string GetSummary() + { + if (collection.Value == null) + return "Error: no collection selected"; + + if (variableToUse == null) + return "Error: no variable selected"; + + return variableToUse.Key + " to " + collection.Value.name; + } + + bool ICollectionCompatible.IsVarCompatibleWithCollection(Variable variable, string compatibleWith) + { + if (compatibleWith == "collection") + return collection.Value == null ? false : collection.Value.IsElementCompatible(variable); + else + return true; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseVarCommand.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseVarCommand.cs.meta new file mode 100644 index 0000000..ee8dd1b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionBaseVarCommand.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fe12b6eb87e59984cb4122f978f11e45 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandAdd.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandAdd.cs new file mode 100644 index 0000000..82c3b1c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandAdd.cs @@ -0,0 +1,39 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Add an item to a collection + /// + [CommandInfo("Collection", + "Add", + "Add an item to a collection")] + [AddComponentMenu("")] + public class CollectionCommandAdd : CollectionBaseVarCommand + { + [Tooltip("Only add if the item does not already exist in the collection")] + [SerializeField] + protected BooleanData onlyIfUnique = new BooleanData(false); + + protected override void OnEnterInner() + { + if (onlyIfUnique.Value) + collection.Value.AddUnique(variableToUse); + else + collection.Value.Add(variableToUse); + } + + public override bool HasReference(Variable variable) + { + return onlyIfUnique.booleanRef == variable || base.HasReference(variable); + } + + public override string GetSummary() + { + return base.GetSummary() + (onlyIfUnique.Value ? " Unique" : ""); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandAdd.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandAdd.cs.meta new file mode 100644 index 0000000..9b6b035 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandAdd.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a30a3b6902ecde54ea81d503f6a2b27e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandAddAll.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandAddAll.cs new file mode 100644 index 0000000..e31ae98 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandAddAll.cs @@ -0,0 +1,39 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Add all items in given rhs collection to target collection + /// + [CommandInfo("Collection", + "Add All", + "Add all items in given rhs collection to target collection")] + [AddComponentMenu("")] + public class CollectionCommandAddAll : CollectionBaseTwoCollectionCommand + { + [Tooltip("Only add if the item does not already exist in the collection")] + [SerializeField] + protected BooleanData onlyIfUnique = new BooleanData(false); + + protected override void OnEnterInner() + { + if (onlyIfUnique.Value) + collection.Value.AddUnique(rhsCollection); + else + collection.Value.Add(rhsCollection); + } + + public override bool HasReference(Variable variable) + { + return onlyIfUnique.booleanRef == variable || base.HasReference(variable); + } + + public override string GetSummary() + { + return base.GetSummary() + (onlyIfUnique.Value ? " Unique" : ""); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandAddAll.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandAddAll.cs.meta new file mode 100644 index 0000000..7f10b77 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandAddAll.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5688faa1580d8d147b59e18fcdd888ad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandClear.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandClear.cs new file mode 100644 index 0000000..19450f9 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandClear.cs @@ -0,0 +1,27 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Clears a target collection + /// + [CommandInfo("Collection", + "Clear", + "Clears a target collection")] + [AddComponentMenu("")] + public class CollectionCommandClear : CollectionBaseCommand + { + public override void OnEnter() + { + if (collection.Value != null) + { + collection.Value.Clear(); + } + + Continue(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandClear.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandClear.cs.meta new file mode 100644 index 0000000..70c94b5 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandClear.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8b071472a9dcdc7469059042e2e6e50d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContains.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContains.cs new file mode 100644 index 0000000..bcbd0bc --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContains.cs @@ -0,0 +1,37 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Does the collection contain the given variable + /// + [CommandInfo("Collection", + "Contains", + "Does the collection contain the given variable")] + [AddComponentMenu("")] + public class CollectionCommandContains : CollectionBaseVarCommand + { + [VariableProperty(typeof(BooleanVariable))] + [SerializeField] protected BooleanVariable result; + + protected override void OnEnterInner() + { + if (result == null) + { + Debug.LogWarning("No result var set"); + } + else + { + result.Value = collection.Value.Contains(variableToUse); + } + } + + public override bool HasReference(Variable variable) + { + return result == variable || base.HasReference(variable); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContains.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContains.cs.meta new file mode 100644 index 0000000..16c6438 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContains.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6bd67ee6ac8134b4e9aea26299040034 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContainsAll.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContainsAll.cs new file mode 100644 index 0000000..834795c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContainsAll.cs @@ -0,0 +1,53 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Does target collection, contain all rhs collection items + /// + [CommandInfo("Collection", + "Contains All Of", + "Does target collection, contain all rhs collection items")] + [AddComponentMenu("")] + public class CollectionCommandContainsAll : CollectionBaseTwoCollectionCommand + { + [Tooltip("Do they have to be in the same order?")] + [SerializeField] + protected BooleanData inSameOrder = new BooleanData(false); + + [VariableProperty(typeof(BooleanVariable))] + [SerializeField] protected BooleanVariable result; + + protected override void OnEnterInner() + { + if (result == null) + { + Debug.LogWarning("No result var set"); + } + else + { + if (inSameOrder.Value) + { + result.Value = collection.Value.ContainsAllOfOrdered(rhsCollection.Value); + } + else + { + result.Value = collection.Value.ContainsAllOf(rhsCollection.Value); + } + } + } + + public override bool HasReference(Variable variable) + { + return result == variable || inSameOrder.booleanRef == variable || base.HasReference(variable); + } + + public override string GetSummary() + { + return base.GetSummary() + (inSameOrder.Value ? " Ordered" : ""); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContainsAll.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContainsAll.cs.meta new file mode 100644 index 0000000..31913de --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContainsAll.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1df2de5cf986f9d419a124bb9d834b11 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContainsAny.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContainsAny.cs new file mode 100644 index 0000000..1450f16 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContainsAny.cs @@ -0,0 +1,37 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Does target collection, contain any of the items in the rhs collection items + /// + [CommandInfo("Collection", + "Contains Any Of", + "Does target collection, contain any of the items in the rhs collection items")] + [AddComponentMenu("")] + public class CollectionCommandContainsAny : CollectionBaseTwoCollectionCommand + { + [VariableProperty(typeof(BooleanVariable))] + [SerializeField] protected BooleanVariable result; + + protected override void OnEnterInner() + { + if (result == null) + { + Debug.LogWarning("No result var set"); + } + else + { + result.Value = collection.Value.ContainsAnyOf(rhsCollection.Value); + } + } + + public override bool HasReference(Variable variable) + { + return result == variable || base.HasReference(variable); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContainsAny.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContainsAny.cs.meta new file mode 100644 index 0000000..9522c29 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandContainsAny.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c4e05f36271510b41a7d7889025e180e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandCopy.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandCopy.cs new file mode 100644 index 0000000..09663e3 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandCopy.cs @@ -0,0 +1,22 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Clears target and then adds all of rhs to target. + /// + [CommandInfo("Collection", + "Copy", + "Clears target and then adds all of rhs to target.")] + [AddComponentMenu("")] + public class CollectionCommandCopy : CollectionBaseTwoCollectionCommand + { + protected override void OnEnterInner() + { + collection.Value.CopyFrom(rhsCollection.Value); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandCopy.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandCopy.cs.meta new file mode 100644 index 0000000..e0a122e --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandCopy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 820324be5b6a927469519df54a9bbad0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandCount.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandCount.cs new file mode 100644 index 0000000..81a4d22 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandCount.cs @@ -0,0 +1,25 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Number of items in the collection + /// + [CommandInfo("Collection", + "Count", + "Number of items in the collection")] + [CommandInfo("Collection", + "Length", + "Number of items in the collection")] + [AddComponentMenu("")] + public class CollectionCommandCount : CollectionBaseIntCommand + { + protected override void OnEnterInner() + { + integer.Value = collection.Value.Count; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandCount.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandCount.cs.meta new file mode 100644 index 0000000..d264f4a --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandCount.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31765259d3ac50e4993fd654cd7ea78b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandElement.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandElement.cs new file mode 100644 index 0000000..8183141 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandElement.cs @@ -0,0 +1,53 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Get or Set, an element in a collection + /// + [CommandInfo("Collection", + "Element", + "Get or Set, an element in a collection")] + [AddComponentMenu("")] + public class CollectionCommandElement : CollectionBaseVarCommand + { + public enum GetSet + { + Get, + Set, + } + + [SerializeField] + protected IntegerData index; + + [SerializeField] + protected GetSet getset = GetSet.Get; + + protected override void OnEnterInner() + { + if (index.Value >= 0 && index.Value < collection.Value.Count) + { + if (getset == GetSet.Get) + { + collection.Value.Get(index.Value, ref variableToUse); + } + else + { + collection.Value.Set(index.Value, variableToUse); + } + } + else + { + throw new System.ArgumentOutOfRangeException(); + } + } + + public override string GetSummary() + { + return base.GetSummary() + " " + getset.ToString(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandElement.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandElement.cs.meta new file mode 100644 index 0000000..d2b1137 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bf40659a274400d40856f146223798ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandExclusive.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandExclusive.cs new file mode 100644 index 0000000..dcc396b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandExclusive.cs @@ -0,0 +1,24 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Remove all items from collection that are also in RHS and add all the items in RHS that are not already + /// in target. Similar to a xor + /// + [CommandInfo("Collection", + "Exclusive", + "Remove all items from collection that are also in RHS and add all the items in RHS that are not already in target. " + + "Similar to a xor")] + [AddComponentMenu("")] + public class CollectionCommandExclusive : CollectionBaseTwoCollectionCommand + { + protected override void OnEnterInner() + { + collection.Value.Exclusive(rhsCollection.Value); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandExclusive.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandExclusive.cs.meta new file mode 100644 index 0000000..e4730cf --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandExclusive.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 824e24d12ca84774ea135507417e94a1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandFind.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandFind.cs new file mode 100644 index 0000000..b4927e6 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandFind.cs @@ -0,0 +1,41 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Find an item in a collection + /// + [CommandInfo("Collection", + "Find", + "Find an item in a collection")] + [CommandInfo("Collection", + "IndexOf", + "Find an item in a collection")] + [AddComponentMenu("")] + public class CollectionCommandFind : CollectionBaseVarAndIntCommand + { + [Tooltip("If true, will find the last occurance rather than first occurance.")] + [SerializeField] + protected BooleanData lastInsteadOfFirst = new BooleanData(false); + + protected override void OnEnterInner() + { + integer.Value = !lastInsteadOfFirst.Value ? + collection.Value.IndexOf(variableToUse) + : collection.Value.LastIndexOf(variableToUse); + } + + public override bool HasReference(Variable variable) + { + return lastInsteadOfFirst.booleanRef == variable || base.HasReference(variable); + } + + public override string GetSummary() + { + return base.GetSummary() + (lastInsteadOfFirst.Value ? " Last" : ""); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandFind.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandFind.cs.meta new file mode 100644 index 0000000..cc1ad6b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandFind.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 59afe81b26e37ea4ea10dd91dfeee937 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandInsert.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandInsert.cs new file mode 100644 index 0000000..9a4fe83 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandInsert.cs @@ -0,0 +1,22 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Add at a specific location in the collection + /// + [CommandInfo("Collection", + "Insert", + "Add at a specific location in the collection")] + [AddComponentMenu("")] + public class CollectionCommandInsert : CollectionBaseVarAndIntCommand + { + protected override void OnEnterInner() + { + collection.Value.Insert(integer.Value, variableToUse); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandInsert.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandInsert.cs.meta new file mode 100644 index 0000000..6623d38 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandInsert.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dd126ef47d8264a4d8a6aac5b4f3fb12 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandIntersection.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandIntersection.cs new file mode 100644 index 0000000..433560e --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandIntersection.cs @@ -0,0 +1,22 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Remove all items from collection that aren't also in RHS, similar to an overlap. + /// + [CommandInfo("Collection", + "Intersection", + "Remove all items from collection that aren't also in RHS, similar to an overlap.")] + [AddComponentMenu("")] + public class CollectionCommandIntersection : CollectionBaseTwoCollectionCommand + { + protected override void OnEnterInner() + { + collection.Value.Intersection(rhsCollection.Value); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandIntersection.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandIntersection.cs.meta new file mode 100644 index 0000000..6fefadb --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandIntersection.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 586c189d813b1b045ba358c612f4a6eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandOccurrences.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandOccurrences.cs new file mode 100644 index 0000000..da2034b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandOccurrences.cs @@ -0,0 +1,22 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// How many occurrences of a given variable exist in a target collection + /// + [CommandInfo("Collection", + "Occurrences", + "How many occurrences of a given variable exist in a target collection")] + [AddComponentMenu("")] + public class CollectionCommandOccurrences : CollectionBaseVarAndIntCommand + { + protected override void OnEnterInner() + { + integer.Value = collection.Value.Occurrences(variableToUse); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandOccurrences.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandOccurrences.cs.meta new file mode 100644 index 0000000..b1b5323 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandOccurrences.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 75a3711bc9cd44e429e15e10f6029fae +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemove.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemove.cs new file mode 100644 index 0000000..4850687 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemove.cs @@ -0,0 +1,39 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Remove an item to a collection + /// + [CommandInfo("Collection", + "Remove", + "Remove an item to a collection")] + [AddComponentMenu("")] + public class CollectionCommandRemove : CollectionBaseVarCommand + { + [Tooltip("Should it remove ALL occurances of variable")] + [SerializeField] + protected BooleanData allOccurances = new BooleanData(false); + + protected override void OnEnterInner() + { + if (allOccurances.Value) + collection.Value.RemoveAll(variableToUse); + else + collection.Value.Remove(variableToUse); + } + + public override bool HasReference(Variable variable) + { + return allOccurances.booleanRef == variable || base.HasReference(variable); + } + + public override string GetSummary() + { + return base.GetSummary() + (allOccurances.Value ? " ALL" : ""); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemove.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemove.cs.meta new file mode 100644 index 0000000..6eb7896 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemove.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6e2313a05ce56ea49bbf1922b58d793a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemoveAllOf.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemoveAllOf.cs new file mode 100644 index 0000000..729f8ee --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemoveAllOf.cs @@ -0,0 +1,22 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Remove all items in given rhs collection to target collection + /// + [CommandInfo("Collection", + "Remove All Of", + "Remove all items in given rhs collection to target collection")] + [AddComponentMenu("")] + public class CollectionCommandRemoveAllOf : CollectionBaseTwoCollectionCommand + { + protected override void OnEnterInner() + { + collection.Value.RemoveAll(rhsCollection); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemoveAllOf.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemoveAllOf.cs.meta new file mode 100644 index 0000000..ea63a58 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemoveAllOf.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2bb49f43c99a0af4db604a1770b31e83 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemoveAt.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemoveAt.cs new file mode 100644 index 0000000..2464277 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemoveAt.cs @@ -0,0 +1,22 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Remove item at given index + /// + [CommandInfo("Collection", + "Remove At", + "Remove item at given index")] + [AddComponentMenu("")] + public class CollectionCommandRemoveAt : CollectionBaseIntCommand + { + protected override void OnEnterInner() + { + collection.Value.RemoveAt(integer.Value); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemoveAt.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemoveAt.cs.meta new file mode 100644 index 0000000..d2f4ff5 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandRemoveAt.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c8ee8f64433f29a4f82b03a8e6550ae2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandReserve.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandReserve.cs new file mode 100644 index 0000000..71c287d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandReserve.cs @@ -0,0 +1,22 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Reserve space for given number of items in the collection + /// + [CommandInfo("Collection", + "Reserve", + "Reserve space for given number of items in the collection")] + [AddComponentMenu("")] + public class CollectionCommandReserve : CollectionBaseIntCommand + { + protected override void OnEnterInner() + { + collection.Value.Reserve(integer.Value); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandReserve.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandReserve.cs.meta new file mode 100644 index 0000000..8c44313 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandReserve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4672406760fa8f340aabac4528f04c1c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandResize.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandResize.cs new file mode 100644 index 0000000..108b37f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandResize.cs @@ -0,0 +1,22 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Resize will grow the collection to be the given size, will not remove items to shrink + /// + [CommandInfo("Collection", + "Resize", + "Resize will grow the collection to be the given size, will not remove items to shrink")] + [AddComponentMenu("")] + public class CollectionCommandResize : CollectionBaseIntCommand + { + protected override void OnEnterInner() + { + collection.Value.Resize(integer.Value); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandResize.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandResize.cs.meta new file mode 100644 index 0000000..413f91f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandResize.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3ce11d7cce59a3340937a8d112cd4ad5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandReverse.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandReverse.cs new file mode 100644 index 0000000..6a0623d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandReverse.cs @@ -0,0 +1,27 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Reverse the current order of a target collection + /// + [CommandInfo("Collection", + "Reverse", + "Reverse the current order of a target collection")] + [AddComponentMenu("")] + public class CollectionCommandReverse : CollectionBaseCommand + { + public override void OnEnter() + { + if (collection.Value != null) + { + collection.Value.Reverse(); + } + + Continue(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandReverse.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandReverse.cs.meta new file mode 100644 index 0000000..20b9f67 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandReverse.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d7359fcb744d14a41acae4b3a2e34b73 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandShuffle.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandShuffle.cs new file mode 100644 index 0000000..2874992 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandShuffle.cs @@ -0,0 +1,27 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Randomly reorders all elements of a target collection + /// + [CommandInfo("Collection", + "Shuffle", + "Randomly reorders all elements of a target collection")] + [AddComponentMenu("")] + public class CollectionCommandShuffle : CollectionBaseCommand + { + public override void OnEnter() + { + if (collection.Value != null) + { + collection.Value.Shuffle(); + } + + Continue(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandShuffle.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandShuffle.cs.meta new file mode 100644 index 0000000..253917e --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandShuffle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a15d511e013edfe45a0a4726bda90c8f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandSort.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandSort.cs new file mode 100644 index 0000000..a03926b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandSort.cs @@ -0,0 +1,27 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Sort a target collection + /// + [CommandInfo("Collection", + "Sort", + "Sort a target collection")] + [AddComponentMenu("")] + public class CollectionCommandSort : CollectionBaseCommand + { + public override void OnEnter() + { + if (collection.Value != null) + { + collection.Value.Sort(); + } + + Continue(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandSort.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandSort.cs.meta new file mode 100644 index 0000000..69fe1e7 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandSort.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 00093f39e8583954ba5935bca806f0f1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandUnique.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandUnique.cs new file mode 100644 index 0000000..40ab260 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandUnique.cs @@ -0,0 +1,27 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Removes all duplicates. + /// + [CommandInfo("Collection", + "Unique", + "Removes all duplicates.")] + [AddComponentMenu("")] + public class CollectionCommandUnique : CollectionBaseCommand + { + public override void OnEnter() + { + if (collection.Value != null) + { + collection.Value.Unique(); + } + + Continue(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandUnique.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandUnique.cs.meta new file mode 100644 index 0000000..a8c45c3 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionCommandUnique.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 59ae026a39db9cf4d8453309fa6192db +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionRandom.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionRandom.cs new file mode 100644 index 0000000..2a149cd --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionRandom.cs @@ -0,0 +1,22 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Use the collection as a source of random selection. Picking a random item each run. + /// + [CommandInfo("Collection", + "RandomItem", + "Use the collection as a source of random selection. Picking a random item each run.")] + [AddComponentMenu("")] + public class CollectionRandom : CollectionBaseVarCommand + { + protected override void OnEnterInner() + { + collection.Value.Get(Random.Range(0, collection.Value.Count - 1), ref variableToUse); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionRandom.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionRandom.cs.meta new file mode 100644 index 0000000..0b58949 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionRandom.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d58ddca8952c1a149a39835e2eeac9a7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionRandomBag.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionRandomBag.cs new file mode 100644 index 0000000..3a95c85 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionRandomBag.cs @@ -0,0 +1,80 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Use the collection as a source of random items and turn it into a random bag. Drawing the + /// next random item until out of items and then reshuffling them. + /// + [CommandInfo("Collection", + "RandomBag", + "Use the collection as a source of random items and turn it into a random bag. " + + "Drawing the next random item until out of items and then reshuffling them.")] + [AddComponentMenu("")] + public class CollectionRandomBag : CollectionBaseVarCommand + { + [SerializeField] + [Tooltip("Will add this many copies to the bag. If you want 5 of everything, you want 4 copies.")] + protected IntegerData duplicatesToPutInBag = new IntegerData(0); + + [SerializeField] + protected IntegerData currentIndex = new IntegerData(int.MaxValue); + + protected bool isInit = false; + + protected override void OnEnterInner() + { + if (!isInit) + { + Init(); + } + + currentIndex.Value++; + + if (currentIndex.Value >= collection.Value.Count) + { + Reshuffle(); + } + + collection.Value.Get(currentIndex.Value, ref variableToUse); + } + + protected void Init() + { + var startingCount = collection.Value.Count; + for (int i = 0; i < duplicatesToPutInBag.Value; i++) + { + for (int j = 0; j < startingCount; j++) + { + collection.Value.Add(collection.Value.Get(j)); + } + } + + //force invalid index + currentIndex.Value = collection.Value.Count; + + isInit = true; + } + + protected void Reshuffle() + { + currentIndex.Value = 0; + collection.Value.Shuffle(); + } + + public override bool HasReference(Variable variable) + { + return base.HasReference(variable) || duplicatesToPutInBag.integerRef == variable || currentIndex.integerRef; + } + + public override string GetSummary() + { + return base.GetSummary() + + (duplicatesToPutInBag.integerRef != null ? " " + duplicatesToPutInBag.integerRef.Key : "") + + (currentIndex.integerRef != null ? " " + currentIndex.integerRef.Key : ""); ; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionRandomBag.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionRandomBag.cs.meta new file mode 100644 index 0000000..2b99219 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/CollectionRandomBag.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 56176eef6b396a442b08b88220304436 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/ForEach.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/ForEach.cs new file mode 100644 index 0000000..f3f27ce --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/ForEach.cs @@ -0,0 +1,90 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Loop over each element in the given collection. + /// + [CommandInfo("Collection", + "For Each", + "Loop over each element in the given collection, similar to a foreach but internally uses indicies")] + [AddComponentMenu("")] + public class ForEach : Condition, ICollectionCompatible + { + [SerializeField] + protected CollectionData collection; + + [SerializeField] + [VariableProperty(compatibleVariableName = "collection")] + protected Variable item; + + [SerializeField] + [Tooltip("Optional")] + protected IntegerData curIndex; + + #region Public members + + public override bool IsLooping { get { return true; } } + + protected override void PreEvaluate() + { + //if we came from the end then we are already looping, if not this is first loop so prep + if (ParentBlock.PreviousActiveCommandIndex != endCommand.CommandIndex) + { + curIndex.Value = -1; + } + } + + protected override bool EvaluateCondition() + { + var col = collection.Value; + curIndex.Value++; + if (curIndex < col.Count) + { + col.Get(curIndex, ref item); + return true; + } + + return false; + } + + protected override void OnFalse() + { + MoveToEnd(); + } + + protected override bool HasNeededProperties() + { + return collection.Value != null && item != null; + } + + public override bool HasReference(Variable variable) + { + return collection.collectionRef == variable || item == variable || + base.HasReference(variable); + } + + bool ICollectionCompatible.IsVarCompatibleWithCollection(Variable variable, string compatibleWith) + { + if (compatibleWith == "collection") + return collection.Value == null ? false : collection.Value.IsElementCompatible(variable); + else + return true; + } + + public override string GetSummary() + { + if (item == null) + return "Error: No item var"; + if (collection.Value == null) + return "Error: No collection"; + + return item.Key + " in " + collection.Value.name; + } + + #endregion Public members + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/ForEach.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/ForEach.cs.meta new file mode 100644 index 0000000..2c7276c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/ForEach.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1ce547d5384ce3a41b7142cab8ab41dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/GameObjectFind.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/GameObjectFind.cs new file mode 100644 index 0000000..7236def --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/GameObjectFind.cs @@ -0,0 +1,51 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + [CommandInfo("GameObject", + "FindAll", + "Find all gameobjects by tag and store in a collection")] + [AddComponentMenu("")] + public class GameObjectFind : CollectionBaseCommand + { + [Tooltip("Find all gameobjects of tag")] + [SerializeField] + protected StringData tagString; + + public override void OnEnter() + { + var col = collection.Value; + + if (col != null) + { + var res = GameObject.FindGameObjectsWithTag(tagString.Value); + + for (int i = 0; i < res.Length; i++) + { + col.Add(res[i]); + } + } + + Continue(); + } + + public override bool HasReference(Variable variable) + { + return variable == tagString.stringRef || base.HasReference(variable); + } + + public override string GetSummary() + { + if (collection.Value == null) + return "Error: no collection selected"; + + if (!(collection.Value is GameObjectCollection)) + return "Error: collection is not GameObjectCollection"; + + return tagString.Value + " GOs, store in " + collection.Value.name; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/GameObjectFind.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/GameObjectFind.cs.meta new file mode 100644 index 0000000..7a5bb5c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/GameObjectFind.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8509f58e038dd8c46b98cab78d34e06a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/Physics2DCast.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/Physics2DCast.cs new file mode 100644 index 0000000..84e753d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/Physics2DCast.cs @@ -0,0 +1,162 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + [CommandInfo("Physics2D", + "Cast2D", + "Find all gameobjects hit by given physics shape overlap")] + [AddComponentMenu("")] + public class Physics2DCast : CollectionBaseCommand + { + public enum CastType + { + Box, + Capsule, + Circle, + Line, + Ray, + } + + [Tooltip("")] + [SerializeField] + protected CastType castType = CastType.Ray; + + [Tooltip("Starting point or centre of shape")] + [SerializeField] + protected Vector3Data position1; + + [Tooltip("")] + [SerializeField] + protected Vector3Data direction; + + [Tooltip("")] + [SerializeField] + protected FloatData maxDistance = new FloatData(float.PositiveInfinity); + + [Tooltip("CAPSULE & Circle ONLY")] + [SerializeField] + protected FloatData radius = new FloatData(0.5f); + + [Tooltip("BOX & CAPSULE ONLY")] + [SerializeField] + protected Vector3Data shapeSize = new Vector3Data(Vector3.one * 0.5f); + + [Tooltip("BOX & CAPSULE ONLY")] + [SerializeField] + protected FloatData shapeAngle; + + [Tooltip("LINE ONLY")] + [SerializeField] + protected Vector3Data lineEnd; + + [Tooltip("")] + [SerializeField] + protected LayerMask layerMask = ~0; + + [Tooltip("")] + [SerializeField] + protected FloatData minDepth = new FloatData(float.NegativeInfinity), maxDepth = new FloatData(float.PositiveInfinity); + + [SerializeField] + protected CapsuleDirection2D capsuleDirection; + + public override void OnEnter() + { + var col = collection.Value; + + if (col != null) + { + RaycastHit2D[] resHits = null; + + switch (castType) + { + case CastType.Box: + resHits = Physics2D.BoxCastAll(position1.Value, shapeSize.Value, shapeAngle.Value, direction.Value, maxDistance.Value, layerMask.value, minDepth.Value, maxDepth.Value); + break; + + case CastType.Capsule: + resHits = Physics2D.CapsuleCastAll(position1.Value, shapeSize.Value, capsuleDirection, shapeAngle.Value, direction.Value, maxDistance.Value, layerMask.value, minDepth.Value, maxDepth.Value); + break; + + case CastType.Circle: + resHits = Physics2D.CircleCastAll(position1.Value, radius.Value, direction.Value, maxDistance.Value, layerMask.value, minDepth.Value, maxDepth.Value); + break; + + case CastType.Line: + resHits = Physics2D.LinecastAll(position1.Value, lineEnd.Value, layerMask.value, minDepth.Value, maxDepth.Value); + break; + + case CastType.Ray: + resHits = Physics2D.RaycastAll(position1.Value, direction.Value, maxDistance.Value, layerMask.value, minDepth.Value, maxDepth.Value); + break; + + default: + break; + } + + PutCollidersIntoGameObjectCollection(resHits); + } + + Continue(); + } + + protected void PutCollidersIntoGameObjectCollection(RaycastHit2D[] resColliders) + { + if (resColliders != null) + { + var col = collection.Value; + for (int i = 0; i < resColliders.Length; i++) + { + col.Add(resColliders[i].collider.gameObject); + } + } + } + + public override bool HasReference(Variable variable) + { + return variable == position1.vector3Ref || + variable == radius.floatRef || + variable == shapeSize.vector3Ref || + variable == shapeAngle.floatRef || + variable == minDepth.floatRef || + variable == maxDepth.floatRef || + variable == direction.vector3Ref || + variable == maxDistance.floatRef || + variable == lineEnd.vector3Ref || + base.HasReference(variable); + } + + public override string GetSummary() + { + if (collection.Value == null) + return "Error: no collection selected"; + + //TODO we could support more than just GOs + if (!(collection.Value is GameObjectCollection)) + return "Error: collection is not GameObjectCollection"; + + return castType.ToString() + ", store in " + collection.Value.name; + } + + public override bool IsPropertyVisible(string propertyName) + { + if (castType == CastType.Capsule && propertyName == "capsulePosition2") + return true; + + if (castType == CastType.Line && propertyName == "lineEnd") + return true; + + if ((castType == CastType.Capsule || castType == CastType.Circle) && propertyName == "radius") + return true; + + if ((castType == CastType.Capsule || castType == CastType.Box) && + (propertyName == "shapeAngle" || propertyName == "shapeSize")) + return true; + + return base.IsPropertyVisible(propertyName); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/Physics2DCast.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/Physics2DCast.cs.meta new file mode 100644 index 0000000..994c591 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/Physics2DCast.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: da8de59f5960f5c4b9d61002cc912b37 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/Physics2DOverlap.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/Physics2DOverlap.cs new file mode 100644 index 0000000..24da654 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/Physics2DOverlap.cs @@ -0,0 +1,154 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + [CommandInfo("Physics2D", + "Overlap2D", + "Find all gameobjects hit by given physics shape overlap")] + [AddComponentMenu("")] + public class Physics2DOverlap : CollectionBaseCommand + { + public enum Shape + { + Point, + Area, + Box, + Circle, + Capsule, + } + + [Tooltip("")] + [SerializeField] + protected Shape shape = Shape.Box; + + [Tooltip("Starting point or centre of shape")] + [SerializeField] + protected Vector3Data position1; + + [Tooltip("AREA ONLY")] + [SerializeField] + protected Vector3Data areaEndPosition; + + [Tooltip("CAPSULE & Circle ONLY")] + [SerializeField] + protected FloatData radius = new FloatData(0.5f); + + [Tooltip("BOX & CAPSULE ONLY")] + [SerializeField] + protected Vector3Data shapeSize = new Vector3Data(Vector3.one * 0.5f); + + [Tooltip("BOX & CAPSULE ONLY")] + [SerializeField] + protected FloatData shapeAngle; + + [Tooltip("")] + [SerializeField] + protected LayerMask layerMask = ~0; + + [Tooltip("")] + [SerializeField] + protected FloatData minDepth = new FloatData(float.NegativeInfinity), maxDepth = new FloatData(float.PositiveInfinity); + + [SerializeField] + protected CapsuleDirection2D capsuleDirection; + + public override void OnEnter() + { + var col = collection.Value; + + if (col != null) + { + Collider2D[] resColliders = null; + + switch (shape) + { + case Shape.Area: + resColliders = Physics2D.OverlapAreaAll(position1.Value, areaEndPosition.Value, layerMask.value, minDepth.Value, maxDepth.Value); + break; + + case Shape.Box: + resColliders = Physics2D.OverlapBoxAll(position1.Value, shapeSize.Value, shapeAngle.Value, layerMask.value, minDepth.Value, maxDepth.Value); + break; + + case Shape.Circle: + resColliders = Physics2D.OverlapCircleAll(position1.Value, radius.Value, layerMask.value, minDepth.Value, maxDepth.Value); + break; + + case Shape.Capsule: + resColliders = Physics2D.OverlapCapsuleAll(position1.Value, shapeSize.Value, capsuleDirection, shapeAngle.Value, layerMask.value, minDepth.Value, maxDepth.Value); + break; + + case Shape.Point: + resColliders = Physics2D.OverlapPointAll(position1.Value, layerMask.value, minDepth.Value, maxDepth.Value); + break; + + default: + break; + } + + PutCollidersIntoGameObjectCollection(resColliders); + } + + Continue(); + } + + protected void PutCollidersIntoGameObjectCollection(Collider2D[] resColliders) + { + if (resColliders != null) + { + var col = collection.Value; + for (int i = 0; i < resColliders.Length; i++) + { + col.Add(resColliders[i].gameObject); + } + } + } + + public override bool HasReference(Variable variable) + { + return variable == position1.vector3Ref || + variable == areaEndPosition.vector3Ref || + variable == radius.floatRef || + variable == shapeSize.vector3Ref || + variable == shapeAngle.floatRef || + variable == minDepth.floatRef || + variable == maxDepth.floatRef || + base.HasReference(variable); + } + + public override string GetSummary() + { + if (collection.Value == null) + return "Error: no collection selected"; + + //TODO we could support more than just GOs + if (!(collection.Value is GameObjectCollection)) + return "Error: collection is not GameObjectCollection"; + + return shape.ToString() + ", store in " + collection.Value.name; + } + + public override bool IsPropertyVisible(string propertyName) + { + if (shape == Shape.Capsule && propertyName == "capsulePosition2") + return true; + + if (shape == Shape.Area && propertyName == "areaEndPosition") + return true; + + if ((shape == Shape.Capsule || shape == Shape.Circle) && propertyName == "radius") + return true; + + if ((shape == Shape.Capsule || shape == Shape.Box) && propertyName == "shapeAngle") + return true; + + if (shape == Shape.Box && (propertyName == "boxHalfExtends" || propertyName == "boxOrientation")) + return true; + + return base.IsPropertyVisible(propertyName); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/Physics2DOverlap.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/Physics2DOverlap.cs.meta new file mode 100644 index 0000000..2369aac --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/Physics2DOverlap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c27aec18d802f45429190093660305e4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/PhysicsCast.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/PhysicsCast.cs new file mode 100644 index 0000000..f5b145e --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/PhysicsCast.cs @@ -0,0 +1,147 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + [CommandInfo("Physics", + "Cast", + "Find all gameobjects hit by given physics shape cast")] + [AddComponentMenu("")] + public class PhysicsCast : CollectionBaseCommand + { + public enum CastType + { + Box, + Capsule, + Ray, + Sphere, + } + + [SerializeField] + protected CastType castType = CastType.Ray; + + [Tooltip("Starting point/origin or centre of shape")] + [SerializeField] + protected Vector3Data position1; + + [Tooltip("")] + [SerializeField] + protected Vector3Data direction; + + [Tooltip("")] + [SerializeField] + protected FloatData maxDistance = new FloatData(float.PositiveInfinity); + + [Tooltip("CAPSULE ONLY; end point of the capsule")] + [SerializeField] + protected Vector3Data capsulePosition2; + + [Tooltip("CAPSULE & SPHERE ONLY")] + [SerializeField] + protected FloatData radius = new FloatData(0.5f); + + [Tooltip("BOX ONLY")] + [SerializeField] + protected Vector3Data boxHalfExtends = new Vector3Data(Vector3.one * 0.5f); + + [Tooltip("BOX ONLY")] + [SerializeField] + protected QuaternionData boxOrientation = new QuaternionData(Quaternion.identity); + + [Tooltip("")] + [SerializeField] + protected LayerMask layerMask = ~0; + + [Tooltip("")] + [SerializeField] + protected QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal; + + public override void OnEnter() + { + var col = collection.Value; + + if (col != null) + { + RaycastHit[] resHits = null; + + switch (castType) + { + case CastType.Ray: + resHits = Physics.RaycastAll(position1.Value, direction.Value, maxDistance.Value, layerMask.value, queryTriggerInteraction); + break; + + case CastType.Sphere: + resHits = Physics.SphereCastAll(position1.Value, radius.Value, direction.Value, maxDistance.Value, layerMask.value, queryTriggerInteraction); + break; + + case CastType.Box: + resHits = Physics.BoxCastAll(position1.Value, boxHalfExtends.Value, direction.Value, boxOrientation.Value, maxDistance.Value, layerMask.value, queryTriggerInteraction); + break; + + case CastType.Capsule: + resHits = Physics.CapsuleCastAll(position1.Value, capsulePosition2.Value, radius.Value, direction.Value, maxDistance.Value, layerMask.value, queryTriggerInteraction); + break; + + default: + break; + } + + PutCollidersIntoGameObjectCollection(resHits); + } + + Continue(); + } + + protected void PutCollidersIntoGameObjectCollection(RaycastHit[] resHits) + { + if (resHits != null) + { + var col = collection.Value; + for (int i = 0; i < resHits.Length; i++) + { + col.Add(resHits[i].collider.gameObject); + } + } + } + + public override bool HasReference(Variable variable) + { + return variable == direction.vector3Ref || + variable == maxDistance.floatRef || + variable == position1.vector3Ref || + variable == capsulePosition2.vector3Ref || + variable == radius.floatRef || + variable == boxHalfExtends.vector3Ref || + variable == boxOrientation.quaternionRef || + base.HasReference(variable); + } + + public override string GetSummary() + { + if (collection.Value == null) + return "Error: no collection selected"; + + //TODO we could support more than just GOs + if (!(collection.Value is GameObjectCollection)) + return "Error: collection is not GameObjectCollection"; + + return castType.ToString() + ", store in " + collection.Value.name; + } + + public override bool IsPropertyVisible(string propertyName) + { + if (castType == CastType.Capsule && propertyName == "capsulePosition2") + return true; + + if ((castType == CastType.Capsule || castType == CastType.Sphere) && propertyName == "radius") + return true; + + if (castType == CastType.Box && (propertyName == "boxHalfExtends" || propertyName == "boxOrientation")) + return true; + + return base.IsPropertyVisible(propertyName); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/PhysicsCast.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/PhysicsCast.cs.meta new file mode 100644 index 0000000..272dbd8 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/PhysicsCast.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 44a4b238cb3af004bbae4a6145089ea2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/PhysicsOverlap.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/PhysicsOverlap.cs new file mode 100644 index 0000000..1cb6e79 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/PhysicsOverlap.cs @@ -0,0 +1,136 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// + /// + [CommandInfo("Physics", + "Overlap", + "Find all gameobjects hit by given physics shape overlap")] + [AddComponentMenu("")] + public class PhysicsOverlap : CollectionBaseCommand + { + public enum Shape + { + Box, + Capsule, + Sphere, + } + + [Tooltip("")] + [SerializeField] + protected Shape shape = Shape.Box; + + [Tooltip("Starting point or centre of shape")] + [SerializeField] + protected Vector3Data position1; + + [Tooltip("CAPSULE ONLY; end point of the capsule")] + [SerializeField] + protected Vector3Data capsulePosition2; + + [Tooltip("CAPSULE & SPHERE ONLY")] + [SerializeField] + protected FloatData radius = new FloatData(0.5f); + + [Tooltip("BOX ONLY")] + [SerializeField] + protected Vector3Data boxHalfExtends = new Vector3Data(Vector3.one * 0.5f); + + [Tooltip("BOX ONLY")] + [SerializeField] + protected QuaternionData boxOrientation = new QuaternionData(Quaternion.identity); + + [Tooltip("")] + [SerializeField] + protected LayerMask layerMask = ~0; + + [Tooltip("")] + [SerializeField] + protected QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal; + + public override void OnEnter() + { + var col = collection.Value; + + if (col != null) + { + Collider[] resColliders = null; + + switch (shape) + { + case Shape.Box: + resColliders = Physics.OverlapBox(position1.Value, boxHalfExtends.Value, boxOrientation.Value, layerMask.value, queryTriggerInteraction); + break; + + case Shape.Sphere: + resColliders = Physics.OverlapSphere(position1.Value, radius.Value, layerMask.value, queryTriggerInteraction); + break; + + case Shape.Capsule: + resColliders = Physics.OverlapCapsule(position1.Value, capsulePosition2.Value, radius.Value, layerMask.value, queryTriggerInteraction); + break; + + default: + break; + } + + PutCollidersIntoGameObjectCollection(resColliders); + } + + Continue(); + } + + protected void PutCollidersIntoGameObjectCollection(Collider[] resColliders) + { + if (resColliders != null) + { + var col = collection.Value; + for (int i = 0; i < resColliders.Length; i++) + { + col.Add(resColliders[i].gameObject); + } + } + } + + public override bool HasReference(Variable variable) + { + return variable == position1.vector3Ref || + variable == capsulePosition2.vector3Ref || + variable == radius.floatRef || + variable == boxHalfExtends.vector3Ref || + variable == boxOrientation.quaternionRef || + base.HasReference(variable); + } + + public override string GetSummary() + { + if (collection.Value == null) + return "Error: no collection selected"; + + //TODO we could support more than just GOs + if (!(collection.Value is GameObjectCollection)) + return "Error: collection is not GameObjectCollection"; + + return shape.ToString() + ", store in " + collection.Value.name; + } + + public override bool IsPropertyVisible(string propertyName) + { + if (shape == Shape.Capsule && propertyName == "capsulePosition2") + return true; + + if ((shape == Shape.Capsule || shape == Shape.Sphere) && propertyName == "radius") + return true; + + if (shape == Shape.Box && (propertyName == "boxHalfExtends" || propertyName == "boxOrientation")) + return true; + + return base.IsPropertyVisible(propertyName); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/PhysicsOverlap.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/PhysicsOverlap.cs.meta new file mode 100644 index 0000000..57665f6 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Collection/PhysicsOverlap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5996bc0e902a19f4fa257341b0691de3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Comment.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Comment.cs new file mode 100644 index 0000000..ac6bd3f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Comment.cs @@ -0,0 +1,47 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Use comments to record design notes and reminders about your game. + /// + [CommandInfo("", + "Comment", + "Use comments to record design notes and reminders about your game.")] + [AddComponentMenu("")] + public class Comment : Command + { + [Tooltip("Name of Commenter")] + [SerializeField] protected string commenterName = ""; + + [Tooltip("Text to display for this comment")] + [TextArea(2,4)] + [SerializeField] protected string commentText = ""; + + #region Public members + + public override void OnEnter() + { + Continue(); + } + + public override string GetSummary() + { + if (commenterName != "") + { + return commenterName + ": " + commentText; + } + return commentText; + } + + public override Color GetButtonColor() + { + return new Color32(220, 220, 220, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Comment.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Comment.cs.meta new file mode 100644 index 0000000..b265a61 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Comment.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ea6e8f632db87477eb750446b28d73a3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Condition.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Condition.cs new file mode 100644 index 0000000..5af13b8 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Condition.cs @@ -0,0 +1,285 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Base for all Conditional based Commands, Ifs, Loops, and so on. + /// + [AddComponentMenu("")] + public abstract class Condition : Command + { + protected End endCommand; + + public override void OnEnter() + { + if (ParentBlock == null) + { + return; + } + + //if looping we need the end command in order to work + if(IsLooping && !EnsureRequiredEnd()) + { + Debug.LogError(GetLocationIdentifier() + " is looping but has no matching End command"); + Continue(); + return; + } + + if ( !HasNeededProperties() ) + { + Debug.LogError(GetLocationIdentifier() + " cannot run due to missing required properties"); + Continue(); + return; + } + + //Ensuring we arrived at this elif honestly, not incorrectly due to fall through from a previous command + if (this.IsElseIf && !DoesPassElifSanityCheck()) + { + //elif is being asked to run but didn't come from a previously failing if or elif, this isn't allowed + MoveToEnd(); + return; + } + + EvaluateAndContinue(); + } + + public override bool OpenBlock() + { + return true; + } + + public override Color GetButtonColor() + { + return new Color32(253, 253, 150, 255); + } + + public virtual bool IsLooping { get { return false; } } + + + /// + /// Moves execution to the closing End of the current command, attempts to locate end if not + /// already known and if no closing End exists. + /// + public virtual void MoveToEnd() + { + if(endCommand == null) + { + endCommand = FindOurEndCommand(); + } + + if (endCommand != null) + { + // Continue at next command after End + // and make the end non looping incase it gets run via index etc. + endCommand.Loop = false; + Continue(endCommand.CommandIndex + 1); + } + else + { + //nowhere to go, so we assume the block wants to stop but is missing and end, this + // is also ensures back compat + Debug.LogWarning("Condition wants to move to end but no End command found, stopping block. " + GetLocationIdentifier()); + StopParentBlock(); + } + } + + + protected End FindOurEndCommand() + { + return FindMatchingEndCommand(this); + } + + /// + /// Helper to find the paired End Command for the given command. + /// + /// + /// Mathcing End Command or null if not found + public static End FindMatchingEndCommand(Command startCommand) + { + if (startCommand.ParentBlock == null) + return null; + + int indent = startCommand.IndentLevel; + for (int i = startCommand.CommandIndex + 1; i < startCommand.ParentBlock.CommandList.Count; ++i) + { + var command = startCommand.ParentBlock.CommandList[i]; + + if (command.IndentLevel == indent) + { + if (command is End) + { + return command as End; + } + } + else if (command.IndentLevel < indent) + { + //managed to be less indent than the inner but not find and end, this shouldn't occur + // but may be user error or bad data, makes sense for completeness here + return null; + } + } + + return null; + } + + /// + /// Helper for child classes that require an End command to function. For IsLooping commands + /// this also configures the loopback within the End command. + /// + /// + protected virtual bool EnsureRequiredEnd() + { + if (endCommand == null) + { + endCommand = FindOurEndCommand(); + + if (endCommand == null) + { + Debug.LogError( GetLocationIdentifier() + "', could not find closing End command and thus cannot loop."); + //StopParentBlock(); + return false; + } + } + + if (IsLooping) + { + // Tell the following end command to loop back + endCommand.Loop = true; + endCommand.LoopBackIndex = CommandIndex; + } + return true; + } + + /// + /// Called by OnEnter when the condition is needed to evaluate and continue execution. + /// Means child classes do not have to deal with erronuous execution conditions, like fall through. + /// + protected virtual void EvaluateAndContinue() + { + PreEvaluate(); + + if (EvaluateCondition()) + { + OnTrue(); + } + else + { + OnFalse(); + } + } + + /// + /// Called when the condition is run and EvaluateCondition returns true + /// + protected virtual void OnTrue() + { + Continue(); + } + + /// + /// Called when the condition is run and EvaluateCondition returns false + /// + protected virtual void OnFalse() + { + //looping constructs only care about the end + if(IsLooping) + { + MoveToEnd(); + return; + } + + // Find the next Else, ElseIf or End command at the same indent level as this If command + for (int i = CommandIndex + 1; i < ParentBlock.CommandList.Count; ++i) + { + Command nextCommand = ParentBlock.CommandList[i]; + + if (nextCommand == null) + { + continue; + } + + // Find next command at same indent level as this If command + // Skip disabled commands, comments & labels + if (!((Command)nextCommand).enabled || + nextCommand.GetType() == typeof(Comment) || + nextCommand.GetType() == typeof(Label) || + nextCommand.IndentLevel != indentLevel) + { + continue; + } + + System.Type type = nextCommand.GetType(); + if (type == typeof(Else) || + type == typeof(End)) + { + if (i >= ParentBlock.CommandList.Count - 1) + { + // Last command in Block, so stop + StopParentBlock(); + } + else + { + // Execute command immediately after the Else or End command + Continue(nextCommand.CommandIndex + 1); + return; + } + } + else if (type.IsSubclassOf(typeof(Condition)) && (nextCommand as Condition).IsElseIf) + { + // Execute the Else If command + Continue(i); + return; + } + } + + // No matching End command found, so just stop the block + StopParentBlock(); + } + + /// + /// Sits in the if within EvaluateAndContinue, if returns true, OnTrue will run, if false, OnFalse will run. + /// + protected abstract bool EvaluateCondition(); + + /// + /// Child classes are required to report if it is possible for them to be evaulated. + /// + protected virtual bool HasNeededProperties() { return true; } + + /// + /// Declare if the child class is implementing an 'else if' command, which requires some special handling + /// + protected virtual bool IsElseIf { get { return false; } } + + /// + /// Called before EvaluateCondition, allowing for child classes to gather required data + /// + protected virtual void PreEvaluate() { } + + /// + /// Ensure that this condition didn't come from a non matching if/elif. + /// + /// + protected virtual bool DoesPassElifSanityCheck() + { + System.Type previousCommandType = ParentBlock.GetPreviousActiveCommandType(); + var prevCmdIndent = ParentBlock.GetPreviousActiveCommandIndent(); + var prevCmd = ParentBlock.GetPreviousActiveCommand(); + + //handle our matching if or else if in the chain failing and moving to us, + // need to make sure it is the same indent level + if (prevCmd == null || + prevCmdIndent != IndentLevel || + !previousCommandType.IsSubclassOf(typeof(Condition)) || + (prevCmd as Condition).IsLooping) + { + return false; + } + + return true; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Condition.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Condition.cs.meta new file mode 100644 index 0000000..1a3eefd --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Condition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a5a19bbd99c314af6aa3f3319ca323b2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlAudio.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlAudio.cs new file mode 100644 index 0000000..ef14850 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlAudio.cs @@ -0,0 +1,309 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// The type of audio control to perform. + /// + public enum ControlAudioType + { + /// Play the audiosource once. + PlayOnce, + /// Play the audiosource in a loop. + PlayLoop, + /// Pause a looping audiosource. + PauseLoop, + /// Stop a looping audiosource. + StopLoop, + /// Change the volume level of an audiosource. + ChangeVolume + } + + /// + /// Plays, loops, or stops an audiosource. Any AudioSources with the same tag as the target Audio Source will automatically be stoped. + /// + [CommandInfo("Audio", + "Control Audio", + "Plays, loops, or stops an audiosource. Any AudioSources with the same tag as the target Audio Source will automatically be stoped.")] + [ExecuteInEditMode] + public class ControlAudio : Command + { + [Tooltip("What to do to audio")] + [SerializeField] protected ControlAudioType control; + public virtual ControlAudioType Control { get { return control; } } + + [Tooltip("Audio clip to play")] + [SerializeField] protected AudioSourceData _audioSource; + + [Range(0,1)] + [Tooltip("Start audio at this volume")] + [SerializeField] protected float startVolume = 1; + + [Range(0,1)] + [Tooltip("End audio at this volume")] + [SerializeField] protected float endVolume = 1; + + [Tooltip("Time to fade between current volume level and target volume level.")] + [SerializeField] protected float fadeDuration; + + [Tooltip("Wait until this command has finished before executing the next command.")] + [SerializeField] protected bool waitUntilFinished = false; + + // If there's other music playing in the scene, assign it the same tag as the new music you want to play and + // the old music will be automatically stopped. + protected virtual void StopAudioWithSameTag() + { + // Don't stop audio if there's no tag assigned + if (_audioSource.Value == null || + _audioSource.Value.tag == "Untagged") + { + return; + } + + var audioSources = GameObject.FindObjectsOfType(); + for (int i = 0; i < audioSources.Length; i++) + { + var a = audioSources[i]; + if (a != _audioSource.Value && a.tag == _audioSource.Value.tag) + { + StopLoop(a); + } + } + } + + protected virtual void PlayOnce() + { + if (fadeDuration > 0) + { + // Fade volume in + LeanTween.value(_audioSource.Value.gameObject, + _audioSource.Value.volume, + endVolume, + fadeDuration + ).setOnUpdate( + (float updateVolume)=>{ + _audioSource.Value.volume = updateVolume; + }); + } + + _audioSource.Value.PlayOneShot(_audioSource.Value.clip); + + if (waitUntilFinished) + { + StartCoroutine(WaitAndContinue()); + } + } + + protected virtual IEnumerator WaitAndContinue() + { + // Poll the audiosource until playing has finished + // This allows for things like effects added to the audiosource. + while (_audioSource.Value.isPlaying) + { + yield return null; + } + + Continue(); + } + + protected virtual void PlayLoop() + { + if (fadeDuration > 0) + { + _audioSource.Value.volume = 0; + _audioSource.Value.loop = true; + _audioSource.Value.GetComponent().Play(); + LeanTween.value(_audioSource.Value.gameObject,0,endVolume,fadeDuration + ).setOnUpdate( + (float updateVolume)=>{ + _audioSource.Value.volume = updateVolume; + } + ).setOnComplete( + ()=>{ + if (waitUntilFinished) + { + Continue(); + } + } + ); + } + else + { + _audioSource.Value.volume = endVolume; + _audioSource.Value.loop = true; + _audioSource.Value.GetComponent().Play(); + } + } + + protected virtual void PauseLoop() + { + if (fadeDuration > 0) + { + LeanTween.value(_audioSource.Value.gameObject,_audioSource.Value.volume,0,fadeDuration + ).setOnUpdate( + (float updateVolume)=>{ + _audioSource.Value.volume = updateVolume; + } + ).setOnComplete( + ()=>{ + + _audioSource.Value.GetComponent().Pause(); + if (waitUntilFinished) + { + Continue(); + } + } + ); + } + else + { + _audioSource.Value.GetComponent().Pause(); + } + } + + protected virtual void StopLoop(AudioSource source) + { + if (fadeDuration > 0) + { + LeanTween.value(source.gameObject,_audioSource.Value.volume,0,fadeDuration + ).setOnUpdate( + (float updateVolume)=>{ + source.volume = updateVolume; + } + ).setOnComplete( + ()=>{ + + source.GetComponent().Stop(); + if (waitUntilFinished) + { + Continue(); + } + } + ); + } + else + { + source.GetComponent().Stop(); + } + } + + protected virtual void ChangeVolume() + { + LeanTween.value(_audioSource.Value.gameObject,_audioSource.Value.volume,endVolume,fadeDuration + ).setOnUpdate( + (float updateVolume)=>{ + _audioSource.Value.volume = updateVolume; + }).setOnComplete( + ()=>{ + if (waitUntilFinished) + { + Continue(); + } + }); + } + + protected virtual void AudioFinished() + { + if (waitUntilFinished) + { + Continue(); + } + } + + #region Public members + + public override void OnEnter() + { + if (_audioSource.Value == null) + { + Continue(); + return; + } + + if (control != ControlAudioType.ChangeVolume) + { + _audioSource.Value.volume = endVolume; + } + + switch(control) + { + case ControlAudioType.PlayOnce: + StopAudioWithSameTag(); + PlayOnce(); + break; + case ControlAudioType.PlayLoop: + StopAudioWithSameTag(); + PlayLoop(); + break; + case ControlAudioType.PauseLoop: + PauseLoop(); + break; + case ControlAudioType.StopLoop: + StopLoop(_audioSource.Value); + break; + case ControlAudioType.ChangeVolume: + ChangeVolume(); + break; + } + if (!waitUntilFinished) + { + Continue(); + } + } + + public override string GetSummary() + { + if (_audioSource.Value == null) + { + return "Error: No sound clip selected"; + } + string fadeType = ""; + if (fadeDuration > 0) + { + fadeType = " Fade out"; + if (control != ControlAudioType.StopLoop) + { + fadeType = " Fade in volume to " + endVolume; + } + if (control == ControlAudioType.ChangeVolume) + { + fadeType = " to " + endVolume; + } + fadeType += " over " + fadeDuration + " seconds."; + } + return control.ToString() + " \"" + _audioSource.Value.name + "\"" + fadeType; + } + + public override Color GetButtonColor() + { + return new Color32(242, 209, 176, 255); + } + + public override bool HasReference(Variable variable) + { + return _audioSource.audioSourceRef == variable || base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("audioSource")] public AudioSource audioSourceOLD; + + protected virtual void OnEnable() + { + if (audioSourceOLD != null) + { + _audioSource.Value = audioSourceOLD; + audioSourceOLD = null; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlAudio.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlAudio.cs.meta new file mode 100644 index 0000000..1b4fb1e --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlAudio.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bc30c92f7ffe3d746ac76cd528d616e5 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlStage.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlStage.cs new file mode 100644 index 0000000..06ccb02 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlStage.cs @@ -0,0 +1,219 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Supported display operations for Stage. + /// + public enum StageDisplayType + { + /// No operation + None, + /// Show the stage and all portraits. + Show, + /// Hide the stage and all portraits. + Hide, + /// Swap the stage and all portraits with another stage. + Swap, + /// Move stage to the front. + MoveToFront, + /// Undim all portraits on the stage. + UndimAllPortraits, + /// Dim all non-speaking portraits on the stage. + DimNonSpeakingPortraits + } + + /// + /// Controls the stage on which character portraits are displayed. + /// + [CommandInfo("Narrative", + "Control Stage", + "Controls the stage on which character portraits are displayed.")] + public class ControlStage : ControlWithDisplay + { + [Tooltip("Stage to display characters on")] + [SerializeField] protected Stage stage; + public virtual Stage _Stage { get { return stage; } } + + [Tooltip("Stage to swap with")] + [SerializeField] protected Stage replacedStage; + + [Tooltip("Use Default Settings")] + [SerializeField] protected bool useDefaultSettings = true; + public virtual bool UseDefaultSettings { get { return useDefaultSettings; } } + + [Tooltip("Fade Duration")] + [SerializeField] protected float fadeDuration; + + [Tooltip("Wait until the tween has finished before executing the next command")] + [SerializeField] protected bool waitUntilFinished = false; + + protected virtual void Show(Stage stage, bool visible) + { + float duration = (fadeDuration == 0) ? float.Epsilon : fadeDuration; + float targetAlpha = visible ? 1f : 0f; + + CanvasGroup canvasGroup = stage.GetComponentInChildren(); + if (canvasGroup == null) + { + Continue(); + return; + } + + LeanTween.value(canvasGroup.gameObject, canvasGroup.alpha, targetAlpha, duration).setOnUpdate( (float alpha) => { + canvasGroup.alpha = alpha; + }).setOnComplete( () => { + OnComplete(); + }); + } + + protected virtual void MoveToFront(Stage stage) + { + var activeStages = Stage.ActiveStages; + for (int i = 0; i < activeStages.Count; i++) + { + var s = activeStages[i]; + if (s == stage) + { + s.PortraitCanvas.sortingOrder = 1; + } + else + { + s.PortraitCanvas.sortingOrder = 0; + } + } + } + + protected virtual void UndimAllPortraits(Stage stage) + { + stage.DimPortraits = false; + var charactersOnStage = stage.CharactersOnStage; + for (int i = 0; i < charactersOnStage.Count; i++) + { + var character = charactersOnStage[i]; + stage.SetDimmed(character, false); + } + } + + protected virtual void DimNonSpeakingPortraits(Stage stage) + { + stage.DimPortraits = true; + } + + protected virtual void OnComplete() + { + if (waitUntilFinished) + { + Continue(); + } + } + + #region Public members + + public override void OnEnter() + { + // If no display specified, do nothing + if (IsDisplayNone(display)) + { + Continue(); + return; + } + + // Selected "use default Portrait Stage" + if (stage == null) + { + // If no default specified, try to get any portrait stage in the scene + stage = FindObjectOfType(); + + // If portrait stage does not exist, do nothing + if (stage == null) + { + Continue(); + return; + } + } + + // Selected "use default Portrait Stage" + if (display == StageDisplayType.Swap) // Default portrait stage selected + { + if (replacedStage == null) // If no default specified, try to get any portrait stage in the scene + { + replacedStage = GameObject.FindObjectOfType(); + } + // If portrait stage does not exist, do nothing + if (replacedStage == null) + { + Continue(); + return; + } + } + // Use default settings + if (useDefaultSettings) + { + fadeDuration = stage.FadeDuration; + } + switch(display) + { + case (StageDisplayType.Show): + Show(stage, true); + break; + case (StageDisplayType.Hide): + Show(stage, false); + break; + case (StageDisplayType.Swap): + Show(stage, true); + Show(replacedStage, false); + break; + case (StageDisplayType.MoveToFront): + MoveToFront(stage); + break; + case (StageDisplayType.UndimAllPortraits): + UndimAllPortraits(stage); + break; + case (StageDisplayType.DimNonSpeakingPortraits): + DimNonSpeakingPortraits(stage); + break; + } + + if (!waitUntilFinished) + { + Continue(); + } + } + + public override string GetSummary() + { + string displaySummary = ""; + if (display != StageDisplayType.None) + { + displaySummary = StringFormatter.SplitCamelCase(display.ToString()); + } + else + { + return "Error: No display selected"; + } + string stageSummary = ""; + if (stage != null) + { + stageSummary = " \"" + stage.name + "\""; + } + return displaySummary + stageSummary; + } + + public override Color GetButtonColor() + { + return new Color32(230, 200, 250, 255); + } + + public override void OnCommandAdded(Block parentBlock) + { + //Default to display type: show + display = StageDisplayType.Show; + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlStage.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlStage.cs.meta new file mode 100644 index 0000000..15b28d7 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlStage.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f1ff0f540016ff64ab1556db6fe1e10f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlWithDisplay.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlWithDisplay.cs new file mode 100644 index 0000000..3357d45 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlWithDisplay.cs @@ -0,0 +1,26 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System; +using UnityEngine; + +namespace Fungus +{ + public class ControlWithDisplay : Command + { + [Tooltip("Display type")] + [SerializeField] protected TDisplayEnum display; + + protected virtual bool IsDisplayNone(TEnum enumValue) + { + string displayTypeStr = Enum.GetName(typeof (TEnum), enumValue); + return displayTypeStr == "None"; + } + + #region Public members + + public virtual TDisplayEnum Display { get { return display; } } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlWithDisplay.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlWithDisplay.cs.meta new file mode 100644 index 0000000..7c07efb --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ControlWithDisplay.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6b4717bbde4a5e64893724b3db7eb32c +timeCreated: 1463225157 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Conversation.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Conversation.cs new file mode 100644 index 0000000..2ebcda9 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Conversation.cs @@ -0,0 +1,90 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using System.Collections; + +namespace Fungus +{ + /// + /// Do multiple say and portrait commands in a single block of text. Format is: [character] [portrait] [stage position] [hide] [<<< | >>>] [clear | noclear] [wait | nowait] [fade | nofade] [: Story text]. + /// + [CommandInfo("Narrative", + "Conversation", + "Do multiple say and portrait commands in a single block of text. Format is: [character] [portrait] [stage position] [hide] [<<< | >>>] [clear | noclear] [wait | nowait] [fade | nofade] [: Story text]")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class Conversation : Command + { + [SerializeField] protected StringDataMulti conversationText; + + protected ConversationManager conversationManager = new ConversationManager(); + + [SerializeField] protected BooleanData clearPrevious = new BooleanData(true); + [SerializeField] protected BooleanData waitForInput = new BooleanData(true); + [Tooltip("a wait for seconds added to each item of the conversation.")] + [SerializeField] protected FloatData waitForSeconds = new FloatData(0); + [SerializeField] protected BooleanData fadeWhenDone = new BooleanData(true); + + protected virtual void Start() + { + conversationManager.PopulateCharacterCache(); + } + + protected virtual IEnumerator DoConversation() + { + var flowchart = GetFlowchart(); + string subbedText = flowchart.SubstituteVariables(conversationText.Value); + + conversationManager.ClearPrev = clearPrevious; + conversationManager.WaitForInput = waitForInput; + conversationManager.FadeDone = fadeWhenDone; + conversationManager.WaitForSeconds = waitForSeconds; + + yield return StartCoroutine(conversationManager.DoConversation(subbedText)); + + Continue(); + } + + #region Public members + + public override void OnEnter() + { + StartCoroutine(DoConversation()); + } + + public override string GetSummary() + { + return conversationText.Value; + } + + public override Color GetButtonColor() + { + return new Color32(184, 210, 235, 255); + } + + public override bool HasReference(Variable variable) + { + return clearPrevious.booleanRef == variable || waitForInput.booleanRef == variable || + waitForSeconds.floatRef == variable || fadeWhenDone.booleanRef == variable || + base.HasReference(variable); + } + + #endregion + + + #region Editor caches +#if UNITY_EDITOR + protected override void RefreshVariableCache() + { + base.RefreshVariableCache(); + + var f = GetFlowchart(); + + if(!string.IsNullOrEmpty(conversationText.Value)) + f.DetermineSubstituteVariables(conversationText, referencedVariables); + } +#endif + #endregion Editor caches + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Conversation.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Conversation.cs.meta new file mode 100644 index 0000000..bd0a394 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Conversation.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f608b8c9fb3044200aac956492d8d586 +timeCreated: 1469542178 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/DebugBreak.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/DebugBreak.cs new file mode 100644 index 0000000..2dd31d7 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/DebugBreak.cs @@ -0,0 +1,42 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Writes a log message to the debug console. + /// + [CommandInfo("Scripting", + "Debug Break", + "Calls Debug.Break if enabled. Also useful for putting a visual studio breakbpoint within.")] + [AddComponentMenu("")] + public class DebugBreak : Command + { + [SerializeField] new protected BooleanData enabled = new BooleanData(true); + + public override void OnEnter() + { + if (enabled.Value) + Debug.Break(); + + Continue(); + } + + public override string GetSummary() + { + return enabled.Value ? "enabled" : "disabled"; + } + + public override bool HasReference(Variable variable) + { + return variable == enabled.booleanRef; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/DebugBreak.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/DebugBreak.cs.meta new file mode 100644 index 0000000..cc5c158 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/DebugBreak.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a14b04da97ec217478d0809feef89ec8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/DebugLog.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/DebugLog.cs new file mode 100644 index 0000000..d67c4c4 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/DebugLog.cs @@ -0,0 +1,89 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Type of log message. Maps directly to Unity's log types. + /// + public enum DebugLogType + { + /// Informative log message. + Info, + /// Warning log message. + Warning, + /// Error log message. + Error + } + + /// + /// Writes a log message to the debug console. + /// + [CommandInfo("Scripting", + "Debug Log", + "Writes a log message to the debug console.")] + [AddComponentMenu("")] + public class DebugLog : Command + { + [Tooltip("Display type of debug log info")] + [SerializeField] protected DebugLogType logType; + + [Tooltip("Text to write to the debug log. Supports variable substitution, e.g. {$Myvar}")] + [SerializeField] protected StringDataMulti logMessage; + + #region Public members + + public override void OnEnter () + { + var flowchart = GetFlowchart(); + string message = flowchart.SubstituteVariables(logMessage.Value); + + switch (logType) + { + case DebugLogType.Info: + Debug.Log(message); + break; + case DebugLogType.Warning: + Debug.LogWarning(message); + break; + case DebugLogType.Error: + Debug.LogError(message); + break; + } + + Continue(); + } + + public override string GetSummary() + { + return logMessage.GetDescription(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + return logMessage.stringRef == variable || base.HasReference(variable); + } + + #endregion + + #region Editor caches +#if UNITY_EDITOR + protected override void RefreshVariableCache() + { + base.RefreshVariableCache(); + + var f = GetFlowchart(); + + f.DetermineSubstituteVariables(logMessage.Value, referencedVariables); + } +#endif + #endregion Editor caches + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/DebugLog.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/DebugLog.cs.meta new file mode 100644 index 0000000..0f1e38d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/DebugLog.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2fab8abf0343545abbfebd9a7b7b34bd +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/DeleteSaveKey.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/DeleteSaveKey.cs new file mode 100644 index 0000000..a1d969d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/DeleteSaveKey.cs @@ -0,0 +1,70 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Deletes a saved value from permanent storage. + /// + [CommandInfo("Variable", + "Delete Save Key", + "Deletes a saved value from permanent storage.")] + [AddComponentMenu("")] + public class DeleteSaveKey : Command + { + [Tooltip("Name of the saved value. Supports variable substition e.g. \"player_{$PlayerNumber}")] + [SerializeField] protected string key = ""; + + #region Public members + + public override void OnEnter() + { + if (key == "") + { + Continue(); + return; + } + + var flowchart = GetFlowchart(); + + // Prepend the current save profile (if any) + string prefsKey = SetSaveProfile.SaveProfile + "_" + flowchart.SubstituteVariables(key); + + PlayerPrefs.DeleteKey(prefsKey); + + Continue(); + } + + public override string GetSummary() + { + if (key.Length == 0) + { + return "Error: No stored value key selected"; + } + + return key; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + #endregion + + #region Editor caches +#if UNITY_EDITOR + protected override void RefreshVariableCache() + { + base.RefreshVariableCache(); + + var f = GetFlowchart(); + + f.DetermineSubstituteVariables(key, referencedVariables); + } +#endif + #endregion Editor caches + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/DeleteSaveKey.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/DeleteSaveKey.cs.meta new file mode 100644 index 0000000..5cc3ac7 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/DeleteSaveKey.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e1205d6641f2146b19d496037f937ba0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Destroy.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Destroy.cs new file mode 100644 index 0000000..27ed738 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Destroy.cs @@ -0,0 +1,81 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Destroys a specified game object in the scene. + /// + [CommandInfo("Scripting", + "Destroy", + "Destroys a specified game object in the scene.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class Destroy : Command + { + [Tooltip("Reference to game object to destroy")] + [SerializeField] protected GameObjectData _targetGameObject; + + [Tooltip("Optional delay given to destroy")] + [SerializeField] + protected FloatData destroyInXSeconds = new FloatData(0); + + #region Public members + + public override void OnEnter() + { + if (_targetGameObject.Value != null) + { + if (destroyInXSeconds.Value != 0) + Destroy(_targetGameObject, destroyInXSeconds.Value); + else + Destroy(_targetGameObject.Value); + } + + Continue(); + } + + public override string GetSummary() + { + if (_targetGameObject.Value == null) + { + return "Error: No game object selected"; + } + + return _targetGameObject.Value.name + (destroyInXSeconds.Value == 0 ? "" : " in " + destroyInXSeconds.Value.ToString()); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (_targetGameObject.gameObjectRef == variable || destroyInXSeconds.floatRef == variable) + return true; + + return false; + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("targetGameObject")] public GameObject targetGameObjectOLD; + + protected virtual void OnEnable() + { + if (targetGameObjectOLD != null) + { + _targetGameObject.Value = targetGameObjectOLD; + targetGameObjectOLD = null; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Destroy.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Destroy.cs.meta new file mode 100644 index 0000000..df4110b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Destroy.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d81be3d7e84da460788dccea95a3313a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/DestroyOnLoad.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/DestroyOnLoad.cs new file mode 100644 index 0000000..91e411b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/DestroyOnLoad.cs @@ -0,0 +1,41 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Calls DontDestroyOnLoad on the target gameobject. + /// + [CommandInfo("Scripting", + "DestroyOnLoad", + "Calls DontDestroyOnLoad on the target gameobject")] + [AddComponentMenu("")] + public class DestroyOnLoad : Command + { + [SerializeField] protected GameObjectData target; + + public override void OnEnter() + { + DontDestroyOnLoad(target.Value); + + Continue(); + } + + public override string GetSummary() + { + return target.Value != null ? target.Value.name : "Error: no target set"; + } + + public override bool HasReference(Variable variable) + { + return variable == target.gameObjectRef; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/DestroyOnLoad.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/DestroyOnLoad.cs.meta new file mode 100644 index 0000000..957b041 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/DestroyOnLoad.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 779fdb236b4ca6343a6d631108388e42 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Else.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Else.cs new file mode 100644 index 0000000..dd31126 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Else.cs @@ -0,0 +1,52 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Marks the start of a command block to be executed when the preceding If statement is False. + /// + [CommandInfo("Flow", + "Else", + "Marks the start of a command block to be executed when the preceding If statement is False.")] + [AddComponentMenu("")] + public class Else : Command + { + #region Public members + + public override void OnEnter() + { + // Find the next End command at the same indent level as this Else command + var matchingEnd = Condition.FindMatchingEndCommand(this); + if (matchingEnd != null) + { + // Execute command immediately after the EndIf command + Continue(matchingEnd.CommandIndex + 1); + } + else + { + // No End command found + StopParentBlock(); + } + } + + public override bool OpenBlock() + { + return true; + } + + public override bool CloseBlock() + { + return true; + } + + public override Color GetButtonColor() + { + return new Color32(253, 253, 150, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Else.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Else.cs.meta new file mode 100644 index 0000000..ec7a31f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Else.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3fa968f01a7f9496bb50e13dfe16760d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ElseIf.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ElseIf.cs new file mode 100644 index 0000000..c5df382 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ElseIf.cs @@ -0,0 +1,28 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Marks the start of a command block to be executed when the preceding If statement is False and the test expression is true. + /// + [CommandInfo("Flow", + "Else If", + "Marks the start of a command block to be executed when the preceding If statement is False and the test expression is true.")] + [AddComponentMenu("")] + public class ElseIf : VariableCondition + { + protected override bool IsElseIf { get { return true; } } + + #region Public members + + public override bool CloseBlock() + { + return true; + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ElseIf.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ElseIf.cs.meta new file mode 100644 index 0000000..343d868 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ElseIf.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 18c5e8d46183346b59f64b820e71f97f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/End.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/End.cs new file mode 100644 index 0000000..1258bac --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/End.cs @@ -0,0 +1,52 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Marks the end of a conditional block. + /// + [CommandInfo("Flow", + "End", + "Marks the end of a conditional block.")] + [AddComponentMenu("")] + public class End : Command + { + #region Public members + + /// + /// Set to true by looping constructs to allow for loops to occur + /// + public virtual bool Loop { get; set; } + + /// + /// Set to the index of the owning looping construct + /// + public virtual int LoopBackIndex { get; set; } + + public override void OnEnter() + { + if (Loop) + { + Continue(LoopBackIndex); + return; + } + + Continue(); + } + + public override bool CloseBlock() + { + return true; + } + + public override Color GetButtonColor() + { + return new Color32(253, 253, 150, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/End.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/End.cs.meta new file mode 100644 index 0000000..b2c4160 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/End.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 93cb9773f2ca04e2bbf7a68ccfc23267 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ExecuteLua.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ExecuteLua.cs new file mode 100644 index 0000000..8f1c058 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ExecuteLua.cs @@ -0,0 +1,213 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using MoonSharp.Interpreter; + +namespace Fungus +{ + /// + /// Executes a Lua code chunk using a Lua Environment. + /// + [CommandInfo("Scripting", + "Execute Lua", + "Executes a Lua code chunk using a Lua Environment.")] + public class ExecuteLua : Command + { + [Tooltip("Lua Environment to use to execute this Lua script")] + [SerializeField] protected LuaEnvironment luaEnvironment; + + [Tooltip("A text file containing Lua script to execute.")] + [SerializeField] protected TextAsset luaFile; + + [TextArea(10,100)] + [Tooltip("Lua script to execute. This text is appended to the contents of Lua file (if one is specified).")] + [SerializeField] protected string luaScript; + + [Tooltip("Execute this Lua script as a Lua coroutine")] + [SerializeField] protected bool runAsCoroutine = true; + + [Tooltip("Pause command execution until the Lua script has finished execution")] + [SerializeField] protected bool waitUntilFinished = true; + + [Tooltip("A Flowchart variable to store the returned value in.")] + [VariableProperty()] + [SerializeField] protected Variable returnVariable; + + protected string friendlyName = ""; + + protected bool initialised; + + // Stores the compiled Lua code for fast execution later. + protected Closure luaFunction; + + protected virtual void Start() + { + InitExecuteLua(); + } + + /// + /// Initialises the Lua environment and compiles the Lua string for execution later on. + /// + protected virtual void InitExecuteLua() + { + if (initialised) + { + return; + } + + // Cache a descriptive name to use in Lua error messages + friendlyName = gameObject.name + "." + ParentBlock.BlockName + "." + "ExecuteLua #" + CommandIndex.ToString(); + + var flowchart = GetFlowchart(); + + // See if a Lua Environment has been assigned to this Flowchart + if (luaEnvironment == null) + { + luaEnvironment = flowchart.LuaEnv; + } + + if (luaEnvironment == null) + { + // No Lua Environment specified so just use any available or create one. + luaEnvironment = LuaEnvironment.GetLua(); + } + + string s = GetLuaString(); + luaFunction = luaEnvironment.LoadLuaFunction(s, friendlyName); + + // Add a binding to the parent flowchart + if (flowchart.LuaBindingName != "") + { + Table globals = luaEnvironment.Interpreter.Globals; + if (globals != null) + { + globals[flowchart.LuaBindingName] = flowchart; + } + } + + // Always initialise when playing in the editor. + // Allows the user to edit the Lua script while the game is playing. + if ( !(Application.isPlaying && Application.isEditor) ) + { + initialised = true; + } + + } + + protected virtual string GetLuaString() + { + if (luaFile == null) + { + return luaScript; + } + + return luaFile.text + "\n" + luaScript; + } + + protected virtual void StoreReturnVariable(DynValue returnValue) + { + if (returnVariable == null || returnValue == null) + { + return; + } + + // Store the return value in a Fungus Variable + System.Type variableType = returnVariable.GetType(); + if (variableType == typeof(BooleanVariable) && returnValue.Type == DataType.Boolean) + { + (returnVariable as BooleanVariable).Value = returnValue.Boolean; + } + else if (variableType == typeof(IntegerVariable) && returnValue.Type == DataType.Number) + { + (returnVariable as IntegerVariable).Value = (int)returnValue.Number; + } + else if (variableType == typeof(FloatVariable) && returnValue.Type == DataType.Number) + { + (returnVariable as FloatVariable).Value = (float)returnValue.Number; + } + else if (variableType == typeof(StringVariable) && returnValue.Type == DataType.String) + { + (returnVariable as StringVariable).Value = returnValue.String; + } + else if (variableType == typeof(ColorVariable) && returnValue.Type == DataType.UserData) + { + (returnVariable as ColorVariable).Value = returnValue.CheckUserDataType("ExecuteLua.StoreReturnVariable"); + } + else if (variableType == typeof(GameObjectVariable) && returnValue.Type == DataType.UserData) + { + (returnVariable as GameObjectVariable).Value = returnValue.CheckUserDataType("ExecuteLua.StoreReturnVariable"); + } + else if (variableType == typeof(MaterialVariable) && returnValue.Type == DataType.UserData) + { + (returnVariable as MaterialVariable).Value = returnValue.CheckUserDataType("ExecuteLua.StoreReturnVariable"); + } + else if (variableType == typeof(ObjectVariable) && returnValue.Type == DataType.UserData) + { + (returnVariable as ObjectVariable).Value = returnValue.CheckUserDataType("ExecuteLua.StoreReturnVariable"); + } + else if (variableType == typeof(SpriteVariable) && returnValue.Type == DataType.UserData) + { + (returnVariable as SpriteVariable).Value = returnValue.CheckUserDataType("ExecuteLua.StoreReturnVariable"); + } + else if (variableType == typeof(TextureVariable) && returnValue.Type == DataType.UserData) + { + (returnVariable as TextureVariable).Value = returnValue.CheckUserDataType("ExecuteLua.StoreReturnVariable"); + } + else if (variableType == typeof(Vector2Variable) && returnValue.Type == DataType.UserData) + { + (returnVariable as Vector2Variable).Value = returnValue.CheckUserDataType("ExecuteLua.StoreReturnVariable"); + } + else if (variableType == typeof(Vector3Variable) && returnValue.Type == DataType.UserData) + { + (returnVariable as Vector3Variable).Value = returnValue.CheckUserDataType("ExecuteLua.StoreReturnVariable"); + } + else + { + Debug.LogError("Failed to convert " + returnValue.Type.ToLuaTypeString() + " return type to " + variableType.ToString()); + } + } + + #region Public members + + public override void OnEnter() + { + InitExecuteLua(); + + if (luaFunction == null) + { + Continue(); + } + + luaEnvironment.RunLuaFunction(luaFunction, runAsCoroutine, (returnValue) => { + StoreReturnVariable(returnValue); + if (waitUntilFinished) + { + Continue(); + } + }); + + if (!waitUntilFinished) + { + Continue(); + } + } + + public override string GetSummary() + { + return luaScript; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + return returnVariable == variable || base.HasReference(variable); + } + + #endregion + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ExecuteLua.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ExecuteLua.cs.meta new file mode 100644 index 0000000..f640a27 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ExecuteLua.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 71f455683d4ba4405b8dbba457159620 +timeCreated: 1456398214 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeScreen.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeScreen.cs new file mode 100644 index 0000000..a84fb48 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeScreen.cs @@ -0,0 +1,76 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Draws a fullscreen texture over the scene to give a fade effect. Setting Target Alpha to 1 will obscure the screen, alpha 0 will reveal the screen. + /// If no Fade Texture is provided then a default flat color texture is used. + /// + [CommandInfo("Camera", + "Fade Screen", + "Draws a fullscreen texture over the scene to give a fade effect. Setting Target Alpha to 1 will obscure the screen, alpha 0 will reveal the screen. " + + "If no Fade Texture is provided then a default flat color texture is used.")] + [AddComponentMenu("")] + public class FadeScreen : Command + { + [Tooltip("Time for fade effect to complete")] + [SerializeField] protected float duration = 1f; + + [Tooltip("Current target alpha transparency value. The fade gradually adjusts the alpha to approach this target value.")] + [SerializeField] protected float targetAlpha = 1f; + + [Tooltip("Wait until the fade has finished before executing next command")] + [SerializeField] protected bool waitUntilFinished = true; + + [Tooltip("Color to render fullscreen fade texture with when screen is obscured.")] + [SerializeField] protected Color fadeColor = Color.black; + + [Tooltip("Optional texture to use when rendering the fullscreen fade effect.")] + [SerializeField] protected Texture2D fadeTexture; + + [SerializeField] protected LeanTweenType fadeTweenType = LeanTweenType.easeInOutQuad; + + #region Public members + + public override void OnEnter() + { + var cameraManager = FungusManager.Instance.CameraManager; + + if (fadeTexture) + { + cameraManager.ScreenFadeTexture = fadeTexture; + } + else + { + cameraManager.ScreenFadeTexture = CameraManager.CreateColorTexture(fadeColor, 32, 32); + } + + cameraManager.Fade(targetAlpha, duration, delegate { + if (waitUntilFinished) + { + Continue(); + } + }, fadeTweenType); + + if (!waitUntilFinished) + { + Continue(); + } + } + + public override string GetSummary() + { + return "Fade to " + targetAlpha + " over " + duration + " seconds"; + } + + public override Color GetButtonColor() + { + return new Color32(216, 228, 170, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeScreen.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeScreen.cs.meta new file mode 100644 index 0000000..176a491 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeScreen.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 207aecf668a0345388087ccf522f9957 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeSprite.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeSprite.cs new file mode 100644 index 0000000..8c8dadd --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeSprite.cs @@ -0,0 +1,98 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Fades a sprite to a target color over a period of time. + /// + [CommandInfo("Sprite", + "Fade Sprite", + "Fades a sprite to a target color over a period of time.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class FadeSprite : Command + { + [Tooltip("Sprite object to be faded")] + [SerializeField] protected SpriteRenderer spriteRenderer; + + [Tooltip("Length of time to perform the fade")] + [SerializeField] protected FloatData _duration = new FloatData(1f); + + [Tooltip("Target color to fade to. To only fade transparency level, set the color to white and set the alpha to required transparency.")] + [SerializeField] protected ColorData _targetColor = new ColorData(Color.white); + + [Tooltip("Wait until the fade has finished before executing the next command")] + [SerializeField] protected bool waitUntilFinished = true; + + #region Public members + + public override void OnEnter() + { + if (spriteRenderer == null) + { + Continue(); + return; + } + + SpriteFader.FadeSprite(spriteRenderer, _targetColor.Value, _duration.Value, Vector2.zero, delegate { + if (waitUntilFinished) + { + Continue(); + } + }); + + if (!waitUntilFinished) + { + Continue(); + } + } + + public override string GetSummary() + { + if (spriteRenderer == null) + { + return "Error: No sprite renderer selected"; + } + + return spriteRenderer.name + " to " + _targetColor.Value.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(221, 184, 169, 255); + } + + public override bool HasReference(Variable variable) + { + return _duration.floatRef == variable || _targetColor.colorRef == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; + [HideInInspector] [FormerlySerializedAs("targetColor")] public Color targetColorOLD; + + protected virtual void OnEnable() + { + if (durationOLD != default(float)) + { + _duration.Value = durationOLD; + durationOLD = default(float); + } + if (targetColorOLD != default(Color)) + { + _targetColor.Value = targetColorOLD; + targetColorOLD = default(Color); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeSprite.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeSprite.cs.meta new file mode 100644 index 0000000..a02bdc1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeSprite.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: accc065c3e9a6457496f075b1bd49adc +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeToView.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeToView.cs new file mode 100644 index 0000000..5af59d3 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeToView.cs @@ -0,0 +1,129 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Fades the camera out and in again at a position specified by a View object. + /// + [CommandInfo("Camera", + "Fade To View", + "Fades the camera out and in again at a position specified by a View object.")] + [AddComponentMenu("")] + public class FadeToView : Command + { + [Tooltip("Time for fade effect to complete")] + [SerializeField] protected float duration = 1f; + + [Tooltip("Fade from fully visible to opaque at start of fade")] + [SerializeField] protected bool fadeOut = true; + + [Tooltip("View to transition to when Fade is complete")] + [SerializeField] protected View targetView; + + [Tooltip("Wait until the fade has finished before executing next command")] + [SerializeField] protected bool waitUntilFinished = true; + + [Tooltip("Color to render fullscreen fade texture with when screen is obscured.")] + [SerializeField] protected Color fadeColor = Color.black; + + [Tooltip("Optional texture to use when rendering the fullscreen fade effect.")] + [SerializeField] protected Texture2D fadeTexture; + + [Tooltip("Camera to use for the fade. Will use main camera if set to none.")] + [SerializeField] protected Camera targetCamera; + + [SerializeField] protected LeanTweenType fadeTweenType = LeanTweenType.easeInOutQuad; + [SerializeField] protected LeanTweenType orthoSizeTweenType = LeanTweenType.easeInOutQuad; + [SerializeField] protected LeanTweenType posTweenType = LeanTweenType.easeInOutQuad; + [SerializeField] protected LeanTweenType rotTweenType = LeanTweenType.easeInOutQuad; + + protected virtual void Start() + { + AcquireCamera(); + } + + protected virtual void AcquireCamera() + { + if (targetCamera != null) + { + return; + } + + targetCamera = Camera.main; + if (targetCamera == null) + { + targetCamera = GameObject.FindObjectOfType(); + } + } + + #region Public members + + /// + /// View to transition to when Fade is complete + /// + public virtual View TargetView { get { return targetView; } } + + public override void OnEnter() + { + AcquireCamera(); + if (targetCamera == null || + targetView == null) + { + Continue(); + return; + } + + var cameraManager = FungusManager.Instance.CameraManager; + + if (fadeTexture) + { + cameraManager.ScreenFadeTexture = fadeTexture; + } + else + { + cameraManager.ScreenFadeTexture = CameraManager.CreateColorTexture(fadeColor, 32, 32); + } + + cameraManager.FadeToView(targetCamera, targetView, duration, fadeOut, delegate { + if (waitUntilFinished) + { + Continue(); + } + }, fadeTweenType, orthoSizeTweenType, posTweenType, rotTweenType); + + if (!waitUntilFinished) + { + Continue(); + } + } + + public override void OnStopExecuting() + { + var cameraManager = FungusManager.Instance.CameraManager; + + cameraManager.Stop(); + } + + 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); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeToView.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeToView.cs.meta new file mode 100644 index 0000000..c4c1844 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeToView.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 437f9a4e3dbc647f9bdce95308418bff +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeUI.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeUI.cs new file mode 100644 index 0000000..2124a2a --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeUI.cs @@ -0,0 +1,251 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.UI; + +namespace Fungus +{ + /// + /// Select which type of fade will be applied. + /// + public enum FadeMode + { + /// Fade the alpha color component only. + Alpha, + /// Fade all color components (RGBA). + Color + } + + /// + /// Fades a UI object. + /// + [CommandInfo("UI", + "Fade UI", + "Fades a UI object")] + public class FadeUI : TweenUI + { + [SerializeField] protected FadeMode fadeMode = FadeMode.Alpha; + + [SerializeField] protected ColorData targetColor = new ColorData(Color.white); + + [SerializeField] protected FloatData targetAlpha = new FloatData(1f); + + protected override void ApplyTween(GameObject go) + { + var images = go.GetComponentsInChildren(); + for (int i = 0; i < images.Length; i++) + { + var image = images[i]; + if (Mathf.Approximately(duration, 0f)) + { + switch (fadeMode) + { + case FadeMode.Alpha: + Color tempColor = image.color; + tempColor.a = targetAlpha; + image.color = tempColor; + break; + case FadeMode.Color: + image.color = targetColor; + break; + } + } + else + { + switch (fadeMode) + { + case FadeMode.Alpha: + LeanTween.alpha(image.rectTransform, targetAlpha, duration).setEase(tweenType).setEase(tweenType); + break; + case FadeMode.Color: + LeanTween.color(image.rectTransform, targetColor, duration).setEase(tweenType).setEase(tweenType); + break; + } + } + } + + var texts = go.GetComponentsInChildren(); + for (int i = 0; i < texts.Length; i++) + { + var text = texts[i]; + if (Mathf.Approximately(duration, 0f)) + { + switch (fadeMode) + { + case FadeMode.Alpha: + Color tempColor = text.color; + tempColor.a = targetAlpha; + text.color = tempColor; + break; + case FadeMode.Color: + text.color = targetColor; + break; + } + } + else + { + switch (fadeMode) + { + case FadeMode.Alpha: + LeanTween.textAlpha(text.rectTransform, targetAlpha, duration).setEase(tweenType); + break; + case FadeMode.Color: + LeanTween.textColor(text.rectTransform, targetColor, duration).setEase(tweenType); + break; + } + } + } + + var textMeshes = go.GetComponentsInChildren(); + for (int i = 0; i < textMeshes.Length; i++) + { + var textMesh = textMeshes[i]; + if (Mathf.Approximately(duration, 0f)) + { + switch (fadeMode) + { + case FadeMode.Alpha: + Color tempColor = textMesh.color; + tempColor.a = targetAlpha; + textMesh.color = tempColor; + break; + case FadeMode.Color: + textMesh.color = targetColor; + break; + } + } + else + { + switch (fadeMode) + { + case FadeMode.Alpha: + LeanTween.alpha(go, targetAlpha, duration).setEase(tweenType); + break; + case FadeMode.Color: + LeanTween.color(go, targetColor, duration).setEase(tweenType); + break; + } + } + } + +#if UNITY_2018_1_OR_NEWER + var tmpros = go.GetComponentsInChildren(); + for (int i = 0; i < tmpros.Length; i++) + { + + var tmpro = tmpros[i]; + if (Mathf.Approximately(duration, 0f)) + { + switch (fadeMode) + { + case FadeMode.Alpha: + Color tempColor = tmpro.color; + tempColor.a = targetAlpha; + tmpro.color = tempColor; + break; + case FadeMode.Color: + tmpro.color = targetColor; + break; + } + } + else + { + switch (fadeMode) + { + case FadeMode.Alpha: + LeanTween.value(tmpro.gameObject, tmpro.color.a, targetAlpha.Value, duration) + .setEase(tweenType) + .setOnUpdate((float alphaValue) => + { + Color tempColor = tmpro.color; + tempColor.a = alphaValue; + tmpro.color = tempColor; + }); + break; + case FadeMode.Color: + LeanTween.value(tmpro.gameObject, tmpro.color, targetColor.Value, duration) + .setEase(tweenType) + .setOnUpdate((Color colorValue) => + { + tmpro.color = colorValue; + }); + break; + } + } + } +#endif + //canvas groups don't support color but we can anim the alpha IN the color + var canvasGroups = go.GetComponentsInChildren(); + for (int i = 0; i < canvasGroups.Length; i++) + { + var canvasGroup = canvasGroups[i]; + if (Mathf.Approximately(duration, 0f)) + { + switch (fadeMode) + { + case FadeMode.Alpha: + canvasGroup.alpha = targetAlpha.Value; + break; + case FadeMode.Color: + canvasGroup.alpha = targetColor.Value.a; + break; + } + } + else + { + switch (fadeMode) + { + case FadeMode.Alpha: + LeanTween.alphaCanvas(canvasGroup, targetAlpha, duration).setEase(tweenType); + break; + case FadeMode.Color: + LeanTween.alphaCanvas(canvasGroup, targetColor.Value.a, duration).setEase(tweenType); + break; + } + } + } + } + + protected override string GetSummaryValue() + { + if (fadeMode == FadeMode.Alpha) + { + return targetAlpha.Value.ToString() + " alpha"; + } + else if (fadeMode == FadeMode.Color) + { + return targetColor.Value.ToString() + " color"; + } + + return ""; + } + + #region Public members + + public override bool IsPropertyVisible(string propertyName) + { + if (fadeMode == FadeMode.Alpha && + propertyName == "targetColor") + { + return false; + } + + if (fadeMode == FadeMode.Color && + propertyName == "targetAlpha") + { + return false; + } + + return true; + } + + public override bool HasReference(Variable variable) + { + return targetColor.colorRef == variable || targetAlpha.floatRef == variable || + base.HasReference(variable); + } + + #endregion + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeUI.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeUI.cs.meta new file mode 100644 index 0000000..d04d3d1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/FadeUI.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5c6dd8d3a780f4d1ea772e3daf10c372 +timeCreated: 1444819884 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/FromString.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/FromString.cs new file mode 100644 index 0000000..6ce8316 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/FromString.cs @@ -0,0 +1,82 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Attempts to parse a string into a given fungus variable type, such as integer or float + /// + [CommandInfo("Variable", + "From String", + "Attempts to parse a string into a given fungus variable type, such as integer or float")] + [AddComponentMenu("")] + public class FromString : Command + { + [Tooltip("Source of string data to parse into another variables value")] + [VariableProperty(typeof(StringVariable))] + [SerializeField] protected StringVariable sourceString; + + [Tooltip("The variable type to be parsed and value stored within")] + [VariableProperty(typeof(IntegerVariable), typeof(FloatVariable))] + [SerializeField] protected Variable outValue; + + public override void OnEnter() + { + if (sourceString != null && outValue != null) + { + double asDouble = 0; + try + { + asDouble = System.Convert.ToDouble(sourceString.Value, System.Globalization.CultureInfo.CurrentCulture); + } + catch (System.Exception) + { + Debug.LogWarning("Failed to parse as number: " + sourceString.Value); + } + + IntegerVariable intOutVar = outValue as IntegerVariable; + if (intOutVar != null) + { + intOutVar.Value = (int)asDouble; + } + else + { + FloatVariable floatOutVar = outValue as FloatVariable; + if (floatOutVar != null) + { + floatOutVar.Value = (float)asDouble; + } + } + } + + Continue(); + } + + public override string GetSummary() + { + if (sourceString == null) + { + return "Error: No source string selected"; + } + + if (outValue == null) + { + return "Error: No type and storage variable selected"; + } + + return outValue.Key + ".Parse " + sourceString.Key; + } + + public override bool HasReference(Variable variable) + { + return (variable == sourceString) || (variable == outValue); + } + + public override Color GetButtonColor() + { + return new Color32(253, 253, 150, 255); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/FromString.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/FromString.cs.meta new file mode 100644 index 0000000..a565d24 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/FromString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 51296c2a224eea64daa8c7b9c5c644fa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Fullscreen.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Fullscreen.cs new file mode 100644 index 0000000..487faab --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Fullscreen.cs @@ -0,0 +1,64 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Fullscreen mode options. + /// + public enum FullscreenMode + { + /// Toggle the current mode between fullscreen and windowed. + Toggle, + /// Switch to fullscreen mode. + Fullscreen, + /// Switch to windowed mode. + Windowed + } + + /// + /// Sets the application to fullscreen, windowed or toggles the current state. + /// + [CommandInfo("Camera", + "Fullscreen", + "Sets the application to fullscreen, windowed or toggles the current state.")] + [AddComponentMenu("")] + public class Fullscreen : Command + { + [SerializeField] protected FullscreenMode fullscreenMode; + + #region Public members + + public override void OnEnter() + { + switch (fullscreenMode) + { + case FullscreenMode.Toggle: + Screen.fullScreen = !Screen.fullScreen; + break; + case FullscreenMode.Fullscreen: + Screen.fullScreen = true; + break; + case FullscreenMode.Windowed: + Screen.fullScreen = false; + break; + } + + Continue(); + } + + public override string GetSummary() + { + return fullscreenMode.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(216, 228, 170, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Fullscreen.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Fullscreen.cs.meta new file mode 100644 index 0000000..5f3e862 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Fullscreen.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 083836d4b33584c1aaf7d1eb57b02ba0 +timeCreated: 1434460163 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/GetText.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/GetText.cs new file mode 100644 index 0000000..affcc89 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/GetText.cs @@ -0,0 +1,91 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Gets the text property from a UI Text object and stores it in a string variable. + /// + [CommandInfo("UI", + "Get Text", + "Gets the text property from a UI Text object and stores it in a string variable.")] + [AddComponentMenu("")] + public class GetText : Command + { + [Tooltip("Text object to get text value from")] + [SerializeField] protected GameObject targetTextObject; + + [Tooltip("String variable to store the text value in")] + [VariableProperty(typeof(StringVariable))] + [SerializeField] protected StringVariable stringVariable; + + #region Public members + + public override void OnEnter() + { + if (stringVariable == null) + { + Continue(); + return; + } + + TextAdapter textAdapter = new TextAdapter(); + textAdapter.InitFromGameObject(targetTextObject); + + if (textAdapter.HasTextObject()) + { + stringVariable.Value = textAdapter.Text; + } + + Continue(); + } + + public override string GetSummary() + { + if (targetTextObject == null) + { + return "Error: No text object selected"; + } + + if (stringVariable == null) + { + return "Error: No variable selected"; + } + + return targetTextObject.name + " : " + stringVariable.name; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + return stringVariable == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + // Backwards compatibility with Fungus v2.1.2 + [HideInInspector] + [FormerlySerializedAs("textObject")] + public Text _textObjectObsolete; + protected virtual void OnEnable() + { + if (_textObjectObsolete != null) + { + targetTextObject = _textObjectObsolete.gameObject; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/GetText.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/GetText.cs.meta new file mode 100644 index 0000000..00d1ea8 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/GetText.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e889853a4ba0b446d97008a78fa4cf1e +timeCreated: 1438782803 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/GetToggleState.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/GetToggleState.cs new file mode 100644 index 0000000..e876118 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/GetToggleState.cs @@ -0,0 +1,65 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.UI; + +namespace Fungus +{ + /// + /// Gets the state of a toggle UI object and stores it in a boolean variable. + /// + [CommandInfo("UI", + "Get Toggle State", + "Gets the state of a toggle UI object and stores it in a boolean variable.")] + public class GetToggleState : Command + { + [Tooltip("Target toggle object to get the value from")] + [SerializeField] protected Toggle toggle; + + [Tooltip("Boolean variable to store the state of the toggle value in.")] + [VariableProperty(typeof(BooleanVariable))] + [SerializeField] protected BooleanVariable toggleState; + + #region Public members + + public override void OnEnter() + { + if (toggle != null && + toggleState != null) + { + toggleState.Value = toggle.isOn; + } + + Continue(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override string GetSummary() + { + if (toggle == null) + { + return "Error: Toggle object not selected"; + } + + if (toggleState == null) + { + return "Error: Toggle state variable not selected"; + } + + return toggle.name; + } + + public override bool HasReference(Variable variable) + { + return toggleState == variable || + base.HasReference(variable); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/GetToggleState.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/GetToggleState.cs.meta new file mode 100644 index 0000000..b3c3fb1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/GetToggleState.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9750f780c39234a028f87c0016c2d9c0 +timeCreated: 1476363990 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/If.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/If.cs new file mode 100644 index 0000000..efeb850 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/If.cs @@ -0,0 +1,18 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// If the test expression is true, execute the following command block. + /// + [CommandInfo("Flow", + "If", + "If the test expression is true, execute the following command block.")] + [AddComponentMenu("")] + public class If : VariableCondition + { + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/If.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/If.cs.meta new file mode 100644 index 0000000..c0814d7 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/If.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 70c5622b8a80845c980954170295f292 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Input.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Input.meta new file mode 100644 index 0000000..8d13dfa --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Input.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 90098f8abed37d1418f36896e7e1279d +folderAsset: yes +timeCreated: 1503744400 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetAxis.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetAxis.cs new file mode 100644 index 0000000..364271a --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetAxis.cs @@ -0,0 +1,63 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Fungus +{ + // + /// Store Input.GetAxis in a variable + /// + [CommandInfo("Input", + "GetAxis", + "Store Input.GetAxis in a variable")] + [AddComponentMenu("")] + public class GetAxis : Command + { + [SerializeField] + protected StringData axisName; + + [Tooltip("If true, calls GetAxisRaw instead of GetAxis")] + [SerializeField] + protected bool axisRaw = false; + + [Tooltip("Float to store the value of the GetAxis")] + [SerializeField] + protected FloatData outValue; + + public override void OnEnter() + { + if (axisRaw) + { + outValue.Value = Input.GetAxisRaw(axisName.Value); + } + else + { + outValue.Value = Input.GetAxis(axisName.Value); + } + + Continue(); + } + + public override string GetSummary() + { + return axisName + (axisRaw ? " Raw" : ""); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (axisName.stringRef == variable || outValue.floatRef == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetAxis.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetAxis.cs.meta new file mode 100644 index 0000000..3c3eef2 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetAxis.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bb18ee740f55ba24680c15466ff13ece +timeCreated: 1503744409 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetKey.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetKey.cs new file mode 100644 index 0000000..4a7f31f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetKey.cs @@ -0,0 +1,177 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + // + /// Store Input.GetKey in a variable. Supports an optional Negative key input. A negative value will be overridden by a positive one, they do not add. + /// + [CommandInfo("Input", + "GetKey", + "Store Input.GetKey in a variable. Supports an optional Negative key input. A negative value will be overridden by a positive one, they do not add.")] + [AddComponentMenu("")] + public class GetKey : Command + { + [SerializeField] + protected KeyCode keyCode = KeyCode.None; + + [Tooltip("Optional, secondary or negative keycode. For booleans will also set to true, for int and float will set to -1.")] + [SerializeField] + protected KeyCode keyCodeNegative = KeyCode.None; + + [SerializeField] + [Tooltip("Only used if KeyCode is KeyCode.None, expects a name of the key to use.")] + protected StringData keyCodeName = new StringData(string.Empty); + + [SerializeField] + [Tooltip("Optional, secondary or negative keycode. For booleans will also set to true, for int and float will set to -1." + + "Only used if KeyCode is KeyCode.None, expects a name of the key to use.")] + protected StringData keyCodeNameNegative = new StringData(string.Empty); + + public enum InputKeyQueryType + { + Down, + Up, + State + } + + [Tooltip("Do we want an Input.GetKeyDown, GetKeyUp or GetKey")] + [SerializeField] + protected InputKeyQueryType keyQueryType = InputKeyQueryType.State; + + [Tooltip("Will store true or false or 0 or 1 depending on type. Sets true or -1 for negative key values.")] + [SerializeField] + [VariableProperty(typeof(FloatVariable), typeof(BooleanVariable), typeof(IntegerVariable))] + protected Variable outValue; + + public override void OnEnter() + { + FillOutValue(0); + + if (keyCodeNegative != KeyCode.None) + { + DoKeyCode(keyCodeNegative, -1); + } + else if (!string.IsNullOrEmpty(keyCodeNameNegative)) + { + DoKeyName(keyCodeNameNegative, -1); + } + + + if (keyCode != KeyCode.None) + { + DoKeyCode(keyCode, 1); + } + else if (!string.IsNullOrEmpty(keyCodeName)) + { + DoKeyName(keyCodeName, 1); + } + + Continue(); + } + + private void DoKeyCode(KeyCode key, int trueVal) + { + switch (keyQueryType) + { + case InputKeyQueryType.Down: + if (Input.GetKeyDown(key)) + { + FillOutValue(trueVal); + } + break; + case InputKeyQueryType.Up: + if (Input.GetKeyUp(key)) + { + FillOutValue(trueVal); + } + break; + case InputKeyQueryType.State: + if (Input.GetKey(key)) + { + FillOutValue(trueVal); + } + break; + default: + break; + } + } + + private void DoKeyName(string key, int trueVal) + { + switch (keyQueryType) + { + case InputKeyQueryType.Down: + if (Input.GetKeyDown(key)) + { + FillOutValue(trueVal); + } + break; + case InputKeyQueryType.Up: + if (Input.GetKeyUp(key)) + { + FillOutValue(trueVal); + } + break; + case InputKeyQueryType.State: + if (Input.GetKey(key)) + { + FillOutValue(trueVal); + } + break; + default: + break; + } + } + + private void FillOutValue(int v) + { + FloatVariable fvar = outValue as FloatVariable; + if (fvar != null) + { + fvar.Value = v; + return; + } + + BooleanVariable bvar = outValue as BooleanVariable; + if (bvar != null) + { + bvar.Value = v == 0 ? false : true; + return; + } + + IntegerVariable ivar = outValue as IntegerVariable; + if (ivar != null) + { + ivar.Value = v; + return; + } + } + + public override string GetSummary() + { + if (outValue == null) + { + return "Error: no outvalue set"; + } + + return (keyCode != KeyCode.None ? keyCode.ToString() : keyCodeName) + " in " + outValue.Key; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (keyCodeName.stringRef == variable || outValue == variable || keyCodeNameNegative.stringRef == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetKey.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetKey.cs.meta new file mode 100644 index 0000000..d821cc1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetKey.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: abf9e2e4334293449850759c812dd9db +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetMousePosition.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetMousePosition.cs new file mode 100644 index 0000000..d2325f3 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetMousePosition.cs @@ -0,0 +1,89 @@ +using UnityEngine; + +namespace Fungus +{ + // + /// Store Input.mousePosition and mouse screen conversions in a variable(s) + /// + [CommandInfo("Input", + "Get Mouse Position", + "Store various interpretations of Input.mousePosition")] + [AddComponentMenu("")] + public class GetMousePosition : Command + { + [VariableProperty(typeof(Vector2Variable))] + [SerializeField] + protected Vector2Variable screenPosition; + + [Tooltip("If null, Camera.main is used")] + protected Camera castCamera; + + [VariableProperty(typeof(Vector2Variable))] + [SerializeField] + protected Vector2Variable viewPosition; + + [VariableProperty(typeof(Vector3Variable))] + [SerializeField] + protected Vector3Variable worldPosition; + + [VariableProperty(typeof(Vector3Variable))] + [SerializeField] + protected Vector3Variable worldDirection; + + public override void OnEnter() + { + if (castCamera == null) + { + castCamera = Camera.main; + } + + if (screenPosition != null) + { + screenPosition.Value = Input.mousePosition; + } + + if (viewPosition != null) + { + viewPosition.Value = castCamera.ScreenToViewportPoint(Input.mousePosition); + } + + if (worldPosition != null) + { + var screenWithZ = Input.mousePosition; + screenWithZ.z = castCamera.nearClipPlane; + worldPosition.Value = castCamera.ScreenToWorldPoint(screenWithZ); + } + + if (worldDirection != null) + { + var screenWithZ = Input.mousePosition; + screenWithZ.z = castCamera.nearClipPlane; + worldDirection.Value = castCamera.ScreenPointToRay(screenWithZ).direction; + } + + Continue(); + } + + public override string GetSummary() + { + return (screenPosition != null ? screenPosition.Key + " " : "") + + (castCamera != null ? castCamera.name + " " : "MainCam") + + (viewPosition != null ? viewPosition.Key + " " : "") + + (worldPosition != null ? worldPosition.Key + " " : "") + + (worldDirection != null ? worldDirection.Key + " " : ""); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + return (screenPosition == variable || + viewPosition == variable || + worldPosition == variable || + worldDirection == variable); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetMousePosition.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetMousePosition.cs.meta new file mode 100644 index 0000000..8ac8911 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Input/GetMousePosition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb32240870e5bf545a0dafba446d3990 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/InvokeEvent.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/InvokeEvent.cs new file mode 100644 index 0000000..f84465c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/InvokeEvent.cs @@ -0,0 +1,165 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using System; +using UnityEngine.Events; + +namespace Fungus +{ + /// + /// Supported types of method invocation. + /// + public enum InvokeType + { + /// Call a method with an optional constant value parameter. + Static, // + /// Call a method with an optional boolean constant / variable parameter. + DynamicBoolean, + /// Call a method with an optional integer constant / variable parameter. + DynamicInteger, + /// Call a method with an optional float constant / variable parameter. + DynamicFloat, + /// Call a method with an optional string constant / variable parameter. + DynamicString + } + + /// + /// Calls a list of component methods via the Unity Event System (as used in the Unity UI) + /// This command is more efficient than the Invoke Method command but can only pass a single parameter and doesn't support return values. + /// This command uses the UnityEvent system to call methods in script. http://docs.unity3d.com/Manual/UnityEvents.html + /// + [CommandInfo("Scripting", + "Invoke Event", + "Calls a list of component methods via the Unity Event System (as used in the Unity UI). " + + "This command is more efficient than the Invoke Method command but can only pass a single parameter and doesn't support return values.")] + [AddComponentMenu("")] + public class InvokeEvent : Command + { + [Tooltip("A description of what this command does. Appears in the command summary.")] + [SerializeField] protected string description = ""; + + [Tooltip("Delay (in seconds) before the methods will be called")] + [SerializeField] protected float delay; + + [Tooltip("Selects type of method parameter to pass")] + [SerializeField] protected InvokeType invokeType; + + [Tooltip("List of methods to call. Supports methods with no parameters or exactly one string, int, float or object parameter.")] + [SerializeField] protected UnityEvent staticEvent = new UnityEvent(); + + [Tooltip("Boolean parameter to pass to the invoked methods.")] + [SerializeField] protected BooleanData booleanParameter; + + [Tooltip("List of methods to call. Supports methods with one boolean parameter.")] + [SerializeField] protected BooleanEvent booleanEvent = new BooleanEvent(); + + [Tooltip("Integer parameter to pass to the invoked methods.")] + [SerializeField] protected IntegerData integerParameter; + + [Tooltip("List of methods to call. Supports methods with one integer parameter.")] + [SerializeField] protected IntegerEvent integerEvent = new IntegerEvent(); + + [Tooltip("Float parameter to pass to the invoked methods.")] + [SerializeField] protected FloatData floatParameter; + + [Tooltip("List of methods to call. Supports methods with one float parameter.")] + [SerializeField] protected FloatEvent floatEvent = new FloatEvent(); + + [Tooltip("String parameter to pass to the invoked methods.")] + [SerializeField] protected StringDataMulti stringParameter; + + [Tooltip("List of methods to call. Supports methods with one string parameter.")] + [SerializeField] protected StringEvent stringEvent = new StringEvent(); + + protected virtual void DoInvoke() + { + switch (invokeType) + { + default: + case InvokeType.Static: + staticEvent.Invoke(); + break; + case InvokeType.DynamicBoolean: + booleanEvent.Invoke(booleanParameter.Value); + break; + case InvokeType.DynamicInteger: + integerEvent.Invoke(integerParameter.Value); + break; + case InvokeType.DynamicFloat: + floatEvent.Invoke(floatParameter.Value); + break; + case InvokeType.DynamicString: + stringEvent.Invoke(stringParameter.Value); + break; + } + } + + #region Public members + + [Serializable] public class BooleanEvent : UnityEvent {} + [Serializable] public class IntegerEvent : UnityEvent {} + [Serializable] public class FloatEvent : UnityEvent {} + [Serializable] public class StringEvent : UnityEvent {} + + public override void OnEnter() + { + if (Mathf.Approximately(delay, 0f)) + { + DoInvoke(); + } + else + { + Invoke("DoInvoke", delay); + } + + Continue(); + } + + public override string GetSummary() + { + if (!string.IsNullOrEmpty(description)) + { + return description; + } + + string summary = invokeType.ToString() + " "; + + switch (invokeType) + { + default: + case InvokeType.Static: + summary += staticEvent.GetPersistentEventCount(); + break; + case InvokeType.DynamicBoolean: + summary += booleanEvent.GetPersistentEventCount(); + break; + case InvokeType.DynamicInteger: + summary += integerEvent.GetPersistentEventCount(); + break; + case InvokeType.DynamicFloat: + summary += floatEvent.GetPersistentEventCount(); + break; + case InvokeType.DynamicString: + summary += stringEvent.GetPersistentEventCount(); + break; + } + + return summary + " methods"; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + return booleanParameter.booleanRef == variable || integerParameter.integerRef == variable || + floatParameter.floatRef == variable || stringParameter.stringRef == variable || + base.HasReference(variable); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/InvokeEvent.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/InvokeEvent.cs.meta new file mode 100644 index 0000000..c9967c8 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/InvokeEvent.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 95d9ff288f3904c05ada7ac9c9a075bb +timeCreated: 1436969477 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/InvokeMethod.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/InvokeMethod.cs new file mode 100644 index 0000000..ffa10d5 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/InvokeMethod.cs @@ -0,0 +1,419 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using System.Collections; +using System.Reflection; +using System.Collections.Generic; +using System; +using UnityEngine.Events; +using MarkerMetro.Unity.WinLegacy.Reflection; +using System.Linq; + +namespace Fungus +{ + /// + /// Invokes a method of a component via reflection. Supports passing multiple parameters and storing returned values in a Fungus variable. + /// + [CommandInfo("Scripting", + "Invoke Method", + "Invokes a method of a component via reflection. Supports passing multiple parameters and storing returned values in a Fungus variable.")] + public class InvokeMethod : Command + { + [Tooltip("A description of what this command does. Appears in the command summary.")] + [SerializeField] protected string description = ""; + + [Tooltip("GameObject containing the component method to be invoked")] + [SerializeField] protected GameObject targetObject; + + [HideInInspector] + [Tooltip("Name of assembly containing the target component")] + [SerializeField] protected string targetComponentAssemblyName; + + [HideInInspector] + [Tooltip("Full name of the target component")] + [SerializeField] protected string targetComponentFullname; + + [HideInInspector] + [Tooltip("Display name of the target component")] + [SerializeField] protected string targetComponentText; + + [HideInInspector] + [Tooltip("Name of target method to invoke on the target component")] + [SerializeField] protected string targetMethod; + + [HideInInspector] + [Tooltip("Display name of target method to invoke on the target component")] + [SerializeField] protected string targetMethodText; + + [HideInInspector] + [Tooltip("List of parameters to pass to the invoked method")] + [SerializeField] protected InvokeMethodParameter[] methodParameters; + + [HideInInspector] + [Tooltip("If true, store the return value in a flowchart variable of the same type.")] + [SerializeField] protected bool saveReturnValue; + + [HideInInspector] + [Tooltip("Name of Fungus variable to store the return value in")] + [SerializeField] protected string returnValueVariableKey; + + [HideInInspector] + [Tooltip("The type of the return value")] + [SerializeField] protected string returnValueType; + + [HideInInspector] + [Tooltip("If true, list all inherited methods for the component")] + [SerializeField] protected bool showInherited; + + [HideInInspector] + [Tooltip("The coroutine call behavior for methods that return IEnumerator")] + [SerializeField] protected CallMode callMode; + + protected Type componentType; + protected Component objComponent; + protected Type[] parameterTypes = null; + protected MethodInfo objMethod; + + protected virtual void Awake() + { + if (componentType == null) + { + componentType = ReflectionHelper.GetType(targetComponentAssemblyName); + } + + if (objComponent == null) + { + objComponent = targetObject.GetComponent(componentType); + } + + if (parameterTypes == null) + { + parameterTypes = GetParameterTypes(); + } + + if (objMethod == null) + { + objMethod = UnityEvent.GetValidMethodInfo(objComponent, targetMethod, parameterTypes); + } + } + + protected virtual IEnumerator ExecuteCoroutine() + { + yield return StartCoroutine((IEnumerator)objMethod.Invoke(objComponent, GetParameterValues())); + + if (callMode == CallMode.WaitUntilFinished) + { + Continue(); + } + } + + protected virtual System.Type[] GetParameterTypes() + { + System.Type[] types = new System.Type[methodParameters.Length]; + + for (int i = 0; i < methodParameters.Length; i++) + { + var item = methodParameters[i]; + var objType = ReflectionHelper.GetType(item.objValue.typeAssemblyname); + + types[i] = objType; + } + + return types; + } + + protected virtual object[] GetParameterValues() + { + object[] values = new object[methodParameters.Length]; + var flowChart = GetFlowchart(); + + for (int i = 0; i < methodParameters.Length; i++) + { + var item = methodParameters[i]; + + if (string.IsNullOrEmpty(item.variableKey)) + { + values[i] = item.objValue.GetValue(); + } + else + { + object objValue = null; + + switch (item.objValue.typeFullname) + { + case "System.Int32": + var intvalue = flowChart.GetVariable(item.variableKey); + if (intvalue != null) + objValue = intvalue.Value; + break; + case "System.Boolean": + var boolean = flowChart.GetVariable(item.variableKey); + if (boolean != null) + objValue = boolean.Value; + break; + case "System.Single": + var floatvalue = flowChart.GetVariable(item.variableKey); + if (floatvalue != null) + objValue = floatvalue.Value; + break; + case "System.String": + var stringvalue = flowChart.GetVariable(item.variableKey); + if (stringvalue != null) + objValue = stringvalue.Value; + break; + case "UnityEngine.Color": + var color = flowChart.GetVariable(item.variableKey); + if (color != null) + objValue = color.Value; + break; + case "UnityEngine.GameObject": + var gameObject = flowChart.GetVariable(item.variableKey); + if (gameObject != null) + objValue = gameObject.Value; + break; + case "UnityEngine.Material": + var material = flowChart.GetVariable(item.variableKey); + if (material != null) + objValue = material.Value; + break; + case "UnityEngine.Sprite": + var sprite = flowChart.GetVariable(item.variableKey); + if (sprite != null) + objValue = sprite.Value; + break; + case "UnityEngine.Texture": + var texture = flowChart.GetVariable(item.variableKey); + if (texture != null) + objValue = texture.Value; + break; + case "UnityEngine.Vector2": + var vector2 = flowChart.GetVariable(item.variableKey); + if (vector2 != null) + objValue = vector2.Value; + break; + case "UnityEngine.Vector3": + var vector3 = flowChart.GetVariable(item.variableKey); + if (vector3 != null) + objValue = vector3.Value; + break; + default: + var obj = flowChart.GetVariable(item.variableKey); + if (obj != null) + objValue = obj.Value; + break; + } + + values[i] = objValue; + } + } + + return values; + } + + protected virtual void SetVariable(string key, object value, string returnType) + { + var flowChart = GetFlowchart(); + + switch (returnType) + { + case "System.Int32": + flowChart.GetVariable(key).Value = (int)value; + break; + case "System.Boolean": + flowChart.GetVariable(key).Value = (bool)value; + break; + case "System.Single": + flowChart.GetVariable(key).Value = (float)value; + break; + case "System.String": + flowChart.GetVariable(key).Value = (string)value; + break; + case "UnityEngine.Color": + flowChart.GetVariable(key).Value = (UnityEngine.Color)value; + break; + case "UnityEngine.GameObject": + flowChart.GetVariable(key).Value = (UnityEngine.GameObject)value; + break; + case "UnityEngine.Material": + flowChart.GetVariable(key).Value = (UnityEngine.Material)value; + break; + case "UnityEngine.Sprite": + flowChart.GetVariable(key).Value = (UnityEngine.Sprite)value; + break; + case "UnityEngine.Texture": + flowChart.GetVariable(key).Value = (UnityEngine.Texture)value; + break; + case "UnityEngine.Vector2": + flowChart.GetVariable(key).Value = (UnityEngine.Vector2)value; + break; + case "UnityEngine.Vector3": + flowChart.GetVariable(key).Value = (UnityEngine.Vector3)value; + break; + default: + flowChart.GetVariable(key).Value = (UnityEngine.Object)value; + break; + } + } + + #region Public members + + /// + /// GameObject containing the component method to be invoked. + /// + public virtual GameObject TargetObject { get { return targetObject; } } + + public override void OnEnter() + { + try + { + if (targetObject == null || string.IsNullOrEmpty(targetComponentAssemblyName) || string.IsNullOrEmpty(targetMethod)) + { + Continue(); + return; + } + + if (returnValueType != "System.Collections.IEnumerator") + { + var objReturnValue = objMethod.Invoke(objComponent, GetParameterValues()); + + if (saveReturnValue) + { + SetVariable(returnValueVariableKey, objReturnValue, returnValueType); + } + + Continue(); + } + else + { + StartCoroutine(ExecuteCoroutine()); + + if (callMode == CallMode.Continue) + { + Continue(); + } + else if(callMode == CallMode.Stop) + { + StopParentBlock(); + } + } + } + catch (System.Exception ex) + { + Debug.LogError("Error: " + ex.Message); + } + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override string GetSummary() + { + if (targetObject == null) + { + return "Error: targetObject is not assigned"; + } + + if (!string.IsNullOrEmpty(description)) + { + return description; + } + + return targetObject.name + "." + targetComponentText + "." + targetMethodText; + } + + #endregion + } + + [System.Serializable] + public class InvokeMethodParameter + { + [SerializeField] + public ObjectValue objValue; + + [SerializeField] + public string variableKey; + } + + [System.Serializable] + public class ObjectValue + { + public string typeAssemblyname; + public string typeFullname; + + public int intValue; + public bool boolValue; + public float floatValue; + public string stringValue; + + public Color colorValue; + public GameObject gameObjectValue; + public Material materialValue; + public UnityEngine.Object objectValue; + public Sprite spriteValue; + public Texture textureValue; + public Vector2 vector2Value; + public Vector3 vector3Value; + + public object GetValue() + { + switch (typeFullname) + { + case "System.Int32": + return intValue; + case "System.Boolean": + return boolValue; + case "System.Single": + return floatValue; + case "System.String": + return stringValue; + case "UnityEngine.Color": + return colorValue; + case "UnityEngine.GameObject": + return gameObjectValue; + case "UnityEngine.Material": + return materialValue; + case "UnityEngine.Sprite": + return spriteValue; + case "UnityEngine.Texture": + return textureValue; + case "UnityEngine.Vector2": + return vector2Value; + case "UnityEngine.Vector3": + return vector3Value; + default: + var objType = ReflectionHelper.GetType(typeAssemblyname); + + if (objType.IsSubclassOf(typeof(UnityEngine.Object))) + { + return objectValue; + } + else if (objType.IsEnum()) + return System.Enum.ToObject(objType, intValue); + + break; + } + + return null; + } + } + + public static class ReflectionHelper + { + static Dictionary types = new Dictionary(); + + public static System.Type GetType(string AssemblyQualifiedNameTypeName) + { + if (types.ContainsKey(AssemblyQualifiedNameTypeName) && types[AssemblyQualifiedNameTypeName] != null) + return types[AssemblyQualifiedNameTypeName]; + + types[AssemblyQualifiedNameTypeName] = AppDomain.CurrentDomain.GetAssemblies(). + SelectMany(x => x.GetTypes()) + .FirstOrDefault(x => x.AssemblyQualifiedName == AssemblyQualifiedNameTypeName); + + return types[AssemblyQualifiedNameTypeName]; + } + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/InvokeMethod.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/InvokeMethod.cs.meta new file mode 100644 index 0000000..6d0e448 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/InvokeMethod.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 688e35811870d403f9e2b1ab2a699d98 +timeCreated: 1439307694 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Jump.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Jump.cs new file mode 100644 index 0000000..64e448b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Jump.cs @@ -0,0 +1,87 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Move execution to a specific Label command in the same block. + /// + [CommandInfo("Flow", + "Jump", + "Move execution to a specific Label command in the same block")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class Jump : Command + { + [Tooltip("Name of a label in this block to jump to")] + [SerializeField] protected StringData _targetLabel = new StringData(""); + + #region Public members + + public override void OnEnter() + { + if (_targetLabel.Value == "") + { + Continue(); + return; + } + + var commandList = ParentBlock.CommandList; + for (int i = 0; i < commandList.Count; i++) + { + var command = commandList[i]; + Label label = command as Label; + if (label != null && label.Key == _targetLabel.Value) + { + Continue(label.CommandIndex + 1); + return; + } + } + + // Label not found + Debug.LogWarning("Label not found: " + _targetLabel.Value); + Continue(); + } + + public override string GetSummary() + { + if (_targetLabel.Value == "") + { + return "Error: No label selected"; + } + + return _targetLabel.Value; + } + + public override Color GetButtonColor() + { + return new Color32(253, 253, 150, 255); + } + + public override bool HasReference(Variable variable) + { + return _targetLabel.stringRef == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("targetLabel")] public Label targetLabelOLD; + + protected virtual void OnEnable() + { + if (targetLabelOLD != null) + { + _targetLabel.Value = targetLabelOLD.Key; + targetLabelOLD = null; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Jump.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Jump.cs.meta new file mode 100644 index 0000000..9e08f0c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Jump.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ae9ac2fcbd1d542619ab0bc7549fb264 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Label.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Label.cs new file mode 100644 index 0000000..cb4fa83 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Label.cs @@ -0,0 +1,44 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Marks a position in the command list for execution to jump to. + /// + [CommandInfo("Flow", + "Label", + "Marks a position in the command list for execution to jump to.")] + [AddComponentMenu("")] + public class Label : Command + { + [Tooltip("Display name for the label")] + [SerializeField] protected string key = ""; + + #region Public members + + /// + /// Display name for the label + /// + public virtual string Key { get { return key; } } + + public override void OnEnter() + { + Continue(); + } + + public override string GetSummary() + { + return key; + } + + public override Color GetButtonColor() + { + return new Color32(200, 200, 253, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Label.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Label.cs.meta new file mode 100644 index 0000000..c40c691 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Label.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ea4da378c47144a86979765ac5e9690c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween.meta new file mode 100644 index 0000000..89ab4ee --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 53bec3476dd0fa945af5703dda0cd24f +folderAsset: yes +timeCreated: 1501401094 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/BaseLeanTweenCommand.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/BaseLeanTweenCommand.cs new file mode 100644 index 0000000..ddac35e --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/BaseLeanTweenCommand.cs @@ -0,0 +1,124 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Abstract base class for LeanTween commands. + /// + [ExecuteInEditMode] + public abstract class BaseLeanTweenCommand : Command + { + [Tooltip("Target game object to apply the Tween to")] + [SerializeField] + protected GameObjectData _targetObject; + + [Tooltip("The time in seconds the animation will take to complete")] + [SerializeField] + protected FloatData _duration = new FloatData(1f); + + public enum ToFrom { To, From } + [Tooltip("Does the tween act from current TO destination or is it reversed and act FROM destination to its current")] + [SerializeField] + protected ToFrom _toFrom; + public bool IsInFromMode { get { return _toFrom == ToFrom.From; } } + + public enum AbsAdd { Absolute, Additive } + [Tooltip("Does the tween use the value as a target or as a delta to be added to current.")] + [SerializeField] + protected AbsAdd _absAdd; + public bool IsInAddativeMode { get { return _absAdd == AbsAdd.Additive; } } + + + [Tooltip("The shape of the easing curve applied to the animation")] + [SerializeField] + protected LeanTweenType easeType = LeanTweenType.easeInOutQuad; + + [Tooltip("The type of loop to apply once the animation has completed")] + [SerializeField] + protected LeanTweenType loopType = LeanTweenType.once; + + [Tooltip("Number of times to repeat the tween, -1 is infinite.")] + [SerializeField] + protected int repeats = 0; + + [Tooltip("Stop any previously LeanTweens on this object before adding this one. Warning; expensive.")] + [SerializeField] + protected bool stopPreviousTweens = false; + + [Tooltip("Wait until the tween has finished before executing the next command")] + [SerializeField] + protected bool waitUntilFinished = true; + + + [HideInInspector] protected LTDescr ourTween; + + + protected virtual void OnTweenComplete() + { + Continue(); + } + + #region Public members + + public override void OnEnter() + { + if (_targetObject.Value == null) + { + Continue(); + return; + } + + if (stopPreviousTweens) + { + LeanTween.cancel(_targetObject.Value); + } + + ourTween = ExecuteTween(); + + ourTween.setEase(easeType) + .setRepeat(repeats) + .setLoopType(loopType); + + if (waitUntilFinished) + { + if(ourTween != null) + { + ourTween.setOnComplete(OnTweenComplete); + } + } + else + { + Continue(); + } + } + + public abstract LTDescr ExecuteTween(); + + public override string GetSummary() + { + if (_targetObject.Value == null) + { + return "Error: No target object selected"; + } + + return _targetObject.Value.name + " over " + _duration.Value + " seconds"; + } + + public override Color GetButtonColor() + { + return new Color32(233, 163, 180, 255); + } + + public override bool HasReference(Variable variable) + { + return variable == _targetObject.gameObjectRef || variable == _duration.floatRef; + } + + #endregion + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/BaseLeanTweenCommand.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/BaseLeanTweenCommand.cs.meta new file mode 100644 index 0000000..b5346d6 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/BaseLeanTweenCommand.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 22379d19093ceb34098232d6f1b848a0 +timeCreated: 1499564933 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/MoveLean.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/MoveLean.cs new file mode 100644 index 0000000..81d7753 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/MoveLean.cs @@ -0,0 +1,61 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; +using System; + +namespace Fungus +{ + /// + /// Moves a game object to a specified position over time. The position can be defined by a transform in another object (using To Transform) or by setting an absolute position (using To Position, if To Transform is set to None). + /// + [CommandInfo("LeanTween", + "Move", + "Moves a game object to a specified position over time. The position can be defined by a transform in another object (using To Transform) or by setting an absolute position (using To Position, if To Transform is set to None).")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class MoveLean : BaseLeanTweenCommand + { + [Tooltip("Target transform that the GameObject will move to")] + [SerializeField] + protected TransformData _toTransform; + + [Tooltip("Target world position that the GameObject will move to, if no From Transform is set")] + [SerializeField] + protected Vector3Data _toPosition; + + [Tooltip("Whether to animate in world space or relative to the parent. False by default.")] + [SerializeField] + protected bool isLocal; + + + public override LTDescr ExecuteTween() + { + var loc = _toTransform.Value == null ? _toPosition.Value : _toTransform.Value.position; + + if(IsInAddativeMode) + { + loc += _targetObject.Value.transform.position; + } + + if(IsInFromMode) + { + var cur = _targetObject.Value.transform.position; + _targetObject.Value.transform.position = loc; + loc = cur; + } + + if (isLocal) + return LeanTween.moveLocal(_targetObject.Value, loc, _duration); + else + return LeanTween.move(_targetObject.Value, loc, _duration); + } + + public override bool HasReference(Variable variable) + { + return _toTransform.transformRef == variable || _toPosition.vector3Ref == variable || base.HasReference(variable); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/MoveLean.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/MoveLean.cs.meta new file mode 100644 index 0000000..89e3529 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/MoveLean.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3ca31fffe1be42a49b96bbb8b7ff5a50 +timeCreated: 1499566229 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/RotateLean.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/RotateLean.cs new file mode 100644 index 0000000..5a631cd --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/RotateLean.cs @@ -0,0 +1,81 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; +using System; + +namespace Fungus +{ + /// + /// Rotates a game object to the specified angles over time. + /// + [CommandInfo("LeanTween", + "Rotate", + "Rotates a game object to the specified angles over time.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class RotateLean : BaseLeanTweenCommand + { + [Tooltip("Target transform that the GameObject will rotate to")] + [SerializeField] + protected TransformData _toTransform; + + [Tooltip("Target rotation that the GameObject will rotate to, if no To Transform is set")] + [SerializeField] + protected Vector3Data _toRotation; + + [Tooltip("Whether to animate in world space or relative to the parent. False by default.")] + [SerializeField] + protected bool isLocal; + + public enum RotateMode { PureRotate, LookAt2D, LookAt3D} + [Tooltip("Whether to use the provided Transform or Vector as a target to look at rather than a euler to match.")] + [SerializeField] + protected RotateMode rotateMode = RotateMode.PureRotate; + + + public override LTDescr ExecuteTween() + { + var rot = _toTransform.Value == null ? _toRotation.Value : _toTransform.Value.rotation.eulerAngles; + + if(rotateMode == RotateMode.LookAt3D) + { + var pos = _toTransform.Value == null ? _toRotation.Value : _toTransform.Value.position; + var dif = pos - _targetObject.Value.transform.position; + rot = Quaternion.LookRotation(dif.normalized).eulerAngles; + } + else if(rotateMode == RotateMode.LookAt2D) + { + var pos = _toTransform.Value == null ? _toRotation.Value : _toTransform.Value.position; + var dif = pos - _targetObject.Value.transform.position; + dif.z = 0; + + rot = Quaternion.FromToRotation(_targetObject.Value.transform.up, dif.normalized).eulerAngles; + } + + if (IsInAddativeMode) + { + rot += _targetObject.Value.transform.rotation.eulerAngles; + } + + if (IsInFromMode) + { + var cur = _targetObject.Value.transform.rotation.eulerAngles; + _targetObject.Value.transform.rotation = Quaternion.Euler(rot); + rot = cur; + } + + if (isLocal) + return LeanTween.rotateLocal(_targetObject.Value, rot, _duration); + else + return LeanTween.rotate(_targetObject.Value, rot, _duration); + } + + public override bool HasReference(Variable variable) + { + return variable == _toTransform.transformRef || _toRotation.vector3Ref == variable || base.HasReference(variable); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/RotateLean.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/RotateLean.cs.meta new file mode 100644 index 0000000..78458eb --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/RotateLean.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b8feaa22bae049c43a1c6dfe095c498c +timeCreated: 1499583595 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/ScaleLean.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/ScaleLean.cs new file mode 100644 index 0000000..7a6d470 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/ScaleLean.cs @@ -0,0 +1,53 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; +using System; + +namespace Fungus +{ + /// + /// Changes a game object's scale to a specified value over time. + /// + [CommandInfo("LeanTween", + "Scale", + "Changes a game object's scale to a specified value over time.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class ScaleLean : BaseLeanTweenCommand + { + [Tooltip("Target transform that the GameObject will scale to")] + [SerializeField] + protected TransformData _toTransform; + + [Tooltip("Target scale that the GameObject will scale to, if no To Transform is set")] + [SerializeField] + protected Vector3Data _toScale = new Vector3Data(Vector3.one); + + public override LTDescr ExecuteTween() + { + var sc = _toTransform.Value == null ? _toScale.Value : _toTransform.Value.localScale; + + if (IsInAddativeMode) + { + sc += _targetObject.Value.transform.localScale; + } + + if (IsInFromMode) + { + var cur = _targetObject.Value.transform.localScale; + _targetObject.Value.transform.localScale = sc; + sc = cur; + } + + return LeanTween.scale(_targetObject.Value, sc, _duration); + } + + public override bool HasReference(Variable variable) + { + return variable == _toTransform.transformRef || _toScale.vector3Ref == variable || base.HasReference(variable); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/ScaleLean.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/ScaleLean.cs.meta new file mode 100644 index 0000000..22a144b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/ScaleLean.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 30cbb61ab588b1a4093d2ef0254045b0 +timeCreated: 1499585056 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/StopTweensLean.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/StopTweensLean.cs new file mode 100644 index 0000000..bd9ce12 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/StopTweensLean.cs @@ -0,0 +1,55 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + + +namespace Fungus +{ + /// + /// + /// + [CommandInfo("LeanTween", + "StopTweens", + "Stops the LeanTweens on a target GameObject")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class StopTweensLean : Command + { + [Tooltip("Target game object stop LeanTweens on")] + [SerializeField] + protected GameObjectData _targetObject; + + public override void OnEnter() + { + if (_targetObject.Value != null) + { + LeanTween.cancel(_targetObject.Value); + } + + Continue(); + } + + public override string GetSummary() + { + if (_targetObject.Value == null) + { + return "Error: No target object selected"; + } + + return "Stop all LeanTweens on " + _targetObject.Value.name; + } + + public override Color GetButtonColor() + { + return new Color32(233, 163, 180, 255); + } + + public override bool HasReference(Variable variable) + { + return _targetObject.gameObjectRef == variable; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/StopTweensLean.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/StopTweensLean.cs.meta new file mode 100644 index 0000000..837cb4c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LeanTween/StopTweensLean.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d998218fa600bac43adbc431e9dd6c0c +timeCreated: 1499761355 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LoadScene.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/LoadScene.cs new file mode 100644 index 0000000..fd1c6f5 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LoadScene.cs @@ -0,0 +1,76 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Loads a new Unity scene and displays an optional loading image. This is useful + /// for splitting a large game across multiple scene files to reduce peak memory + /// usage. Previously loaded assets will be released before loading the scene to free up memory. + /// The scene to be loaded must be added to the scene list in Build Settings.")] + /// + [CommandInfo("Flow", + "Load Scene", + "Loads a new Unity scene and displays an optional loading image. This is useful " + + "for splitting a large game across multiple scene files to reduce peak memory " + + "usage. Previously loaded assets will be released before loading the scene to free up memory." + + "The scene to be loaded must be added to the scene list in Build Settings.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class LoadScene : Command + { + [Tooltip("Name of the scene to load. The scene must also be added to the build settings.")] + [SerializeField] protected StringData _sceneName = new StringData(""); + + [Tooltip("Image to display while loading the scene")] + [SerializeField] protected Texture2D loadingImage; + + #region Public members + + public override void OnEnter() + { + SceneLoader.LoadScene(_sceneName.Value, loadingImage); + } + + public override string GetSummary() + { + if (_sceneName.Value.Length == 0) + { + return "Error: No scene name selected"; + } + + return _sceneName.Value; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + return _sceneName.stringRef == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("sceneName")] public string sceneNameOLD = ""; + + protected virtual void OnEnable() + { + if (sceneNameOLD != "") + { + _sceneName.Value = sceneNameOLD; + sceneNameOLD = ""; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LoadScene.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/LoadScene.cs.meta new file mode 100644 index 0000000..0ee9205 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LoadScene.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 00d03ae0919f04264b018681ed534177 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LoadVariable.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/LoadVariable.cs new file mode 100644 index 0000000..29b2e19 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LoadVariable.cs @@ -0,0 +1,123 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Loads a saved value and stores it in a Boolean, Integer, Float or String variable. If the key is not found then the variable is not modified. + /// + [CommandInfo("Variable", + "Load Variable", + "Loads a saved value and stores it in a Boolean, Integer, Float or String variable. If the key is not found then the variable is not modified.")] + [AddComponentMenu("")] + public class LoadVariable : Command + { + [Tooltip("Name of the saved value. Supports variable substition e.g. \"player_{$PlayerNumber}\"")] + [SerializeField] protected string key = ""; + + [Tooltip("Variable to store the value in.")] + [VariableProperty(typeof(BooleanVariable), + typeof(IntegerVariable), + typeof(FloatVariable), + typeof(StringVariable))] + [SerializeField] protected Variable variable; + + #region Public members + + public override void OnEnter() + { + var flowchart = GetFlowchart(); + + // Prepend the current save profile (if any) and make sure all inputs are valid + string prefsKey = SetSaveProfile.SaveProfile + "_" + flowchart.SubstituteVariables(key); + bool validKey = key != "" && PlayerPrefs.HasKey(prefsKey); + bool validVariable = variable != null; + + if (!validKey || !validVariable) + { + Continue(); + return; + } + + System.Type variableType = variable.GetType(); + + if (variableType == typeof(BooleanVariable)) + { + BooleanVariable booleanVariable = variable as BooleanVariable; + if (booleanVariable != null) + { + // PlayerPrefs does not have bool accessors, so just use int + booleanVariable.Value = (PlayerPrefs.GetInt(prefsKey) == 1); + } + } + else if (variableType == typeof(IntegerVariable)) + { + IntegerVariable integerVariable = variable as IntegerVariable; + if (integerVariable != null) + { + integerVariable.Value = PlayerPrefs.GetInt(prefsKey); + } + } + else if (variableType == typeof(FloatVariable)) + { + FloatVariable floatVariable = variable as FloatVariable; + if (floatVariable != null) + { + floatVariable.Value = PlayerPrefs.GetFloat(prefsKey); + } + } + else if (variableType == typeof(StringVariable)) + { + StringVariable stringVariable = variable as StringVariable; + if (stringVariable != null) + { + stringVariable.Value = PlayerPrefs.GetString(prefsKey); + } + } + + Continue(); + } + + public override string GetSummary() + { + if (key.Length == 0) + { + return "Error: No stored value key selected"; + } + + if (variable == null) + { + return "Error: No variable selected"; + } + + return "'" + key + "' into " + variable.Key; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable in_variable) + { + return this.variable == in_variable || + base.HasReference(in_variable); + } + + #endregion + #region Editor caches +#if UNITY_EDITOR + protected override void RefreshVariableCache() + { + base.RefreshVariableCache(); + + var f = GetFlowchart(); + + f.DetermineSubstituteVariables(key, referencedVariables); + } +#endif + #endregion Editor caches + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LoadVariable.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/LoadVariable.cs.meta new file mode 100644 index 0000000..d0b8592 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LoadVariable.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 23c657364a3b24e16bdf5946729a8b7b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LookFrom.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/LookFrom.cs new file mode 100644 index 0000000..fe02c69 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LookFrom.cs @@ -0,0 +1,96 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Instantly rotates a GameObject to look at the supplied Vector3 then returns it to it's starting rotation over time. + /// + [CommandInfo("iTween", + "Look From", + "Instantly rotates a GameObject to look at the supplied Vector3 then returns it to it's starting rotation over time.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class LookFrom : iTweenCommand + { + [Tooltip("Target transform that the GameObject will look at")] + [SerializeField] protected TransformData _fromTransform; + + [Tooltip("Target world position that the GameObject will look at, if no From Transform is set")] + [SerializeField] protected Vector3Data _fromPosition; + + [Tooltip("Restricts rotation to the supplied axis only")] + [SerializeField] protected iTweenAxis axis; + + #region Public members + + public override void DoTween() + { + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("name", _tweenName.Value); + if (_fromTransform.Value == null) + { + tweenParams.Add("looktarget", _fromPosition.Value); + } + else + { + tweenParams.Add("looktarget", _fromTransform.Value); + } + switch (axis) + { + case iTweenAxis.X: + tweenParams.Add("axis", "x"); + break; + case iTweenAxis.Y: + tweenParams.Add("axis", "y"); + break; + case iTweenAxis.Z: + tweenParams.Add("axis", "z"); + break; + } + tweenParams.Add("time", _duration.Value); + tweenParams.Add("easetype", easeType); + tweenParams.Add("looptype", loopType); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.LookFrom(_targetObject.Value, tweenParams); + } + + public override bool HasReference(Variable variable) + { + return _fromTransform.transformRef == variable || _fromPosition.vector3Ref == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; + [HideInInspector] [FormerlySerializedAs("fromPosition")] public Vector3 fromPositionOLD; + + protected override void OnEnable() + { + base.OnEnable(); + + if (fromTransformOLD != null) + { + _fromTransform.Value = fromTransformOLD; + fromTransformOLD = null; + } + + if (fromPositionOLD != default(Vector3)) + { + _fromPosition.Value = fromPositionOLD; + fromPositionOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LookFrom.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/LookFrom.cs.meta new file mode 100644 index 0000000..b11105d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LookFrom.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 433657382cf894ff2973ee118eed40ea +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LookTo.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/LookTo.cs new file mode 100644 index 0000000..0c29038 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LookTo.cs @@ -0,0 +1,96 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Rotates a GameObject to look at a supplied Transform or Vector3 over time. + /// + [CommandInfo("iTween", + "Look To", + "Rotates a GameObject to look at a supplied Transform or Vector3 over time.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class LookTo : iTweenCommand + { + [Tooltip("Target transform that the GameObject will look at")] + [SerializeField] protected TransformData _toTransform; + + [Tooltip("Target world position that the GameObject will look at, if no From Transform is set")] + [SerializeField] protected Vector3Data _toPosition; + + [Tooltip("Restricts rotation to the supplied axis only")] + [SerializeField] protected iTweenAxis axis; + + #region Public members + + public override void DoTween() + { + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("name", _tweenName.Value); + if (_toTransform.Value == null) + { + tweenParams.Add("looktarget", _toPosition.Value); + } + else + { + tweenParams.Add("looktarget", _toTransform.Value); + } + switch (axis) + { + case iTweenAxis.X: + tweenParams.Add("axis", "x"); + break; + case iTweenAxis.Y: + tweenParams.Add("axis", "y"); + break; + case iTweenAxis.Z: + tweenParams.Add("axis", "z"); + break; + } + tweenParams.Add("time", _duration.Value); + tweenParams.Add("easetype", easeType); + tweenParams.Add("looptype", loopType); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.LookTo(_targetObject.Value, tweenParams); + } + + public override bool HasReference(Variable variable) + { + return _toTransform.transformRef == variable || _toPosition.vector3Ref == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; + [HideInInspector] [FormerlySerializedAs("toPosition")] public Vector3 toPositionOLD; + + protected override void OnEnable() + { + base.OnEnable(); + + if (toTransformOLD != null) + { + _toTransform.Value = toTransformOLD; + toTransformOLD = null; + } + + if (toPositionOLD != default(Vector3)) + { + _toPosition.Value = toPositionOLD; + toPositionOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LookTo.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/LookTo.cs.meta new file mode 100644 index 0000000..8d79a61 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LookTo.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3ec82c445301b4e9fb9b89cb2eb6a666 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LoopRange.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/LoopRange.cs new file mode 100644 index 0000000..645e11b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LoopRange.cs @@ -0,0 +1,84 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) maintained by Chris Gregan (http://twitter.com/gofungus). +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Loop over a fixed integer range, similar to a common for loop. + /// + [CommandInfo("Flow", + "Loop Range", + "Loop over a fixed integer range, similar to a common for loop.")] + [CommandInfo("Flow", + "For", + "Loop over a fixed integer range, similar to a common for loop.")] + [AddComponentMenu("")] + public class LoopRange : Condition + { + [Tooltip("Starting value for the counter variable")] + [SerializeField] + protected IntegerData startingValue; + + [Tooltip("End value for the counter variable, exclusive")] + [SerializeField] + protected IntegerData endValue; + + [Tooltip("Optional int var to hold the current loop counter.")] + [SerializeField] + protected IntegerData counter; + + [Tooltip("Step size for the counter, how much does it go up by each loop. Default 1")] + [SerializeField] + protected IntegerData step = new IntegerData(1); + + #region Public members + + public override bool IsLooping { get { return true; } } + + protected override void PreEvaluate() + { + //if we came from the end then we are already looping, if not this is first loop so prep + if (ParentBlock.PreviousActiveCommandIndex != endCommand.CommandIndex) + { + counter.Value = startingValue.Value; + } + else + { + counter.Value += (startingValue.Value <= endValue.Value ? step.Value : -step.Value); + } + } + + protected override bool EvaluateCondition() + { + return (startingValue.Value <= endValue.Value ? + counter.Value < endValue.Value : + counter.Value > endValue.Value); + } + + protected override void OnFalse() + { + MoveToEnd(); + } + + public override void OnValidate() + { + // no infinite loops + if (step.Value == 0) + step.Value = 1; + + //no negative steps, we do that automatically + step.Value = Mathf.Abs(step.Value); + } + + public override bool HasReference(Variable variable) + { + return startingValue.integerRef == variable || endValue.integerRef == variable || + counter.integerRef == variable || step.integerRef == variable || + base.HasReference(variable); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LoopRange.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/LoopRange.cs.meta new file mode 100644 index 0000000..ca43b9d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LoopRange.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b0eebb5bf2fc1e542a35e2e5332e60d4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaCondition.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaCondition.cs new file mode 100644 index 0000000..5495015 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaCondition.cs @@ -0,0 +1,118 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Fungus; +using MoonSharp.Interpreter; + +namespace Fungus +{ + public class LuaCondition : Condition + { + [Tooltip("Lua Environment to use to execute this Lua script (null for global)")] + [SerializeField] protected LuaEnvironment luaEnvironment; + + [Tooltip("The lua comparison string to run; implicitly prepends 'return' onto this")] + [TextArea] + public string luaCompareString; + protected bool initialised; + protected string friendlyName = ""; + protected Closure luaFunction; + + protected override bool EvaluateCondition() + { + bool condition = false; + luaEnvironment.RunLuaFunction(luaFunction, false, (returnValue) => { + if( returnValue != null ) + { + condition = returnValue.Boolean; + } + else + { + Debug.LogWarning("No return value from " + friendlyName); + } + }); + return condition; + } + + protected override bool HasNeededProperties() + { + return !string.IsNullOrEmpty(luaCompareString); + } + + protected virtual void Start() + { + InitExecuteLua(); + } + + protected virtual string GetLuaString() + { + return "return not not (" + luaCompareString + ")"; + } + + /// + /// Initialises the Lua environment and compiles the Lua string for execution later on. + /// + protected virtual void InitExecuteLua() + { + if (initialised) + { + return; + } + + // Cache a descriptive name to use in Lua error messages + friendlyName = GetLocationIdentifier(); + + Flowchart flowchart = GetFlowchart(); + + // See if a Lua Environment has been assigned to this Flowchart + if (luaEnvironment == null) + { + luaEnvironment = flowchart.LuaEnv; + } + + // No Lua Environment specified so just use any available or create one. + if (luaEnvironment == null) + { + luaEnvironment = LuaEnvironment.GetLua(); + } + + string s = GetLuaString(); + luaFunction = luaEnvironment.LoadLuaFunction(s, friendlyName); + + // Add a binding to the parent flowchart + if (flowchart.LuaBindingName != "") + { + Table globals = luaEnvironment.Interpreter.Globals; + if (globals != null) + { + globals[flowchart.LuaBindingName] = flowchart; + } + } + + // Always initialise when playing in the editor. + // Allows the user to edit the Lua script while the game is playing. + if ( !(Application.isPlaying && Application.isEditor) ) + { + initialised = true; + } + + } + + #region Public members + + public override string GetSummary() + { + if (string.IsNullOrEmpty(luaCompareString)) + { + return "Error: no lua compare string provided"; + } + + return luaCompareString; + } + + #endregion + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaCondition.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaCondition.cs.meta new file mode 100644 index 0000000..5073dfe --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaCondition.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 75ddfadd68d3d4713803a6b170cb0b51 +timeCreated: 1493078204 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaElseIf.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaElseIf.cs new file mode 100644 index 0000000..440c125 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaElseIf.cs @@ -0,0 +1,28 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Marks the start of a command block to be executed when the preceding If statement is False and the test expression is true. + /// + [CommandInfo("Flow", + "Lua Else If", + "Marks the start of a command block to be executed when the preceding If statement is False and the test expression is true.")] + [AddComponentMenu("")] + public class LuaElseIf : LuaCondition + { + protected override bool IsElseIf { get { return true; } } + + #region Public members + + public override bool CloseBlock() + { + return true; + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaElseIf.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaElseIf.cs.meta new file mode 100644 index 0000000..fae44b6 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaElseIf.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9739de3269e5246b399e3a1cd41b94de +timeCreated: 1493078204 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaIf.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaIf.cs new file mode 100644 index 0000000..5787a9e --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaIf.cs @@ -0,0 +1,21 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// If the test expression is true, execute the following command block. + /// + [CommandInfo("Flow", + "Lua If", + "If the test expression is true, execute the following command block.")] + [AddComponentMenu("")] + public class LuaIf : LuaCondition + { + #region Public members + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaIf.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaIf.cs.meta new file mode 100644 index 0000000..c67f5d4 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/LuaIf.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a8d396bcbf372485cad471c0bb64bb44 +timeCreated: 1493078204 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math.meta new file mode 100644 index 0000000..5bfbbb1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 09c52cfe3a6ff4747a9c207bec24ba11 +folderAsset: yes +timeCreated: 1503202781 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Abs.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Abs.cs new file mode 100644 index 0000000..a62fadf --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Abs.cs @@ -0,0 +1,24 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Command to execute and store the result of a Abs + /// + [CommandInfo("Math", + "Abs", + "Command to execute and store the result of a Abs")] + [AddComponentMenu("")] + public class Abs : BaseUnaryMathCommand + { + public override void OnEnter() + { + outValue.Value = Mathf.Abs(inValue.Value); + + Continue(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Abs.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Abs.cs.meta new file mode 100644 index 0000000..50bde0d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Abs.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6d11e978db36df445816ec2535d381ce +timeCreated: 1501211592 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/BaseUnaryMathCommand.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/BaseUnaryMathCommand.cs new file mode 100644 index 0000000..6c45908 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/BaseUnaryMathCommand.cs @@ -0,0 +1,38 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Base class for all simple Unary + /// + [AddComponentMenu("")] + public abstract class BaseUnaryMathCommand : Command + { + [Tooltip("Value to be passed in to the function.")] + [SerializeField] + protected FloatData inValue; + + [Tooltip("Where the result of the function is stored.")] + [SerializeField] + protected FloatData outValue; + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override string GetSummary() + { + return "in: " + (inValue.floatRef != null ? inValue.floatRef.Key : inValue.Value.ToString()) + + ", out: " + (outValue.floatRef != null ? outValue.floatRef.Key : outValue.Value.ToString()); + } + + public override bool HasReference(Variable variable) + { + return variable == inValue.floatRef || variable == outValue.floatRef; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/BaseUnaryMathCommand.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/BaseUnaryMathCommand.cs.meta new file mode 100644 index 0000000..1fc01c3 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/BaseUnaryMathCommand.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 513a02811ba512d4ab54d157a15ae8c2 +timeCreated: 1501211592 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Clamp.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Clamp.cs new file mode 100644 index 0000000..345994e --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Clamp.cs @@ -0,0 +1,78 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Command to contain a value between a lower and upper bound, with optional wrapping modes + /// + [CommandInfo("Math", + "Clamp", + "Command to contain a value between a lower and upper bound, with optional wrapping modes")] + [AddComponentMenu("")] + public class Clamp : Command + { + public enum Mode + { + Clamp, + Repeat, + PingPong + } + + [SerializeField] + protected Mode mode = Mode.Clamp; + + //[Tooltip("LHS Value ")] + [SerializeField] + protected FloatData lower, upper, value; + + [Tooltip("Result put here, if using pingpong don't use the same var for value as outValue.")] + [SerializeField] + protected FloatData outValue; + + public override void OnEnter() + { + var l = lower.Value; + var u = upper.Value; + var v = value.Value; + + switch (mode) + { + case Mode.Clamp: + outValue.Value = Mathf.Clamp(value.Value, lower.Value, upper.Value); + break; + case Mode.Repeat: + outValue.Value = (Mathf.Repeat(v - l, u - l)) + l; + break; + case Mode.PingPong: + outValue.Value = (Mathf.PingPong(v - l, u - l)) + l; + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (outValue.floatRef == null) + return "Error: no output value selected"; + + return outValue.floatRef.Key + " = " + Mode.Clamp.ToString() + (mode != Mode.Clamp ? " & " + mode.ToString() : ""); + } + + public override bool HasReference(Variable variable) + { + return lower.floatRef == variable || upper.floatRef == variable || value.floatRef == variable || + outValue.floatRef == variable; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Clamp.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Clamp.cs.meta new file mode 100644 index 0000000..9e93100 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Clamp.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2929f1e90a24b6446a70d27316cff20a +timeCreated: 1501225403 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Curve.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Curve.cs new file mode 100644 index 0000000..6e754f1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Curve.cs @@ -0,0 +1,27 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Pass a value through an AnimationCurve + /// + [CommandInfo("Math", + "Curve", + "Pass a value through an AnimationCurve")] + [AddComponentMenu("")] + public class Curve : BaseUnaryMathCommand + { + [SerializeField] + protected AnimationCurve curve = AnimationCurve.Linear(0, 0, 1, 1); + + public override void OnEnter() + { + outValue.Value = curve.Evaluate(inValue.Value); + + Continue(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Curve.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Curve.cs.meta new file mode 100644 index 0000000..b67fc8f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Curve.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c03f48fc50d3747478ad85653a21a5f5 +timeCreated: 1501226831 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Exp.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Exp.cs new file mode 100644 index 0000000..4454361 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Exp.cs @@ -0,0 +1,24 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Command to execute and store the result of a Exp + /// + [CommandInfo("Math", + "Exp", + "Command to execute and store the result of a Exp")] + [AddComponentMenu("")] + public class Exp : BaseUnaryMathCommand + { + public override void OnEnter() + { + outValue.Value = Mathf.Exp(inValue.Value); + + Continue(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Exp.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Exp.cs.meta new file mode 100644 index 0000000..3e609eb --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Exp.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f28df8ed8a80fa345b3b5e3dcacdea65 +timeCreated: 1501211938 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Inv.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Inv.cs new file mode 100644 index 0000000..a900cf5 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Inv.cs @@ -0,0 +1,26 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Multiplicative Inverse of a float (1/f) + /// + [CommandInfo("Math", + "Inverse", + "Multiplicative Inverse of a float (1/f)")] + [AddComponentMenu("")] + public class Inv : BaseUnaryMathCommand + { + public override void OnEnter() + { + var v = inValue.Value; + + outValue.Value = v != 0 ? (1.0f / inValue.Value) : 0.0f; + + Continue(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Inv.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Inv.cs.meta new file mode 100644 index 0000000..fc54c38 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Inv.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 36d3a877e83b1d1478f1ac099414d17a +timeCreated: 1501213679 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/InvLerp.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/InvLerp.cs new file mode 100644 index 0000000..1932999 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/InvLerp.cs @@ -0,0 +1,58 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Calculates the inverse lerp, the percentage a value is between two others. + /// + [CommandInfo("Math", + "InvLerp", + "Calculates the inverse lerp, the percentage a value is between two others.")] + [AddComponentMenu("")] + public class InvLerp : Command + { + [Tooltip("Clamp percentage to 0-1?")] + [SerializeField] + protected bool clampResult = true; + + //[Tooltip("LHS Value ")] + [SerializeField] + protected FloatData a, b, value; + + //[Tooltip("Where the result of the function is stored.")] + [SerializeField] + protected FloatData outValue; + + public override void OnEnter() + { + if (clampResult) + outValue.Value = Mathf.InverseLerp(a.Value, b.Value, value.Value); + else + outValue.Value = (value.Value - a.Value) / (b.Value - a.Value); + + Continue(); + } + + public override string GetSummary() + { + if (outValue.floatRef == null) + return "Error: no out value selected"; + + return outValue.floatRef.Key + " = [" + a.Value.ToString() + "-" + b.Value.ToString() + "]"; + } + + public override bool HasReference(Variable variable) + { + return a.floatRef == variable || b.floatRef == variable || value.floatRef == variable || + outValue.floatRef == variable; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/InvLerp.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/InvLerp.cs.meta new file mode 100644 index 0000000..d6d1bc8 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/InvLerp.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 80c88869f66a81f4b95e843c36724e65 +timeCreated: 1501213063 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Lerp.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Lerp.cs new file mode 100644 index 0000000..2bcae56 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Lerp.cs @@ -0,0 +1,72 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Linearly Interpolate from A to B + /// + [CommandInfo("Math", + "Lerp", + "Linearly Interpolate from A to B")] + [AddComponentMenu("")] + public class Lerp : Command + { + public enum Mode + { + Lerp, + LerpUnclamped, + LerpAngle + } + + [SerializeField] + protected Mode mode = Mode.Lerp; + + //[Tooltip("LHS Value ")] + [SerializeField] + protected FloatData a = new FloatData(0), b = new FloatData(1), percentage; + + //[Tooltip("Where the result of the function is stored.")] + [SerializeField] + protected FloatData outValue; + + public override void OnEnter() + { + switch (mode) + { + case Mode.Lerp: + outValue.Value = Mathf.Lerp(a.Value, b.Value, percentage.Value); + break; + case Mode.LerpUnclamped: + outValue.Value = Mathf.LerpUnclamped(a.Value, b.Value, percentage.Value); + break; + case Mode.LerpAngle: + outValue.Value = Mathf.LerpAngle(a.Value, b.Value, percentage.Value); + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + return mode.ToString() + " [" + a.Value.ToString() + "-" + b.Value.ToString() + "]"; + } + + public override bool HasReference(Variable variable) + { + return a.floatRef == variable || b.floatRef == variable || percentage.floatRef == variable || + outValue.floatRef == variable; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Lerp.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Lerp.cs.meta new file mode 100644 index 0000000..da0b39d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Lerp.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b44d8d3a71d3e7b45a89437c8f84e687 +timeCreated: 1501212773 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Log.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Log.cs new file mode 100644 index 0000000..fa85bfc --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Log.cs @@ -0,0 +1,49 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Command to execute and store the result of a Log + /// + [CommandInfo("Math", + "Log", + "Command to execute and store the result of a Log")] + [AddComponentMenu("")] + public class Log : BaseUnaryMathCommand + { + public enum Mode + { + Base10, + Natural + } + + [Tooltip("Which log to use, natural or base 10")] + [SerializeField] + protected Mode mode = Mode.Natural; + + public override void OnEnter() + { + switch (mode) + { + case Mode.Base10: + outValue.Value = Mathf.Log10(inValue.Value); + break; + case Mode.Natural: + outValue.Value = Mathf.Log(inValue.Value); + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + return mode.ToString() + " " + base.GetSummary(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Log.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Log.cs.meta new file mode 100644 index 0000000..c8d8d44 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Log.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 47ecda391b679d8449893d4466f41b13 +timeCreated: 1501211938 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Map.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Map.cs new file mode 100644 index 0000000..d7cba73 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Map.cs @@ -0,0 +1,58 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Map a value that exists in 1 range of numbers to another. + /// + [CommandInfo("Math", + "Map", + "Map a value that exists in 1 range of numbers to another.")] + [AddComponentMenu("")] + public class Map : Command + { + //[Tooltip("LHS Value ")] + [SerializeField] + protected FloatData initialRangeLower = new FloatData(0), initialRangeUpper = new FloatData(1), value; + + [SerializeField] + protected FloatData newRangeLower = new FloatData(0), newRangeUpper = new FloatData(1); + + [SerializeField] + protected FloatData outValue; + + public override void OnEnter() + { + var p = value.Value - initialRangeLower.Value; + p /= initialRangeUpper.Value - initialRangeLower.Value; + + var res = p * (newRangeUpper.Value - newRangeLower.Value); + res += newRangeLower.Value; + + outValue.Value = res; + + Continue(); + } + + public override string GetSummary() + { + return "Map [" + initialRangeLower.Value.ToString() + "-" + initialRangeUpper.Value.ToString() + "] to [" + + newRangeLower.Value.ToString() + "-" + newRangeUpper.Value.ToString() + "]"; + } + + public override bool HasReference(Variable variable) + { + return initialRangeLower.floatRef == variable || initialRangeUpper.floatRef == variable || value.floatRef == variable || + newRangeLower.floatRef == variable || newRangeUpper.floatRef == variable || + outValue.floatRef == variable; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Map.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Map.cs.meta new file mode 100644 index 0000000..d38c507 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Map.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 78d80bb5401d8044eb9eee0d4eb0b645 +timeCreated: 1501226122 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/MinMax.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/MinMax.cs new file mode 100644 index 0000000..28a1d36 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/MinMax.cs @@ -0,0 +1,69 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Command to store the min or max of 2 values + /// + [CommandInfo("Math", + "MinMax", + "Command to store the min or max of 2 values")] + [AddComponentMenu("")] + public class MinMax : Command + { + public enum Function + { + Min, + Max + } + + [Tooltip("Min Or Max")] + [SerializeField] + protected Function function = Function.Min; + + //[Tooltip("LHS Value ")] + [SerializeField] + protected FloatData inLHSValue, inRHSValue; + + //[Tooltip("Where the result of the function is stored.")] + [SerializeField] + protected FloatData outValue; + + public override void OnEnter() + { + switch (function) + { + case Function.Min: + outValue.Value = Mathf.Min(inLHSValue.Value, inRHSValue.Value); + break; + case Function.Max: + outValue.Value = Mathf.Max(inLHSValue.Value, inRHSValue.Value); + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + return function.ToString() + " " + + "out: " + (outValue.floatRef != null ? outValue.floatRef.Key : outValue.Value.ToString()) + + " [" + inLHSValue.Value.ToString() + " - " + inRHSValue.Value.ToString() + "]"; + } + + public override bool HasReference(Variable variable) + { + return inLHSValue.floatRef == variable || inRHSValue.floatRef == variable || outValue.floatRef == variable; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/MinMax.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/MinMax.cs.meta new file mode 100644 index 0000000..f356cd4 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/MinMax.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 514ec18f5085cba48bbe6701e4697eb0 +timeCreated: 1501212523 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Neg.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Neg.cs new file mode 100644 index 0000000..85ab31b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Neg.cs @@ -0,0 +1,24 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Negate a float + /// + [CommandInfo("Math", + "Negate", + "Negate a float")] + [AddComponentMenu("")] + public class Neg : BaseUnaryMathCommand + { + public override void OnEnter() + { + outValue.Value = -(inValue.Value); + + Continue(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Neg.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Neg.cs.meta new file mode 100644 index 0000000..c23c52d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Neg.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ff146879925212d4988aa4318efcbbd5 +timeCreated: 1501213679 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Pow.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Pow.cs new file mode 100644 index 0000000..52a480c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Pow.cs @@ -0,0 +1,50 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Raise a value to the power of another + /// + [CommandInfo("Math", + "Pow", + "Raise a value to the power of another.")] + [AddComponentMenu("")] + public class Pow : Command + { + [SerializeField] + protected FloatData baseValue, exponentValue; + + [Tooltip("Where the result of the function is stored.")] + [SerializeField] + protected FloatData outValue; + + public override void OnEnter() + { + outValue.Value = Mathf.Pow(baseValue.Value, exponentValue.Value); + + Continue(); + } + + public override string GetSummary() + { + if (outValue.floatRef == null) + return "Error: No out value selected"; + + return outValue.floatRef.Key + " = " + baseValue.Value.ToString() + "^" + exponentValue.Value.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + return baseValue.floatRef == variable || exponentValue.floatRef == variable || + outValue.floatRef == variable; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Pow.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Pow.cs.meta new file mode 100644 index 0000000..1fd5077 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Pow.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 23b09e2ab627fec4cb0200f7252dbc90 +timeCreated: 1501497818 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Round.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Round.cs new file mode 100644 index 0000000..2a96990 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Round.cs @@ -0,0 +1,53 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Command to execute and store the result of a Round + /// + [CommandInfo("Math", + "Round", + "Command to execute and store the result of a Round")] + [AddComponentMenu("")] + public class Round : BaseUnaryMathCommand + { + public enum Mode + { + Round, + Floor, + Ceil + } + + [Tooltip("Mode; Round (closest), floor(smaller) or ceil(bigger).")] + [SerializeField] + protected Mode function = Mode.Round; + + public override void OnEnter() + { + switch (function) + { + case Mode.Round: + outValue.Value = Mathf.Round(inValue.Value); + break; + case Mode.Floor: + outValue.Value = Mathf.Floor(inValue.Value); + break; + case Mode.Ceil: + outValue.Value = Mathf.Ceil(inValue.Value); + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + return function.ToString() + " " + base.GetSummary(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Round.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Round.cs.meta new file mode 100644 index 0000000..3dab99b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Round.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b9c834185b491334d8e41ca4fc49a56e +timeCreated: 1501212403 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Sign.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Sign.cs new file mode 100644 index 0000000..771d6d1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Sign.cs @@ -0,0 +1,24 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Command to execute and store the result of a Sign + /// + [CommandInfo("Math", + "Sign", + "Command to execute and store the result of a Sign")] + [AddComponentMenu("")] + public class Sign : BaseUnaryMathCommand + { + public override void OnEnter() + { + outValue.Value = Mathf.Sign(inValue.Value); + + Continue(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Sign.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Sign.cs.meta new file mode 100644 index 0000000..8f7a7a9 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Sign.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6a03542258f6b654b8a6d64938803f71 +timeCreated: 1501211938 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Sqrt.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Sqrt.cs new file mode 100644 index 0000000..71633f4 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Sqrt.cs @@ -0,0 +1,24 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Command to execute and store the result of a Sqrt + /// + [CommandInfo("Math", + "Sqrt", + "Command to execute and store the result of a Sqrt")] + [AddComponentMenu("")] + public class Sqrt : BaseUnaryMathCommand + { + public override void OnEnter() + { + outValue.Value = Mathf.Sqrt(inValue.Value); + + Continue(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Sqrt.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Sqrt.cs.meta new file mode 100644 index 0000000..3242b4d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Sqrt.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6e52daa13ab8fe7499a7774ebc194fc5 +timeCreated: 1501211938 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/ToInt.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/ToInt.cs new file mode 100644 index 0000000..1231e2e --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/ToInt.cs @@ -0,0 +1,74 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Command to execute and store the result of a float to int conversion + /// + [CommandInfo("Math", + "ToInt", + "Command to execute and store the result of a float to int conversion")] + [AddComponentMenu("")] + public class ToInt : Command + { + public enum Mode + { + RoundToInt, + FloorToInt, + CeilToInt, + } + + + [Tooltip("To integer mode; round, floor or ceil.")] + [SerializeField] + protected Mode function = Mode.RoundToInt; + + [Tooltip("Value to be passed in to the function.")] + [SerializeField] + protected FloatData inValue; + + [Tooltip("Where the result of the function is stored.")] + [SerializeField] + protected IntegerData outValue; + + public override void OnEnter() + { + switch (function) + { + case Mode.RoundToInt: + outValue.Value = Mathf.RoundToInt(inValue.Value); + break; + case Mode.FloorToInt: + outValue.Value = Mathf.FloorToInt(inValue.Value); + break; + case Mode.CeilToInt: + outValue.Value = Mathf.CeilToInt(inValue.Value); + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + return function.ToString() + + " in: " + (inValue.floatRef != null ? inValue.floatRef.Key : inValue.Value.ToString()) + + ", out: " + (outValue.integerRef != null ? outValue.integerRef.Key : outValue.Value.ToString()); ; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + return variable == inValue.floatRef || variable == outValue.integerRef; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/ToInt.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/ToInt.cs.meta new file mode 100644 index 0000000..334b353 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/ToInt.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 209dba259f0c4134daa0ec3b64c78062 +timeCreated: 1501210911 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Trig.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Trig.cs new file mode 100644 index 0000000..881b039 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Trig.cs @@ -0,0 +1,73 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Command to execute and store the result of basic trigonometry + /// + [CommandInfo("Math", + "Trig", + "Command to execute and store the result of basic trigonometry")] + [AddComponentMenu("")] + public class Trig : BaseUnaryMathCommand + { + public enum Function + { + Rad2Deg, + Deg2Rad, + ACos, + ASin, + ATan, + Cos, + Sin, + Tan + } + + [Tooltip("Trigonometric function to run.")] + [SerializeField] + protected Function function = Function.Sin; + + public override void OnEnter() + { + switch (function) + { + case Function.Rad2Deg: + outValue.Value = inValue.Value * Mathf.Rad2Deg; + break; + case Function.Deg2Rad: + outValue.Value = inValue.Value * Mathf.Deg2Rad; + break; + case Function.ACos: + outValue.Value = Mathf.Acos(inValue.Value); + break; + case Function.ASin: + outValue.Value = Mathf.Asin(inValue.Value); + break; + case Function.ATan: + outValue.Value = Mathf.Atan(inValue.Value); + break; + case Function.Cos: + outValue.Value = Mathf.Cos(inValue.Value); + break; + case Function.Sin: + outValue.Value = Mathf.Sin(inValue.Value); + break; + case Function.Tan: + outValue.Value = Mathf.Tan(inValue.Value); + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + return function.ToString() + " " + base.GetSummary(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Trig.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Trig.cs.meta new file mode 100644 index 0000000..2d6aec0 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Math/Trig.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ee9ab1525ab1b794489f2517aab1d5e2 +timeCreated: 1501148787 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Menu.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Menu.cs new file mode 100644 index 0000000..b9993ff --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Menu.cs @@ -0,0 +1,149 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections.Generic; + +namespace Fungus +{ + /// + /// Displays a button in a multiple choice menu. + /// + [CommandInfo("Narrative", + "Menu", + "Displays a button in a multiple choice menu")] + [AddComponentMenu("")] + public class Menu : Command, ILocalizable, IBlockCaller + { + [Tooltip("Text to display on the menu button")] + [TextArea()] + [SerializeField] protected string text = "Option Text"; + + [Tooltip("Notes about the option text for other authors, localization, etc.")] + [SerializeField] protected string description = ""; + + [FormerlySerializedAs("targetSequence")] + [Tooltip("Block to execute when this option is selected")] + [SerializeField] protected Block targetBlock; + + [Tooltip("Hide this option if the target block has been executed previously")] + [SerializeField] protected bool hideIfVisited; + + [Tooltip("If false, the menu option will be displayed but will not be selectable")] + [SerializeField] protected BooleanData interactable = new BooleanData(true); + + [Tooltip("A custom Menu Dialog to use to display this menu. All subsequent Menu commands will use this dialog.")] + [SerializeField] protected MenuDialog setMenuDialog; + + [Tooltip("If true, this option will be passed to the Menu Dialogue but marked as hidden, this can be used to hide options while maintaining a Menu Shuffle.")] + [SerializeField] protected BooleanData hideThisOption = new BooleanData(false); + + #region Public members + + public MenuDialog SetMenuDialog { get { return setMenuDialog; } set { setMenuDialog = value; } } + + public override void OnEnter() + { + if (setMenuDialog != null) + { + // Override the active menu dialog + MenuDialog.ActiveMenuDialog = setMenuDialog; + } + + bool hideOption = (hideIfVisited && targetBlock != null && targetBlock.GetExecutionCount() > 0) || hideThisOption.Value; + + var menuDialog = MenuDialog.GetMenuDialog(); + if (menuDialog != null) + { + menuDialog.SetActive(true); + + var flowchart = GetFlowchart(); + string displayText = flowchart.SubstituteVariables(text); + + menuDialog.AddOption(displayText, interactable, hideOption, targetBlock); + } + + Continue(); + } + + public override void GetConnectedBlocks(ref List connectedBlocks) + { + if (targetBlock != null) + { + connectedBlocks.Add(targetBlock); + } + } + + public override string GetSummary() + { + if (targetBlock == null) + { + return "Error: No target block selected"; + } + + if (text == "") + { + return "Error: No button text selected"; + } + + return text + " : " + targetBlock.BlockName; + } + + public override Color GetButtonColor() + { + return new Color32(184, 210, 235, 255); + } + + public override bool HasReference(Variable variable) + { + return interactable.booleanRef == variable || hideThisOption.booleanRef == variable || + base.HasReference(variable); + } + + public bool MayCallBlock(Block block) + { + return block == targetBlock; + } + + #endregion + + #region ILocalizable implementation + + public virtual string GetStandardText() + { + return text; + } + + public virtual void SetStandardText(string standardText) + { + text = standardText; + } + + public virtual string GetDescription() + { + return description; + } + + public virtual string GetStringId() + { + // String id for Menu commands is MENU.. + return "MENU." + GetFlowchartLocalizationId() + "." + itemId; + } + + #endregion + + #region Editor caches +#if UNITY_EDITOR + protected override void RefreshVariableCache() + { + base.RefreshVariableCache(); + + var f = GetFlowchart(); + + f.DetermineSubstituteVariables(text, referencedVariables); + } +#endif + #endregion Editor caches + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Menu.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Menu.cs.meta new file mode 100644 index 0000000..572fcb3 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Menu.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 841589fc622bc494aa5405f416fa1301 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/MenuShuffle.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/MenuShuffle.cs new file mode 100644 index 0000000..f198318 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/MenuShuffle.cs @@ -0,0 +1,59 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections.Generic; + +namespace Fungus +{ + /// + /// Shuffle the order of the items in a Fungus Menu + /// + [CommandInfo("Narrative", + "Menu Shuffle", + "Shuffle the order of the items in a Fungus Menu")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class MenuShuffle : Command + { + public enum Mode + { + Every, + Once + } + [SerializeField] + [Tooltip("Determines if the order is shuffled everytime this command is it (Every) or if it is consistent when returned to but random (Once)")] + protected Mode shuffleMode = Mode.Once; + + private int seed = -1; + + public override void OnEnter() + { + var menuDialog = MenuDialog.GetMenuDialog(); + + //if we shuffle every time or we haven't shuffled yet + if(shuffleMode == Mode.Every || seed == -1) + { + seed = Random.Range(0,1000000); + } + + if (menuDialog != null) + { + menuDialog.Shuffle(new System.Random(seed)); + } + + Continue(); + } + + public override string GetSummary() + { + return shuffleMode.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(184, 210, 235, 255); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/MenuShuffle.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/MenuShuffle.cs.meta new file mode 100644 index 0000000..7e4ba73 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/MenuShuffle.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4d88125c88dab4a44851835e94ff4d90 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/MenuTimer.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/MenuTimer.cs new file mode 100644 index 0000000..a8542c9 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/MenuTimer.cs @@ -0,0 +1,93 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections.Generic; + +namespace Fungus +{ + /// + /// Displays a timer bar and executes a target block if the player fails to select a menu option in time. + /// + [CommandInfo("Narrative", + "Menu Timer", + "Displays a timer bar and executes a target block if the player fails to select a menu option in time.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class MenuTimer : Command, IBlockCaller + { + [Tooltip("Length of time to display the timer for")] + [SerializeField] protected FloatData _duration = new FloatData(1); + + [FormerlySerializedAs("targetSequence")] + [Tooltip("Block to execute when the timer expires")] + [SerializeField] protected Block targetBlock; + + #region Public members + + public override void OnEnter() + { + var menuDialog = MenuDialog.GetMenuDialog(); + + if (menuDialog != null && + targetBlock != null) + { + menuDialog.ShowTimer(_duration.Value, targetBlock); + } + + Continue(); + } + + public override void GetConnectedBlocks(ref List connectedBlocks) + { + if (targetBlock != null) + { + connectedBlocks.Add(targetBlock); + } + } + + public override string GetSummary() + { + if (targetBlock == null) + { + return "Error: No target block selected"; + } + + return targetBlock.BlockName; + } + + public override Color GetButtonColor() + { + return new Color32(184, 210, 235, 255); + } + + public override bool HasReference(Variable variable) + { + return _duration.floatRef == variable || + base.HasReference(variable); + } + + public bool MayCallBlock(Block block) + { + return block == targetBlock; + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; + + protected virtual void OnEnable() + { + if (durationOLD != default(float)) + { + _duration.Value = durationOLD; + durationOLD = default(float); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/MenuTimer.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/MenuTimer.cs.meta new file mode 100644 index 0000000..31d25c1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/MenuTimer.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ab54728d981544842843ba6609b9a80a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveAdd.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveAdd.cs new file mode 100644 index 0000000..cabb8b3 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveAdd.cs @@ -0,0 +1,68 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Moves a game object by a specified offset over time. + /// + [CommandInfo("iTween", + "Move Add", + "Moves a game object by a specified offset over time.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class MoveAdd : iTweenCommand + { + [Tooltip("A translation offset in space the GameObject will animate to")] + [SerializeField] protected Vector3Data _offset; + + [Tooltip("Apply the transformation in either the world coordinate or local cordinate system")] + [SerializeField] protected Space space = Space.Self; + + #region Public members + + public override void DoTween() + { + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("name", _tweenName.Value); + tweenParams.Add("amount", _offset.Value); + tweenParams.Add("space", space); + tweenParams.Add("time", _duration.Value); + tweenParams.Add("easetype", easeType); + tweenParams.Add("looptype", loopType); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.MoveAdd(_targetObject.Value, tweenParams); + } + + public override bool HasReference(Variable variable) + { + return _offset.vector3Ref == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; + + protected override void OnEnable() + { + base.OnEnable(); + + if (offsetOLD != default(Vector3)) + { + _offset.Value = offsetOLD; + offsetOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveAdd.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveAdd.cs.meta new file mode 100644 index 0000000..5c940fd --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveAdd.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 598f181ee459641a9b0a5849fbc3240c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveFrom.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveFrom.cs new file mode 100644 index 0000000..a645302 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveFrom.cs @@ -0,0 +1,85 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Moves a game object from a specified position back to its starting position over time. The position can be defined by a transform in another object (using To Transform) or by setting an absolute position (using To Position, if To Transform is set to None). + /// + [CommandInfo("iTween", + "Move From", + "Moves a game object from a specified position back to its starting position over time. The position can be defined by a transform in another object (using To Transform) or by setting an absolute position (using To Position, if To Transform is set to None).")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class MoveFrom : iTweenCommand + { + [Tooltip("Target transform that the GameObject will move from")] + [SerializeField] protected TransformData _fromTransform; + + [Tooltip("Target world position that the GameObject will move from, if no From Transform is set")] + [SerializeField] protected Vector3Data _fromPosition; + + [Tooltip("Whether to animate in world space or relative to the parent. False by default.")] + [SerializeField] protected bool isLocal; + + #region Public members + + public override void DoTween() + { + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("name", _tweenName.Value); + if (_fromTransform.Value == null) + { + tweenParams.Add("position", _fromPosition.Value); + } + else + { + tweenParams.Add("position", _fromTransform.Value); + } + tweenParams.Add("time", _duration.Value); + tweenParams.Add("easetype", easeType); + tweenParams.Add("looptype", loopType); + tweenParams.Add("isLocal", isLocal); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.MoveFrom(_targetObject.Value, tweenParams); + } + + public override bool HasReference(Variable variable) + { + return _fromTransform.transformRef == variable || _fromPosition.vector3Ref == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; + [HideInInspector] [FormerlySerializedAs("fromPosition")] public Vector3 fromPositionOLD; + + protected override void OnEnable() + { + base.OnEnable(); + + if (fromTransformOLD != null) + { + _fromTransform.Value = fromTransformOLD; + fromTransformOLD = null; + } + + if (fromPositionOLD != default(Vector3)) + { + _fromPosition.Value = fromPositionOLD; + fromPositionOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveFrom.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveFrom.cs.meta new file mode 100644 index 0000000..f25b007 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveFrom.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d5ca001b90bd14834b7268b48a44c6de +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveTo.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveTo.cs new file mode 100644 index 0000000..80a6a7a --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveTo.cs @@ -0,0 +1,85 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Moves a game object to a specified position over time. The position can be defined by a transform in another object (using To Transform) or by setting an absolute position (using To Position, if To Transform is set to None). + /// + [CommandInfo("iTween", + "Move To", + "Moves a game object to a specified position over time. The position can be defined by a transform in another object (using To Transform) or by setting an absolute position (using To Position, if To Transform is set to None).")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class MoveTo : iTweenCommand + { + [Tooltip("Target transform that the GameObject will move to")] + [SerializeField] protected TransformData _toTransform; + + [Tooltip("Target world position that the GameObject will move to, if no From Transform is set")] + [SerializeField] protected Vector3Data _toPosition; + + [Tooltip("Whether to animate in world space or relative to the parent. False by default.")] + [SerializeField] protected bool isLocal; + + #region Public members + + public override void DoTween() + { + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("name", _tweenName.Value); + if (_toTransform.Value == null) + { + tweenParams.Add("position", _toPosition.Value); + } + else + { + tweenParams.Add("position", _toTransform.Value); + } + tweenParams.Add("time", _duration.Value); + tweenParams.Add("easetype", easeType); + tweenParams.Add("looptype", loopType); + tweenParams.Add("isLocal", isLocal); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.MoveTo(_targetObject.Value, tweenParams); + } + + public override bool HasReference(Variable variable) + { + return _toTransform.transformRef == variable || _toPosition.vector3Ref == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; + [HideInInspector] [FormerlySerializedAs("toPosition")] public Vector3 toPositionOLD; + + protected override void OnEnable() + { + base.OnEnable(); + + if (toTransformOLD != null) + { + _toTransform.Value = toTransformOLD; + toTransformOLD = null; + } + + if (toPositionOLD != default(Vector3)) + { + _toPosition.Value = toPositionOLD; + toPositionOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveTo.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveTo.cs.meta new file mode 100644 index 0000000..26c5f7d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveTo.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 445c07472dafe4e0ead0e88c4b757401 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveToView.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveToView.cs new file mode 100644 index 0000000..19bf5c2 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveToView.cs @@ -0,0 +1,110 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Moves the camera to a location specified by a View object. + /// + [CommandInfo("Camera", + "Move To View", + "Moves the camera to a location specified by a View object.")] + [AddComponentMenu("")] + public class MoveToView : Command + { + [Tooltip("Time for move effect to complete")] + [SerializeField] protected float duration = 1; + + [Tooltip("View to transition to when move is complete")] + [SerializeField] protected View targetView; + public virtual View TargetView { get { return targetView; } } + + [Tooltip("Wait until the fade has finished before executing next command")] + [SerializeField] protected bool waitUntilFinished = true; + + [Tooltip("Camera to use for the pan. Will use main camera if set to none.")] + [SerializeField] protected Camera targetCamera; + + [SerializeField] protected LeanTweenType orthoSizeTweenType = LeanTweenType.easeInOutQuad; + [SerializeField] protected LeanTweenType posTweenType = LeanTweenType.easeInOutQuad; + [SerializeField] protected LeanTweenType rotTweenType = LeanTweenType.easeInOutQuad; + + protected virtual void AcquireCamera() + { + if (targetCamera != null) + { + return; + } + + targetCamera = Camera.main; + if (targetCamera == null) + { + targetCamera = GameObject.FindObjectOfType(); + } + } + + public virtual void Start() + { + AcquireCamera(); + } + + #region Public members + + public override void OnEnter() + { + AcquireCamera(); + if (targetCamera == null || + targetView == null) + { + Continue(); + return; + } + + var cameraManager = FungusManager.Instance.CameraManager; + + Vector3 targetPosition = targetView.transform.position; + Quaternion targetRotation = targetView.transform.rotation; + float targetSize = targetView.ViewSize; + + cameraManager.PanToPosition(targetCamera, targetPosition, targetRotation, targetSize, duration, delegate { + if (waitUntilFinished) + { + Continue(); + } + }, orthoSizeTweenType, posTweenType, rotTweenType); + + if (!waitUntilFinished) + { + Continue(); + } + } + + public override void OnStopExecuting() + { + var cameraManager = FungusManager.Instance.CameraManager; + + cameraManager.Stop(); + } + + 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); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveToView.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveToView.cs.meta new file mode 100644 index 0000000..22315d0 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/MoveToView.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 45c952ea1ad444e479b570fa242679c5 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/OpenURL.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/OpenURL.cs new file mode 100644 index 0000000..b7190e3 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/OpenURL.cs @@ -0,0 +1,46 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using Fungus; + +namespace Fungus +{ + /// + /// Opens the specified URL in the browser. + /// + [CommandInfo("Scripting", + "Open URL", + "Opens the specified URL in the browser.")] + public class OpenURL : Command + { + [Tooltip("URL to open in the browser")] + [SerializeField] protected StringData url = new StringData(); + + #region Public members + + public override void OnEnter() + { + Application.OpenURL(url.Value); + + Continue(); + } + + public override string GetSummary() + { + return url.Value; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + return url.stringRef == variable || base.HasReference(variable); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/OpenURL.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/OpenURL.cs.meta new file mode 100644 index 0000000..c537a0b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/OpenURL.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1447088810b484e0a9cf0237b2e96b82 +timeCreated: 1456439090 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayAmbianceSound.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayAmbianceSound.cs new file mode 100644 index 0000000..7f3b5e6 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayAmbianceSound.cs @@ -0,0 +1,69 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Plays a once-off sound effect. Multiple sound effects can be played at the same time. + /// + [CommandInfo("Audio", + "Play Ambiance Sound", + "Plays a background sound to be overlayed on top of the music. Only one Ambiance can be played at a time.")] + [AddComponentMenu("")] + public class PlayAmbianceSound : Command + { + [Tooltip("Sound effect clip to play")] + [SerializeField] + protected AudioClip soundClip; + + [Range(0, 1)] + [Tooltip("Volume level of the sound effect")] + [SerializeField] + protected float volume = 1; + + [Tooltip("Sound effect clip to play")] + [SerializeField] + protected bool loop; + + protected virtual void DoWait() + { + Continue(); + } + + #region Public members + + public override void OnEnter() + { + if (soundClip == null) + { + Continue(); + return; + } + + var musicManager = FungusManager.Instance.MusicManager; + + musicManager.PlayAmbianceSound(soundClip, loop, volume); + + Continue(); + } + + public override string GetSummary() + { + if (soundClip == null) + { + return "Error: No sound clip selected"; + } + + return soundClip.name; + } + + public override Color GetButtonColor() + { + return new Color32(242, 209, 176, 255); + } + + #endregion + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayAmbianceSound.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayAmbianceSound.cs.meta new file mode 100644 index 0000000..6465ec8 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayAmbianceSound.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 831c208af3cccf24b80cc6f3768919bc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayAnimState.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayAnimState.cs new file mode 100644 index 0000000..a94472d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayAnimState.cs @@ -0,0 +1,66 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Plays a state of an animator according to the state name. + /// + [CommandInfo("Animation", + "Play Anim State", + "Plays a state of an animator according to the state name")] + [AddComponentMenu("")] + public class PlayAnimState : Command + { + [Tooltip("Reference to an Animator component in a game object")] + [SerializeField] protected AnimatorData animator = new AnimatorData(); + + [Tooltip("Name of the state you want to play")] + [SerializeField] protected StringData stateName = new StringData(); + + [Tooltip("Layer to play animation on")] + [SerializeField] protected IntegerData layer = new IntegerData(-1); + + [Tooltip("Start time of animation")] + [SerializeField] protected FloatData time = new FloatData(0f); + + #region Public members + + public override void OnEnter() + { + if (animator.Value != null) + { + animator.Value.Play(stateName.Value, layer.Value, time.Value); + } + + Continue(); + } + + public override string GetSummary() + { + if (animator.Value == null) + { + return "Error: No animator selected"; + } + + return animator.Value.name + " (" + stateName.Value + ")"; + } + + public override Color GetButtonColor() + { + return new Color32(170, 204, 169, 255); + } + + public override bool HasReference(Variable variable) + { + return animator.animatorRef == variable || stateName.stringRef == variable || + layer.integerRef == variable || time.floatRef == variable || + base.HasReference(variable); + } + + #endregion + } +} + diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayAnimState.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayAnimState.cs.meta new file mode 100644 index 0000000..15f9e56 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayAnimState.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5316d953c7abe498799575550c973535 +timeCreated: 1458814204 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayMusic.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayMusic.cs new file mode 100644 index 0000000..806c64d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayMusic.cs @@ -0,0 +1,58 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Plays looping game music. If any game music is already playing, it is stopped. Game music will continue playing across scene loads. + /// + [CommandInfo("Audio", + "Play Music", + "Plays looping game music. If any game music is already playing, it is stopped. Game music will continue playing across scene loads.")] + [AddComponentMenu("")] + public class PlayMusic : Command + { + [Tooltip("Music sound clip to play")] + [SerializeField] protected AudioClip musicClip; + + [Tooltip("Time to begin playing in seconds. If the audio file is compressed, the time index may be inaccurate.")] + [SerializeField] protected float atTime; + + [Tooltip("The music will start playing again at end.")] + [SerializeField] protected bool loop = true; + + [Tooltip("Length of time to fade out previous playing music.")] + [SerializeField] protected float fadeDuration = 1f; + + #region Public members + + public override void OnEnter() + { + var musicManager = FungusManager.Instance.MusicManager; + + float startTime = Mathf.Max(0, atTime); + musicManager.PlayMusic(musicClip, loop, fadeDuration, startTime); + + 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); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayMusic.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayMusic.cs.meta new file mode 100644 index 0000000..d8381fe --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayMusic.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1902400ccc99b45d69ad01cb86b57d0f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayRandomSound.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayRandomSound.cs new file mode 100644 index 0000000..7eb7c63 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayRandomSound.cs @@ -0,0 +1,84 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Plays a once-off sound effect. Multiple sound effects can be played at the same time. + /// + [CommandInfo("Audio", + "Play Random Sound", + "Plays a once-off sound effect from a list of available sound effects. Multiple sound effects can be played at the same time.")] + [AddComponentMenu("")] + public class PlayRandomSound : Command + { + [Tooltip("Sound effect clip to play")] + [SerializeField] + protected AudioClip[] soundClip; + + [Range(0, 1)] + [Tooltip("Volume level of the sound effect")] + [SerializeField] + protected float volume = 1; + + [Tooltip("Wait until the sound has finished playing before continuing execution.")] + [SerializeField] + protected bool waitUntilFinished; + + protected virtual void DoWait() + { + Continue(); + } + + #region Public members + + public override void OnEnter() + { + int rand = Random.Range(0, soundClip.Length); + if (soundClip == null) + { + Continue(); + return; + } + + var musicManager = FungusManager.Instance.MusicManager; + + musicManager.PlaySound(soundClip[rand], volume); + + if (waitUntilFinished) + { + Invoke("DoWait", soundClip[rand].length); + } + else + { + Continue(); + } + } + + public override string GetSummary() + { + if (soundClip == null) + { + return "Error: No sound clip selected"; + } + + string sounds = "["; + foreach (AudioClip ac in soundClip) { + if(ac!=null) + sounds+=ac.name+" ,"; + } + sounds = sounds.TrimEnd(' ', ','); + sounds += "]"; + return "Random sounds "+sounds; + } + + public override Color GetButtonColor() + { + return new Color32(242, 209, 176, 255); + } + + #endregion + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayRandomSound.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayRandomSound.cs.meta new file mode 100644 index 0000000..a5c778b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayRandomSound.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 04659f7200983fe40b49cc144086844b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PlaySound.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlaySound.cs new file mode 100644 index 0000000..c560785 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlaySound.cs @@ -0,0 +1,73 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Plays a once-off sound effect. Multiple sound effects can be played at the same time. + /// + [CommandInfo("Audio", + "Play Sound", + "Plays a once-off sound effect. Multiple sound effects can be played at the same time.")] + [AddComponentMenu("")] + public class PlaySound : Command + { + [Tooltip("Sound effect clip to play")] + [SerializeField] protected AudioClip soundClip; + + [Range(0,1)] + [Tooltip("Volume level of the sound effect")] + [SerializeField] protected float volume = 1; + + [Tooltip("Wait until the sound has finished playing before continuing execution.")] + [SerializeField] protected bool waitUntilFinished; + + protected virtual void DoWait() + { + Continue(); + } + + #region Public members + + public override void OnEnter() + { + if (soundClip == null) + { + Continue(); + return; + } + + var musicManager = FungusManager.Instance.MusicManager; + + musicManager.PlaySound(soundClip, volume); + + if (waitUntilFinished) + { + Invoke("DoWait", soundClip.length); + } + else + { + Continue(); + } + } + + public override string GetSummary() + { + if (soundClip == null) + { + return "Error: No sound clip selected"; + } + + return soundClip.name; + } + + public override Color GetButtonColor() + { + return new Color32(242, 209, 176, 255); + } + + #endregion + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PlaySound.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlaySound.cs.meta new file mode 100644 index 0000000..7070dcd --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlaySound.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bd2f6be51b3d7490ba5633ee095d0391 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayUsfxrSound.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayUsfxrSound.cs new file mode 100644 index 0000000..7436071 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayUsfxrSound.cs @@ -0,0 +1,114 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System; +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Plays a usfxr synth sound. Use the usfxr editor [Tools > Fungus > Utilities > Generate usfxr Sound Effects] to create the SettingsString. Set a ParentTransform if using positional sound. See https://github.com/zeh/usfxr for more information about usfxr. + /// + [CommandInfo("Audio", + "Play Usfxr Sound", + "Plays a usfxr synth sound. Use the usfxr editor [Tools > Fungus > Utilities > Generate usfxr Sound Effects] to create the SettingsString. Set a ParentTransform if using positional sound. See https://github.com/zeh/usfxr for more information about usfxr.")] + [AddComponentMenu("")] + //[ExecuteInEditMode] + public class PlayUsfxrSound : Command + { + [Tooltip("Transform to use for positional audio")] + [SerializeField] protected Transform ParentTransform = null; + + [Tooltip("Settings string which describes the audio")] + [SerializeField] protected StringDataMulti _SettingsString = new StringDataMulti(""); + + [Tooltip("Time to wait before executing the next command")] + [SerializeField] protected float waitDuration = 0; + + protected SfxrSynth _synth = new SfxrSynth(); + + //Call this if the settings have changed + protected virtual void UpdateCache() + { + if (!string.IsNullOrEmpty(_SettingsString.Value)) + { + _synth.parameters.SetSettingsString(_SettingsString.Value); + _synth.CacheSound(); + } + } + + protected virtual void Awake() + { + //Always build the cache on awake + UpdateCache(); + } + + protected void DoWait() + { + Continue(); + } + + #region Public members + + public override void OnEnter() + { + _synth.SetParentTransform(ParentTransform); + _synth.Play(); + if (Mathf.Approximately(waitDuration, 0f)) + { + Continue(); + } + else + { + Invoke ("DoWait", waitDuration); + } + } + + public override string GetSummary() + { + if (String.IsNullOrEmpty(_SettingsString.Value)) + { + return "Settings String hasn't been set!"; + } + if (ParentTransform != null) + { + return "" + ParentTransform.name + ": " + _SettingsString.Value; + } + return "Camera.main: " + _SettingsString.Value; + } + + public override Color GetButtonColor() + { + return new Color32(128, 200, 200, 255); + } + + public override bool HasReference(Variable variable) + { + return variable == _SettingsString.stringRef; + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("SettingsString")] public String SettingsStringOLD = ""; + + protected virtual void OnEnable() + { + if (SettingsStringOLD != "") + { + _SettingsString.Value = SettingsStringOLD; + SettingsStringOLD = ""; + } + } + + public override void OnValidate() + { + OnEnable(); + base.OnValidate(); + } + + #endregion + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayUsfxrSound.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayUsfxrSound.cs.meta new file mode 100644 index 0000000..d999fa8 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PlayUsfxrSound.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a3ff412ad89846a47a70a620a222cbf8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Portrait.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Portrait.cs new file mode 100644 index 0000000..0b3b1af --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Portrait.cs @@ -0,0 +1,260 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Controls a character portrait. + /// + [CommandInfo("Narrative", + "Portrait", + "Controls a character portrait.")] + public class Portrait : ControlWithDisplay + { + [Tooltip("Stage to display portrait on")] + [SerializeField] protected Stage stage; + + [Tooltip("Character to display")] + [SerializeField] protected Character character; + + [Tooltip("Character to swap with")] + [SerializeField] protected Character replacedCharacter; + + [Tooltip("Portrait to display")] + [SerializeField] protected Sprite portrait; + + [Tooltip("Move the portrait from/to this offset position")] + [SerializeField] protected PositionOffset offset; + + [Tooltip("Move the portrait from this position")] + [SerializeField] protected RectTransform fromPosition; + + [Tooltip("Move the portrait to this position")] + [SerializeField] protected RectTransform toPosition; + + [Tooltip("Direction character is facing")] + [SerializeField] protected FacingDirection facing; + + [Tooltip("Use Default Settings")] + [SerializeField] protected bool useDefaultSettings = true; + + [Tooltip("Fade Duration")] + [SerializeField] protected float fadeDuration = 0.5f; + + [Tooltip("Movement Duration")] + [SerializeField] protected float moveDuration = 1f; + + [Tooltip("Shift Offset")] + [SerializeField] protected Vector2 shiftOffset; + + [Tooltip("Move portrait into new position")] + [SerializeField] protected bool move; + + [Tooltip("Start from offset position")] + [SerializeField] protected bool shiftIntoPlace; + + [Tooltip("Wait until the tween has finished before executing the next command")] + [SerializeField] protected bool waitUntilFinished = false; + + #region Public members + + /// + /// Stage to display portrait on. + /// + public virtual Stage _Stage { get { return stage; } set { stage = value; } } + + /// + /// Character to display. + /// + public virtual Character _Character { get { return character; } set { character = value; } } + + /// + /// Portrait to display. + /// + public virtual Sprite _Portrait { get { return portrait; } set { portrait = value; } } + + /// + /// Move the portrait from/to this offset position. + /// + public virtual PositionOffset Offset { get { return offset; } set { offset = value; } } + + /// + /// Move the portrait from this position. + /// + public virtual RectTransform FromPosition { get { return fromPosition; } set { fromPosition = value;} } + + /// + /// Move the portrait to this position. + /// + public virtual RectTransform ToPosition { get { return toPosition; } set { toPosition = value;} } + + /// + /// Direction character is facing. + /// + public virtual FacingDirection Facing { get { return facing; } set { facing = value; } } + + /// + /// Use Default Settings. + /// + public virtual bool UseDefaultSettings { get { return useDefaultSettings; } set { useDefaultSettings = value; } } + + /// + /// Move portrait into new position. + /// + public virtual bool Move { get { return move; } set { move = value; } } + + /// + /// Start from offset position. + /// + public virtual bool ShiftIntoPlace { get { return shiftIntoPlace; } set { shiftIntoPlace = value; } } + + public override void OnEnter() + { + // Selected "use default Portrait Stage" + if (stage == null) + { + // If no default specified, try to get any portrait stage in the scene + stage = Stage.GetActiveStage(); + // If portrait stage does not exist, do nothing + if (stage == null) + { + Continue(); + return; + } + + } + + // If no display specified, do nothing + if (IsDisplayNone(display)) + { + Continue(); + return; + } + + PortraitOptions options = new PortraitOptions(); + + options.character = character; + options.replacedCharacter = replacedCharacter; + options.portrait = portrait; + options.display = display; + options.offset = offset; + options.fromPosition = fromPosition; + options.toPosition = toPosition; + options.facing = facing; + options.useDefaultSettings = useDefaultSettings; + options.fadeDuration = fadeDuration; + options.moveDuration = moveDuration; + options.shiftOffset = shiftOffset; + options.move = move; + options.shiftIntoPlace = shiftIntoPlace; + options.waitUntilFinished = waitUntilFinished; + + stage.RunPortraitCommand(options, Continue); + + } + + public override string GetSummary() + { + if (display == DisplayType.None && character == null) + { + return "Error: No character or display selected"; + } + else if (display == DisplayType.None) + { + return "Error: No display selected"; + } + else if (character == null) + { + return "Error: No character selected"; + } + + string displaySummary = ""; + string characterSummary = ""; + string fromPositionSummary = ""; + string toPositionSummary = ""; + string stageSummary = ""; + string portraitSummary = ""; + string facingSummary = ""; + + displaySummary = StringFormatter.SplitCamelCase(display.ToString()); + + if (display == DisplayType.Replace) + { + if (replacedCharacter != null) + { + displaySummary += " \"" + replacedCharacter.name + "\" with"; + } + } + + characterSummary = character.name; + if (stage != null) + { + stageSummary = " on \"" + stage.name + "\""; + } + + if (portrait != null) + { + portraitSummary = " " + portrait.name; + } + + if (shiftIntoPlace) + { + if (offset != 0) + { + fromPositionSummary = offset.ToString(); + fromPositionSummary = " from " + "\"" + fromPositionSummary + "\""; + } + } + else if (fromPosition != null) + { + fromPositionSummary = " from " + "\"" + fromPosition.name + "\""; + } + + if (toPosition != null) + { + string toPositionPrefixSummary = ""; + if (move) + { + toPositionPrefixSummary = " to "; + } + else + { + toPositionPrefixSummary = " at "; + } + + toPositionSummary = toPositionPrefixSummary + "\"" + toPosition.name + "\""; + } + + if (facing != FacingDirection.None) + { + if (facing == FacingDirection.Left) + { + facingSummary = "<--"; + } + if (facing == FacingDirection.Right) + { + facingSummary = "-->"; + } + + facingSummary = " facing \"" + facingSummary + "\""; + } + + return displaySummary + " \"" + characterSummary + portraitSummary + "\"" + stageSummary + facingSummary + fromPositionSummary + toPositionSummary; + } + + public override Color GetButtonColor() + { + return new Color32(230, 200, 250, 255); + } + + public override void OnCommandAdded(Block parentBlock) + { + //Default to display type: show + display = DisplayType.Show; + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Portrait.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Portrait.cs.meta new file mode 100644 index 0000000..515ec46 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Portrait.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3ac5ce55bc698fa4290939ef6e426501 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority.meta new file mode 100644 index 0000000..f6aaeb6 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 61d2004f0aa3f1847beb167296c897d8 +folderAsset: yes +timeCreated: 1523180219 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityCount.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityCount.cs new file mode 100644 index 0000000..eaf6dfd --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityCount.cs @@ -0,0 +1,42 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Fungus +{ + /// + /// Copy the value of the Priority Count to a local IntegerVariable, intended primarily to assist with debugging use of Priority. + /// + [CommandInfo("PrioritySignals", + "Get Priority Count", + "Copy the value of the Priority Count to a local IntegerVariable, intended primarily to assist with debugging use of Priority.")] + public class FungusPriorityCount : Command + { + [VariableProperty(typeof(IntegerVariable))] + public IntegerVariable outVar; + + public override void OnEnter() + { + outVar.Value = FungusPrioritySignals.CurrentPriorityDepth; + + Continue(); + } + + public override string GetSummary() + { + if(outVar == null) + { + return "Error: No out var supplied"; + } + return outVar.Key; + } + + public override bool HasReference(Variable variable) + { + return outVar == variable; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityCount.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityCount.cs.meta new file mode 100644 index 0000000..4862a85 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityCount.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a3aeb6a9bd739484080e7965ecaab89e +timeCreated: 1523926493 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityDecrease.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityDecrease.cs new file mode 100644 index 0000000..43ddea3 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityDecrease.cs @@ -0,0 +1,27 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Fungus +{ + /// + /// Decrease the FungusPriority count, causing the related FungusPrioritySignals to fire. + /// Intended to be used to notify external systems that fungus is doing something important and they should perhaps resume. + /// + [CommandInfo("PrioritySignals", + "Priority Down", + "Decrease the FungusPriority count, causing the related FungusPrioritySignals to fire. " + + "Intended to be used to notify external systems that fungus is doing something important and they should perhaps resume.")] + public class FungusPriorityDecrease : Command + { + public override void OnEnter() + { + FungusPrioritySignals.DoDecreasePriorityDepth(); + + Continue(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityDecrease.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityDecrease.cs.meta new file mode 100644 index 0000000..385cd19 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityDecrease.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ebc295ba6aed8944fa3974a64f33cc42 +timeCreated: 1523926493 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityIncrease.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityIncrease.cs new file mode 100644 index 0000000..0be68bf --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityIncrease.cs @@ -0,0 +1,27 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Fungus +{ + /// + /// Increases the FungusPriority count, causing the related FungusPrioritySignals to fire. + /// Intended to be used to notify external systems that fungus is doing something important and they should perhaps pause. + /// + [CommandInfo("PrioritySignals", + "Priority Up", + "Increases the FungusPriority count, causing the related FungusPrioritySignals to fire. " + + "Intended to be used to notify external systems that fungus is doing something important and they should perhaps pause.")] + public class FungusPriorityIncrease : Command + { + public override void OnEnter() + { + FungusPrioritySignals.DoIncreasePriorityDepth(); + + Continue(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityIncrease.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityIncrease.cs.meta new file mode 100644 index 0000000..49d7aed --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityIncrease.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 3d07cf5e706b13a4eb0ae53386c30fbd +timeCreated: 1523926493 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityReset.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityReset.cs new file mode 100644 index 0000000..0ebc39e --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityReset.cs @@ -0,0 +1,25 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Fungus +{ + /// + /// Resets the FungusPriority count to zero. Useful if you are among logic that is hard to have matching increase and decreases. + /// + [CommandInfo("PrioritySignals", + "Priority Reset", + "Resets the FungusPriority count to zero. Useful if you are among logic that is hard to have matching increase and decreases.")] + public class FungusPriorityReset : Command + { + public override void OnEnter() + { + FungusPrioritySignals.DoResetPriority(); + + Continue(); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityReset.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityReset.cs.meta new file mode 100644 index 0000000..7929cf4 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityReset.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: b5b98ba2a3006db49959601485049a0d +timeCreated: 1523926493 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property.meta new file mode 100644 index 0000000..7d2d156 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8a1a00144f44775449d32d39b5a7185a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/AnimatorProperty.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/AnimatorProperty.cs new file mode 100644 index 0000000..26f112c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/AnimatorProperty.cs @@ -0,0 +1,296 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a Animator component + /// + [CommandInfo("Property", + "Animator", + "Get or Set a property of a Animator component")] + [AddComponentMenu("")] + public class AnimatorProperty : BaseVariableProperty + { + //generated property + public enum Property + { + IsOptimizable, + IsHuman, + HasRootMotion, + HumanScale, + IsInitialized, + DeltaPosition, + DeltaRotation, + Velocity, + AngularVelocity, + RootPosition, + RootRotation, + ApplyRootMotion, + HasTransformHierarchy, + GravityWeight, + BodyPosition, + BodyRotation, + StabilizeFeet, + LayerCount, + ParameterCount, + FeetPivotActive, + PivotWeight, + PivotPosition, + IsMatchingTarget, + Speed, + TargetPosition, + TargetRotation, + PlaybackTime, + RecorderStartTime, + RecorderStopTime, + HasBoundPlayables, + LayersAffectMassCenter, + LeftFeetBottomHeight, + RightFeetBottomHeight, + LogWarnings, + FireEvents, + KeepAnimatorControllerStateOnDisable, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + [VariableProperty(typeof(AnimatorVariable))] + protected AnimatorVariable animatorVar; + + [SerializeField] + [VariableProperty(typeof(BooleanVariable), + typeof(FloatVariable), + typeof(Vector3Variable), + typeof(QuaternionVariable), + typeof(IntegerVariable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var iob = inOutVar as BooleanVariable; + var iof = inOutVar as FloatVariable; + var iov = inOutVar as Vector3Variable; + var ioq = inOutVar as QuaternionVariable; + var ioi = inOutVar as IntegerVariable; + + + var target = animatorVar.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.IsOptimizable: + iob.Value = target.isOptimizable; + break; + case Property.IsHuman: + iob.Value = target.isHuman; + break; + case Property.HasRootMotion: + iob.Value = target.hasRootMotion; + break; + case Property.HumanScale: + iof.Value = target.humanScale; + break; + case Property.IsInitialized: + iob.Value = target.isInitialized; + break; + case Property.DeltaPosition: + iov.Value = target.deltaPosition; + break; + case Property.DeltaRotation: + ioq.Value = target.deltaRotation; + break; + case Property.Velocity: + iov.Value = target.velocity; + break; + case Property.AngularVelocity: + iov.Value = target.angularVelocity; + break; + case Property.RootPosition: + iov.Value = target.rootPosition; + break; + case Property.RootRotation: + ioq.Value = target.rootRotation; + break; + case Property.ApplyRootMotion: + iob.Value = target.applyRootMotion; + break; + case Property.HasTransformHierarchy: + iob.Value = target.hasTransformHierarchy; + break; + case Property.GravityWeight: + iof.Value = target.gravityWeight; + break; + case Property.BodyPosition: + iov.Value = target.bodyPosition; + break; + case Property.BodyRotation: + ioq.Value = target.bodyRotation; + break; + case Property.StabilizeFeet: + iob.Value = target.stabilizeFeet; + break; + case Property.LayerCount: + ioi.Value = target.layerCount; + break; + case Property.ParameterCount: + ioi.Value = target.parameterCount; + break; + case Property.FeetPivotActive: + iof.Value = target.feetPivotActive; + break; + case Property.PivotWeight: + iof.Value = target.pivotWeight; + break; + case Property.PivotPosition: + iov.Value = target.pivotPosition; + break; + case Property.IsMatchingTarget: + iob.Value = target.isMatchingTarget; + break; + case Property.Speed: + iof.Value = target.speed; + break; + case Property.TargetPosition: + iov.Value = target.targetPosition; + break; + case Property.TargetRotation: + ioq.Value = target.targetRotation; + break; + case Property.PlaybackTime: + iof.Value = target.playbackTime; + break; + case Property.RecorderStartTime: + iof.Value = target.recorderStartTime; + break; + case Property.RecorderStopTime: + iof.Value = target.recorderStopTime; + break; + case Property.HasBoundPlayables: + iob.Value = target.hasBoundPlayables; + break; + case Property.LayersAffectMassCenter: + iob.Value = target.layersAffectMassCenter; + break; + case Property.LeftFeetBottomHeight: + iof.Value = target.leftFeetBottomHeight; + break; + case Property.RightFeetBottomHeight: + iof.Value = target.rightFeetBottomHeight; + break; + case Property.LogWarnings: + iob.Value = target.logWarnings; + break; + case Property.FireEvents: + iob.Value = target.fireEvents; + break; +#if UNITY_2019_2_OR_NEWER + case Property.KeepAnimatorControllerStateOnDisable: + iob.Value = target.keepAnimatorStateOnDisable; + break; +#endif + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + case Property.RootPosition: + target.rootPosition = iov.Value; + break; + case Property.RootRotation: + target.rootRotation = ioq.Value; + break; + case Property.ApplyRootMotion: + target.applyRootMotion = iob.Value; + break; + case Property.BodyPosition: + target.bodyPosition = iov.Value; + break; + case Property.BodyRotation: + target.bodyRotation = ioq.Value; + break; + case Property.StabilizeFeet: + target.stabilizeFeet = iob.Value; + break; + case Property.FeetPivotActive: + target.feetPivotActive = iof.Value; + break; + case Property.Speed: + target.speed = iof.Value; + break; + case Property.PlaybackTime: + target.playbackTime = iof.Value; + break; + case Property.RecorderStartTime: + target.recorderStartTime = iof.Value; + break; + case Property.RecorderStopTime: + target.recorderStopTime = iof.Value; + break; + case Property.LayersAffectMassCenter: + target.layersAffectMassCenter = iob.Value; + break; + case Property.LogWarnings: + target.logWarnings = iob.Value; + break; + case Property.FireEvents: + target.fireEvents = iob.Value; + break; +#if UNITY_2019_2_OR_NEWER + case Property.KeepAnimatorControllerStateOnDisable: + target.keepAnimatorStateOnDisable = iob.Value; + break; +#endif + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (animatorVar == null) + { + return "Error: no animatorVar set"; + } + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (animatorVar == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/AnimatorProperty.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/AnimatorProperty.cs.meta new file mode 100644 index 0000000..ee1ea32 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/AnimatorProperty.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e4616a794b2245d46970401b3acc492f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/AudioSourceProperty.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/AudioSourceProperty.cs new file mode 100644 index 0000000..3cca2be --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/AudioSourceProperty.cs @@ -0,0 +1,261 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a AudioSource component + /// + [CommandInfo("Property", + "AudioSource", + "Get or Set a property of a AudioSource component")] + [AddComponentMenu("")] + public class AudioSourceProperty : BaseVariableProperty + { + //generated property + public enum Property + { + Volume, + Pitch, + Time, + TimeSamples, + IsPlaying, + IsVirtual, + Loop, + IgnoreListenerVolume, + PlayOnAwake, + IgnoreListenerPause, + PanStereo, + SpatialBlend, + Spatialize, + SpatializePostEffects, + ReverbZoneMix, + BypassEffects, + BypassListenerEffects, + BypassReverbZones, + DopplerLevel, + Spread, + Priority, + Mute, + MinDistance, + MaxDistance, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + [VariableProperty(typeof(AudioSourceVariable))] + protected AudioSourceVariable audioSourceVar; + + [SerializeField] + [VariableProperty(typeof(FloatVariable), + typeof(IntegerVariable), + typeof(BooleanVariable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var iof = inOutVar as FloatVariable; + var ioi = inOutVar as IntegerVariable; + var iob = inOutVar as BooleanVariable; + + + var target = audioSourceVar.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.Volume: + iof.Value = target.volume; + break; + case Property.Pitch: + iof.Value = target.pitch; + break; + case Property.Time: + iof.Value = target.time; + break; + case Property.TimeSamples: + ioi.Value = target.timeSamples; + break; + case Property.IsPlaying: + iob.Value = target.isPlaying; + break; + case Property.IsVirtual: + iob.Value = target.isVirtual; + break; + case Property.Loop: + iob.Value = target.loop; + break; + case Property.IgnoreListenerVolume: + iob.Value = target.ignoreListenerVolume; + break; + case Property.PlayOnAwake: + iob.Value = target.playOnAwake; + break; + case Property.IgnoreListenerPause: + iob.Value = target.ignoreListenerPause; + break; + case Property.PanStereo: + iof.Value = target.panStereo; + break; + case Property.SpatialBlend: + iof.Value = target.spatialBlend; + break; + case Property.Spatialize: + iob.Value = target.spatialize; + break; + case Property.SpatializePostEffects: + iob.Value = target.spatializePostEffects; + break; + case Property.ReverbZoneMix: + iof.Value = target.reverbZoneMix; + break; + case Property.BypassEffects: + iob.Value = target.bypassEffects; + break; + case Property.BypassListenerEffects: + iob.Value = target.bypassListenerEffects; + break; + case Property.BypassReverbZones: + iob.Value = target.bypassReverbZones; + break; + case Property.DopplerLevel: + iof.Value = target.dopplerLevel; + break; + case Property.Spread: + iof.Value = target.spread; + break; + case Property.Priority: + ioi.Value = target.priority; + break; + case Property.Mute: + iob.Value = target.mute; + break; + case Property.MinDistance: + iof.Value = target.minDistance; + break; + case Property.MaxDistance: + iof.Value = target.maxDistance; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + case Property.Volume: + target.volume = iof.Value; + break; + case Property.Pitch: + target.pitch = iof.Value; + break; + case Property.Time: + target.time = iof.Value; + break; + case Property.TimeSamples: + target.timeSamples = ioi.Value; + break; + case Property.Loop: + target.loop = iob.Value; + break; + case Property.IgnoreListenerVolume: + target.ignoreListenerVolume = iob.Value; + break; + case Property.PlayOnAwake: + target.playOnAwake = iob.Value; + break; + case Property.IgnoreListenerPause: + target.ignoreListenerPause = iob.Value; + break; + case Property.PanStereo: + target.panStereo = iof.Value; + break; + case Property.SpatialBlend: + target.spatialBlend = iof.Value; + break; + case Property.Spatialize: + target.spatialize = iob.Value; + break; + case Property.SpatializePostEffects: + target.spatializePostEffects = iob.Value; + break; + case Property.ReverbZoneMix: + target.reverbZoneMix = iof.Value; + break; + case Property.BypassEffects: + target.bypassEffects = iob.Value; + break; + case Property.BypassListenerEffects: + target.bypassListenerEffects = iob.Value; + break; + case Property.BypassReverbZones: + target.bypassReverbZones = iob.Value; + break; + case Property.DopplerLevel: + target.dopplerLevel = iof.Value; + break; + case Property.Spread: + target.spread = iof.Value; + break; + case Property.Priority: + target.priority = ioi.Value; + break; + case Property.Mute: + target.mute = iob.Value; + break; + case Property.MinDistance: + target.minDistance = iof.Value; + break; + case Property.MaxDistance: + target.maxDistance = iof.Value; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (audioSourceVar == null) + { + return "Error: no audioSourceVar set"; + } + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (audioSourceVar == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/AudioSourceProperty.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/AudioSourceProperty.cs.meta new file mode 100644 index 0000000..533d3d7 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/AudioSourceProperty.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2250cfac690a2b74f8f9dd9be91985c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/CollectionProperty.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/CollectionProperty.cs new file mode 100644 index 0000000..08792f4 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/CollectionProperty.cs @@ -0,0 +1,125 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a Collection component + /// + [CommandInfo("Property", + "Collection", + "Get or Set a property of a Collection component")] + [AddComponentMenu("")] + public class CollectionProperty : BaseVariableProperty + { + //generated property + public enum Property + { + Capacity, + Count, + IsFixedSize, + IsReadOnly, + IsSynchronized, + Name, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + protected CollectionData collectionData; + + [SerializeField] + [VariableProperty(typeof(IntegerVariable), + typeof(BooleanVariable), + typeof(StringVariable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var ioi = inOutVar as IntegerVariable; + var iob = inOutVar as BooleanVariable; + var ios = inOutVar as StringVariable; + + + var target = collectionData.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.Capacity: + ioi.Value = target.Capacity; + break; + case Property.Count: + ioi.Value = target.Count; + break; + case Property.IsFixedSize: + iob.Value = target.IsFixedSize; + break; + case Property.IsReadOnly: + iob.Value = target.IsReadOnly; + break; + case Property.IsSynchronized: + iob.Value = target.IsSynchronized; + break; + case Property.Name: + ios.Value = target.Name; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + case Property.Capacity: + target.Capacity = ioi.Value; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (collectionData.Value == null) + { + return "Error: no collection set"; + } + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (collectionData.collectionRef == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/CollectionProperty.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/CollectionProperty.cs.meta new file mode 100644 index 0000000..acc5918 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/CollectionProperty.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6f03dcf7e7a1d2e418e5588731888b5a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Collider2DProperty.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Collider2DProperty.cs new file mode 100644 index 0000000..4a8e464 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Collider2DProperty.cs @@ -0,0 +1,153 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a Collider2D component + /// + [CommandInfo("Property", + "Collider2D", + "Get or Set a property of a Collider2D component")] + [AddComponentMenu("")] + public class Collider2DProperty : BaseVariableProperty + { + //generated property + public enum Property + { + Density, + IsTrigger, + UsedByEffector, + UsedByComposite, + Offset, + AttachedRigidbody, + ShapeCount, + Friction, + Bounciness, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + protected Collider2DData collider2DData; + + [SerializeField] + [VariableProperty(typeof(FloatVariable), + typeof(BooleanVariable), + typeof(Vector2Variable), + typeof(Rigidbody2DVariable), + typeof(IntegerVariable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var iof = inOutVar as FloatVariable; + var iob = inOutVar as BooleanVariable; + var iov2 = inOutVar as Vector2Variable; + var iorb2d = inOutVar as Rigidbody2DVariable; + var ioi = inOutVar as IntegerVariable; + + + var target = collider2DData.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.Density: + iof.Value = target.density; + break; + case Property.IsTrigger: + iob.Value = target.isTrigger; + break; + case Property.UsedByEffector: + iob.Value = target.usedByEffector; + break; + case Property.UsedByComposite: + iob.Value = target.usedByComposite; + break; + case Property.Offset: + iov2.Value = target.offset; + break; + case Property.AttachedRigidbody: + iorb2d.Value = target.attachedRigidbody; + break; + case Property.ShapeCount: + ioi.Value = target.shapeCount; + break; + case Property.Friction: + iof.Value = target.friction; + break; + case Property.Bounciness: + iof.Value = target.bounciness; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + case Property.Density: + target.density = iof.Value; + break; + case Property.IsTrigger: + target.isTrigger = iob.Value; + break; + case Property.UsedByEffector: + target.usedByEffector = iob.Value; + break; + case Property.UsedByComposite: + target.usedByComposite = iob.Value; + break; + case Property.Offset: + target.offset = iov2.Value; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (collider2DData.Value == null) + { + return "Error: no collider2D set"; + } + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (collider2DData.collider2DRef == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Collider2DProperty.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Collider2DProperty.cs.meta new file mode 100644 index 0000000..b4d91cc --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Collider2DProperty.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: c5d345b268622414c9bb53e05f4580ed +timeCreated: 1517559095 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ColliderProperty.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ColliderProperty.cs new file mode 100644 index 0000000..2272ea6 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ColliderProperty.cs @@ -0,0 +1,123 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a Collider component + /// + [CommandInfo("Property", + "Collider", + "Get or Set a property of a Collider component")] + [AddComponentMenu("")] + public class ColliderProperty : BaseVariableProperty + { + //generated property + public enum Property + { + Enabled, + AttachedRigidbody, + IsTrigger, + ContactOffset, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + protected ColliderData colliderData; + + [SerializeField] + [VariableProperty(typeof(BooleanVariable), + typeof(RigidbodyVariable), + typeof(FloatVariable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var iob = inOutVar as BooleanVariable; + var iorb = inOutVar as RigidbodyVariable; + var iof = inOutVar as FloatVariable; + + + var target = colliderData.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.Enabled: + iob.Value = target.enabled; + break; + case Property.AttachedRigidbody: + iorb.Value = target.attachedRigidbody; + break; + case Property.IsTrigger: + iob.Value = target.isTrigger; + break; + case Property.ContactOffset: + iof.Value = target.contactOffset; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + case Property.Enabled: + target.enabled = iob.Value; + break; + case Property.IsTrigger: + target.isTrigger = iob.Value; + break; + case Property.ContactOffset: + target.contactOffset = iof.Value; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (colliderData.Value == null) + { + return "Error: no collider set"; + } + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (colliderData.colliderRef == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ColliderProperty.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ColliderProperty.cs.meta new file mode 100644 index 0000000..b037186 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ColliderProperty.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ca6e05b34c44a734988887ef775a1a1b +timeCreated: 1517559091 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Collision2DProperty.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Collision2DProperty.cs new file mode 100644 index 0000000..df50617 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Collision2DProperty.cs @@ -0,0 +1,147 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a Collision2D component + /// + [CommandInfo("Property", + "Collision2D", + "Get or Set a property of a Collision2D component")] + [AddComponentMenu("")] + public class Collision2DProperty : BaseVariableProperty + { + //generated property + public enum Property + { + Rigidbody, + OtherRigidbody, + Transform, + GameObject, + RelativeVelocity, + Enabled, + Collider, + OtherCollider, + ContactCount, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + [VariableProperty(typeof(Collision2DVariable))] + protected Collision2DVariable collision2DVar; + + [SerializeField] + [VariableProperty(typeof(Collider2DVariable), + typeof(Rigidbody2DVariable), + typeof(TransformVariable), + typeof(GameObjectVariable), + typeof(Vector2Variable), + typeof(BooleanVariable), + typeof(IntegerVariable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var ioc2d = inOutVar as Collider2DVariable; + var iorb2d = inOutVar as Rigidbody2DVariable; + var iot = inOutVar as TransformVariable; + var iogo = inOutVar as GameObjectVariable; + var iov2 = inOutVar as Vector2Variable; + var iob = inOutVar as BooleanVariable; +#if UNITY_2019_2_OR_NEWER + var ioi = inOutVar as IntegerVariable; +#endif + + + var target = collision2DVar.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.Collider: + ioc2d.Value = target.collider; + break; + case Property.OtherCollider: + ioc2d.Value = target.otherCollider; + break; + case Property.Rigidbody: + iorb2d.Value = target.rigidbody; + break; + case Property.OtherRigidbody: + iorb2d.Value = target.otherRigidbody; + break; + case Property.Transform: + iot.Value = target.transform; + break; + case Property.GameObject: + iogo.Value = target.gameObject; + break; + case Property.RelativeVelocity: + iov2.Value = target.relativeVelocity; + break; + case Property.Enabled: + iob.Value = target.enabled; + break; +#if UNITY_2019_2_OR_NEWER + case Property.ContactCount: + ioi.Value = target.contactCount; + break; +#endif + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (collision2DVar == null) + { + return "Error: no collision2DVar set"; + } + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (collision2DVar == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Collision2DProperty.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Collision2DProperty.cs.meta new file mode 100644 index 0000000..e13e15d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Collision2DProperty.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 8556e15e3a9145740815675ae531a7cd +timeCreated: 1517559039 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/CollisionProperty.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/CollisionProperty.cs new file mode 100644 index 0000000..6343654 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/CollisionProperty.cs @@ -0,0 +1,127 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a Collision component + /// + [CommandInfo("Property", + "Collision", + "Get or Set a property of a Collision component")] + [AddComponentMenu("")] + public class CollisionProperty : BaseVariableProperty + { + //generated property + public enum Property + { + RelativeVelocity, + Rigidbody, + Collider, + Transform, + GameObject, + Impulse, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + [VariableProperty(typeof(CollisionVariable))] + protected CollisionVariable collisionVar; + + [SerializeField] + [VariableProperty(typeof(Vector3Variable), + typeof(RigidbodyVariable), + typeof(ColliderVariable), + typeof(TransformVariable), + typeof(GameObjectVariable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var iov = inOutVar as Vector3Variable; + var iorb = inOutVar as RigidbodyVariable; + var ioc = inOutVar as ColliderVariable; + var iot = inOutVar as TransformVariable; + var iogo = inOutVar as GameObjectVariable; + + + var target = collisionVar.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.RelativeVelocity: + iov.Value = target.relativeVelocity; + break; + case Property.Rigidbody: + iorb.Value = target.rigidbody; + break; + case Property.Collider: + ioc.Value = target.collider; + break; + case Property.Transform: + iot.Value = target.transform; + break; + case Property.GameObject: + iogo.Value = target.gameObject; + break; + case Property.Impulse: + iov.Value = target.impulse; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (collisionVar == null) + { + return "Error: no collisionVar set"; + } + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (collisionVar == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/CollisionProperty.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/CollisionProperty.cs.meta new file mode 100644 index 0000000..9f3fc58 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/CollisionProperty.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 5d7861de0e23aac439a4959cd06b3d09 +timeCreated: 1517559033 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ColorProperty.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ColorProperty.cs new file mode 100644 index 0000000..ded43cf --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ColorProperty.cs @@ -0,0 +1,139 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a Color component + /// + [CommandInfo("Property", + "Color", + "Get or Set a property of a Color component")] + [AddComponentMenu("")] + public class ColorProperty : BaseVariableProperty + { + //generated property + public enum Property + { + R, + G, + B, + A, + Grayscale, + Linear, + Gamma, + MaxColorComponent, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + [VariableProperty(typeof(ColorVariable))] + protected ColorVariable colorVar; + + [SerializeField] + [VariableProperty(typeof(FloatVariable), + typeof(ColorVariable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var iof = inOutVar as FloatVariable; + var iocol = inOutVar as ColorVariable; + + + var target = colorVar.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.R: + iof.Value = target.r; + break; + case Property.G: + iof.Value = target.g; + break; + case Property.B: + iof.Value = target.b; + break; + case Property.A: + iof.Value = target.a; + break; + case Property.Grayscale: + iof.Value = target.grayscale; + break; + case Property.Linear: + iocol.Value = target.linear; + break; + case Property.Gamma: + iocol.Value = target.gamma; + break; + case Property.MaxColorComponent: + iof.Value = target.maxColorComponent; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + case Property.R: + target.r = iof.Value; + break; + case Property.G: + target.g = iof.Value; + break; + case Property.B: + target.b = iof.Value; + break; + case Property.A: + target.a = iof.Value; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + colorVar.Value = target; + + Continue(); + } + + public override string GetSummary() + { + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (colorVar == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ColorProperty.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ColorProperty.cs.meta new file mode 100644 index 0000000..e74334c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ColorProperty.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8c9c405ac7b91be439696c5607bddb01 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ControllerColliderHitProperty.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ControllerColliderHitProperty.cs new file mode 100644 index 0000000..7be49bb --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ControllerColliderHitProperty.cs @@ -0,0 +1,137 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a ControllerColliderHit component + /// + [CommandInfo("Property", + "ControllerColliderHit", + "Get or Set a property of a ControllerColliderHit component")] + [AddComponentMenu("")] + public class ControllerColliderHitProperty : BaseVariableProperty + { + //generated property + public enum Property + { + Collider, + Rigidbody, + GameObject, + Transform, + Point, + Normal, + MoveDirection, + MoveLength, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + [VariableProperty(typeof(ControllerColliderHitVariable))] + protected ControllerColliderHitVariable controllerColliderHitVar; + + [SerializeField] + [VariableProperty(typeof(ColliderVariable), + typeof(RigidbodyVariable), + typeof(GameObjectVariable), + typeof(TransformVariable), + typeof(Vector3Variable), + typeof(FloatVariable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var ioc = inOutVar as ColliderVariable; + var iorb = inOutVar as RigidbodyVariable; + var iogo = inOutVar as GameObjectVariable; + var iot = inOutVar as TransformVariable; + var iov = inOutVar as Vector3Variable; + var iof = inOutVar as FloatVariable; + + + var target = controllerColliderHitVar.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.Collider: + ioc.Value = target.collider; + break; + case Property.Rigidbody: + iorb.Value = target.rigidbody; + break; + case Property.GameObject: + iogo.Value = target.gameObject; + break; + case Property.Transform: + iot.Value = target.transform; + break; + case Property.Point: + iov.Value = target.point; + break; + case Property.Normal: + iov.Value = target.normal; + break; + case Property.MoveDirection: + iov.Value = target.moveDirection; + break; + case Property.MoveLength: + iof.Value = target.moveLength; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (controllerColliderHitVar == null) + { + return "Error: no controllerColliderHitVar set"; + } + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (controllerColliderHitVar == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ControllerColliderHitProperty.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ControllerColliderHitProperty.cs.meta new file mode 100644 index 0000000..49532f4 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/ControllerColliderHitProperty.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 706c416dcce1daf4188e35d5981ac45f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/GameObjectProperty.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/GameObjectProperty.cs new file mode 100644 index 0000000..6d669fc --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/GameObjectProperty.cs @@ -0,0 +1,140 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a GameObject component + /// + [CommandInfo("Property", + "GameObject", + "Get or Set a property of a GameObject component")] + [AddComponentMenu("")] + public class GameObjectProperty : BaseVariableProperty + { + //generated property + public enum Property + { + Transform, + Layer, + ActiveSelf, + ActiveInHierarchy, + IsStatic, + Tag, + GameObject, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + [VariableProperty(typeof(GameObjectVariable))] + protected GameObjectVariable gameObjectVar; + + [SerializeField] + [VariableProperty(typeof(TransformVariable), + typeof(IntegerVariable), + typeof(BooleanVariable), + typeof(StringVariable), + typeof(GameObjectVariable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var iot = inOutVar as TransformVariable; + var ioi = inOutVar as IntegerVariable; + var iob = inOutVar as BooleanVariable; + var ios = inOutVar as StringVariable; + var iogo = inOutVar as GameObjectVariable; + + + var target = gameObjectVar.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.Transform: + iot.Value = target.transform; + break; + case Property.Layer: + ioi.Value = target.layer; + break; + case Property.ActiveSelf: + iob.Value = target.activeSelf; + break; + case Property.ActiveInHierarchy: + iob.Value = target.activeInHierarchy; + break; + case Property.IsStatic: + iob.Value = target.isStatic; + break; + case Property.Tag: + ios.Value = target.tag; + break; + case Property.GameObject: + iogo.Value = target.gameObject; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + case Property.Layer: + target.layer = ioi.Value; + break; + case Property.IsStatic: + target.isStatic = iob.Value; + break; + case Property.Tag: + target.tag = ios.Value; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (gameObjectVar == null) + { + return "Error: no gameObjectVar set"; + } + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (gameObjectVar == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/GameObjectProperty.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/GameObjectProperty.cs.meta new file mode 100644 index 0000000..94d39da --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/GameObjectProperty.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 121c2a4d38c149443adb81911f0fdd61 +timeCreated: 1517613000 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/MaterialProperty.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/MaterialProperty.cs new file mode 100644 index 0000000..be1a846 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/MaterialProperty.cs @@ -0,0 +1,156 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a Material component + /// + [CommandInfo("Property", + "Material", + "Get or Set a property of a Material component")] + [AddComponentMenu("")] + public class MaterialProperty : BaseVariableProperty + { + //generated property + public enum Property + { + Color, + MainTexture, + MainTextureOffset, + MainTextureScale, + RenderQueue, + DoubleSidedGI, + EnableInstancing, + PassCount, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + [VariableProperty(typeof(MaterialVariable))] + protected MaterialVariable materialVar; + + [SerializeField] + [VariableProperty(typeof(ColorVariable), + typeof(TextureVariable), + typeof(Vector2Variable), + typeof(IntegerVariable), + typeof(BooleanVariable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var iocol = inOutVar as ColorVariable; + var iotex = inOutVar as TextureVariable; + var iov2 = inOutVar as Vector2Variable; + var ioi = inOutVar as IntegerVariable; + var iob = inOutVar as BooleanVariable; + + + var target = materialVar.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.Color: + iocol.Value = target.color; + break; + case Property.MainTexture: + iotex.Value = target.mainTexture; + break; + case Property.MainTextureOffset: + iov2.Value = target.mainTextureOffset; + break; + case Property.MainTextureScale: + iov2.Value = target.mainTextureScale; + break; + case Property.RenderQueue: + ioi.Value = target.renderQueue; + break; + case Property.DoubleSidedGI: + iob.Value = target.doubleSidedGI; + break; + case Property.EnableInstancing: + iob.Value = target.enableInstancing; + break; + case Property.PassCount: + ioi.Value = target.passCount; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + case Property.Color: + target.color = iocol.Value; + break; + case Property.MainTexture: + target.mainTexture = iotex.Value; + break; + case Property.MainTextureOffset: + target.mainTextureOffset = iov2.Value; + break; + case Property.MainTextureScale: + target.mainTextureScale = iov2.Value; + break; + case Property.RenderQueue: + target.renderQueue = ioi.Value; + break; + case Property.DoubleSidedGI: + target.doubleSidedGI = iob.Value; + break; + case Property.EnableInstancing: + target.enableInstancing = iob.Value; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (materialVar == null) + { + return "Error: no materialVar set"; + } + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (materialVar == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/MaterialProperty.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/MaterialProperty.cs.meta new file mode 100644 index 0000000..65888d7 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/MaterialProperty.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 363b2ba6b0053774884b097fb9312a46 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Matrix4x4Property.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Matrix4x4Property.cs new file mode 100644 index 0000000..0c05ddd --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Matrix4x4Property.cs @@ -0,0 +1,236 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a Matrix4x4 component + /// + [CommandInfo("Property", + "Matrix4x4", + "Get or Set a property of a Matrix4x4 component")] + [AddComponentMenu("")] + public class Matrix4x4Property : BaseVariableProperty + { + //generated property + public enum Property + { + M00, + M10, + M20, + M30, + M01, + M11, + M21, + M31, + M02, + M12, + M22, + M32, + M03, + M13, + M23, + M33, + Inverse, + Transpose, + Rotation, + LossyScale, + IsIdentity, + Determinant, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + protected Matrix4x4Data matrix4x4Data; + + [SerializeField] + [VariableProperty(typeof(FloatVariable), + typeof(QuaternionVariable), + typeof(Vector3Variable), + typeof(BooleanVariable), + typeof(Matrix4x4Variable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var iof = inOutVar as FloatVariable; + var ioq = inOutVar as QuaternionVariable; + var iov = inOutVar as Vector3Variable; + var iob = inOutVar as BooleanVariable; + var iom4 = inOutVar as Matrix4x4Variable; + + + var target = matrix4x4Data.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.M00: + iof.Value = target.m00; + break; + case Property.M10: + iof.Value = target.m10; + break; + case Property.M20: + iof.Value = target.m20; + break; + case Property.M30: + iof.Value = target.m30; + break; + case Property.M01: + iof.Value = target.m01; + break; + case Property.M11: + iof.Value = target.m11; + break; + case Property.M21: + iof.Value = target.m21; + break; + case Property.M31: + iof.Value = target.m31; + break; + case Property.M02: + iof.Value = target.m02; + break; + case Property.M12: + iof.Value = target.m12; + break; + case Property.M22: + iof.Value = target.m22; + break; + case Property.M32: + iof.Value = target.m32; + break; + case Property.M03: + iof.Value = target.m03; + break; + case Property.M13: + iof.Value = target.m13; + break; + case Property.M23: + iof.Value = target.m23; + break; + case Property.M33: + iof.Value = target.m33; + break; + case Property.Rotation: + ioq.Value = target.rotation; + break; + case Property.LossyScale: + iov.Value = target.lossyScale; + break; + case Property.IsIdentity: + iob.Value = target.isIdentity; + break; + case Property.Determinant: + iof.Value = target.determinant; + break; + case Property.Inverse: + iom4.Value = target.inverse; + break; + case Property.Transpose: + iom4.Value = target.transpose; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + case Property.M00: + target.m00 = iof.Value; + break; + case Property.M10: + target.m10 = iof.Value; + break; + case Property.M20: + target.m20 = iof.Value; + break; + case Property.M30: + target.m30 = iof.Value; + break; + case Property.M01: + target.m01 = iof.Value; + break; + case Property.M11: + target.m11 = iof.Value; + break; + case Property.M21: + target.m21 = iof.Value; + break; + case Property.M31: + target.m31 = iof.Value; + break; + case Property.M02: + target.m02 = iof.Value; + break; + case Property.M12: + target.m12 = iof.Value; + break; + case Property.M22: + target.m22 = iof.Value; + break; + case Property.M32: + target.m32 = iof.Value; + break; + case Property.M03: + target.m03 = iof.Value; + break; + case Property.M13: + target.m13 = iof.Value; + break; + case Property.M23: + target.m23 = iof.Value; + break; + case Property.M33: + target.m33 = iof.Value; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + matrix4x4Data.Value = target; + + Continue(); + } + + public override string GetSummary() + { + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (matrix4x4Data.matrix4x4Ref == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Matrix4x4Property.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Matrix4x4Property.cs.meta new file mode 100644 index 0000000..cd528c7 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Matrix4x4Property.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 37ada407c7c9fab46abba0d40c27fa96 +timeCreated: 1513287480 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/QuaternionProperty.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/QuaternionProperty.cs new file mode 100644 index 0000000..6871ba7 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/QuaternionProperty.cs @@ -0,0 +1,139 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a Quaternion component + /// + [CommandInfo("Property", + "Quaternion", + "Get or Set a property of a Quaternion component")] + [AddComponentMenu("")] + public class QuaternionProperty : BaseVariableProperty + { + //generated property + public enum Property + { + X, + Y, + Z, + W, + EulerAngles, + Normalized, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + protected QuaternionData quaternionData; + + [SerializeField] + [VariableProperty(typeof(FloatVariable), + typeof(Vector3Variable), + typeof(QuaternionVariable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var iof = inOutVar as FloatVariable; + var iov = inOutVar as Vector3Variable; +#if UNITY_2019_2_OR_NEWER + var ioq = inOutVar as QuaternionVariable; +#endif + + + var target = quaternionData.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.X: + iof.Value = target.x; + break; + case Property.Y: + iof.Value = target.y; + break; + case Property.Z: + iof.Value = target.z; + break; + case Property.W: + iof.Value = target.w; + break; + case Property.EulerAngles: + iov.Value = target.eulerAngles; + break; +#if UNITY_2019_2_OR_NEWER + case Property.Normalized: + ioq.Value = target.normalized; + break; +#endif + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + case Property.X: + target.x = iof.Value; + break; + case Property.Y: + target.y = iof.Value; + break; + case Property.Z: + target.z = iof.Value; + break; + case Property.W: + target.w = iof.Value; + break; + case Property.EulerAngles: + target.eulerAngles = iov.Value; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + quaternionData.Value = target; + + Continue(); + } + + public override string GetSummary() + { + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (quaternionData.quaternionRef == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/QuaternionProperty.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/QuaternionProperty.cs.meta new file mode 100644 index 0000000..7fc4480 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/QuaternionProperty.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1082e9a99a168824583a459d59a448a0 +timeCreated: 1513287464 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Rigidbody2DProperty.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Rigidbody2DProperty.cs new file mode 100644 index 0000000..fd52a10 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Rigidbody2DProperty.cs @@ -0,0 +1,213 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a Rigidbody2D component + /// + [CommandInfo("Property", + "Rigidbody2D", + "Get or Set a property of a Rigidbody2D component")] + [AddComponentMenu("")] + public class Rigidbody2DProperty : BaseVariableProperty + { + //generated property + public enum Property + { + Position, + Rotation, + Velocity, + AngularVelocity, + UseAutoMass, + Mass, + CenterOfMass, + WorldCenterOfMass, + Inertia, + Drag, + AngularDrag, + GravityScale, + UseFullKinematicContacts, + IsKinematic, + FreezeRotation, + Simulated, + AttachedColliderCount, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + protected Rigidbody2DData rigidbody2DData; + + [SerializeField] + [VariableProperty(typeof(Vector2Variable), + typeof(FloatVariable), + typeof(BooleanVariable), + typeof(IntegerVariable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var iov2 = inOutVar as Vector2Variable; + var iof = inOutVar as FloatVariable; + var iob = inOutVar as BooleanVariable; + var ioi = inOutVar as IntegerVariable; + + + var target = rigidbody2DData.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.Position: + iov2.Value = target.position; + break; + case Property.Rotation: + iof.Value = target.rotation; + break; + case Property.Velocity: + iov2.Value = target.velocity; + break; + case Property.AngularVelocity: + iof.Value = target.angularVelocity; + break; + case Property.UseAutoMass: + iob.Value = target.useAutoMass; + break; + case Property.Mass: + iof.Value = target.mass; + break; + case Property.CenterOfMass: + iov2.Value = target.centerOfMass; + break; + case Property.WorldCenterOfMass: + iov2.Value = target.worldCenterOfMass; + break; + case Property.Inertia: + iof.Value = target.inertia; + break; + case Property.Drag: + iof.Value = target.drag; + break; + case Property.AngularDrag: + iof.Value = target.angularDrag; + break; + case Property.GravityScale: + iof.Value = target.gravityScale; + break; + case Property.UseFullKinematicContacts: + iob.Value = target.useFullKinematicContacts; + break; + case Property.IsKinematic: + iob.Value = target.isKinematic; + break; + case Property.FreezeRotation: + iob.Value = target.freezeRotation; + break; + case Property.Simulated: + iob.Value = target.simulated; + break; + case Property.AttachedColliderCount: + ioi.Value = target.attachedColliderCount; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + case Property.Position: + target.position = iov2.Value; + break; + case Property.Rotation: + target.rotation = iof.Value; + break; + case Property.Velocity: + target.velocity = iov2.Value; + break; + case Property.AngularVelocity: + target.angularVelocity = iof.Value; + break; + case Property.UseAutoMass: + target.useAutoMass = iob.Value; + break; + case Property.Mass: + target.mass = iof.Value; + break; + case Property.CenterOfMass: + target.centerOfMass = iov2.Value; + break; + case Property.Inertia: + target.inertia = iof.Value; + break; + case Property.Drag: + target.drag = iof.Value; + break; + case Property.AngularDrag: + target.angularDrag = iof.Value; + break; + case Property.GravityScale: + target.gravityScale = iof.Value; + break; + case Property.UseFullKinematicContacts: + target.useFullKinematicContacts = iob.Value; + break; + case Property.IsKinematic: + target.isKinematic = iob.Value; + break; + case Property.FreezeRotation: + target.freezeRotation = iob.Value; + break; + case Property.Simulated: + target.simulated = iob.Value; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (rigidbody2DData.Value == null) + { + return "Error: no rigidbody2D set"; + } + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (rigidbody2DData.rigidbody2DRef == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Rigidbody2DProperty.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Rigidbody2DProperty.cs.meta new file mode 100644 index 0000000..2cda84a --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Rigidbody2DProperty.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 3e16d7fb8c3b00d4c969c48110fc69c2 +timeCreated: 1517559027 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/RigidbodyProperty.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/RigidbodyProperty.cs new file mode 100644 index 0000000..1506cb4 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/RigidbodyProperty.cs @@ -0,0 +1,239 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a Rigidbody component + /// + [CommandInfo("Property", + "Rigidbody", + "Get or Set a property of a Rigidbody component")] + [AddComponentMenu("")] + public class RigidbodyProperty : BaseVariableProperty + { + //generated property + public enum Property + { + Velocity, + AngularVelocity, + Drag, + AngularDrag, + Mass, + UseGravity, + MaxDepenetrationVelocity, + IsKinematic, + FreezeRotation, + CenterOfMass, + WorldCenterOfMass, + InertiaTensorRotation, + InertiaTensor, + DetectCollisions, + Position, + Rotation, + SolverIterations, + SolverVelocityIterations, + SleepThreshold, + MaxAngularVelocity, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + protected RigidbodyData rigidbodyData; + + [SerializeField] + [VariableProperty(typeof(Vector3Variable), + typeof(FloatVariable), + typeof(BooleanVariable), + typeof(QuaternionVariable), + typeof(IntegerVariable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var iov = inOutVar as Vector3Variable; + var iof = inOutVar as FloatVariable; + var iob = inOutVar as BooleanVariable; + var ioq = inOutVar as QuaternionVariable; + var ioi = inOutVar as IntegerVariable; + + + var target = rigidbodyData.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.Velocity: + iov.Value = target.velocity; + break; + case Property.AngularVelocity: + iov.Value = target.angularVelocity; + break; + case Property.Drag: + iof.Value = target.drag; + break; + case Property.AngularDrag: + iof.Value = target.angularDrag; + break; + case Property.Mass: + iof.Value = target.mass; + break; + case Property.UseGravity: + iob.Value = target.useGravity; + break; + case Property.MaxDepenetrationVelocity: + iof.Value = target.maxDepenetrationVelocity; + break; + case Property.IsKinematic: + iob.Value = target.isKinematic; + break; + case Property.FreezeRotation: + iob.Value = target.freezeRotation; + break; + case Property.CenterOfMass: + iov.Value = target.centerOfMass; + break; + case Property.WorldCenterOfMass: + iov.Value = target.worldCenterOfMass; + break; + case Property.InertiaTensorRotation: + ioq.Value = target.inertiaTensorRotation; + break; + case Property.InertiaTensor: + iov.Value = target.inertiaTensor; + break; + case Property.DetectCollisions: + iob.Value = target.detectCollisions; + break; + case Property.Position: + iov.Value = target.position; + break; + case Property.Rotation: + ioq.Value = target.rotation; + break; + case Property.SolverIterations: + ioi.Value = target.solverIterations; + break; + case Property.SleepThreshold: + iof.Value = target.sleepThreshold; + break; + case Property.MaxAngularVelocity: + iof.Value = target.maxAngularVelocity; + break; + case Property.SolverVelocityIterations: + ioi.Value = target.solverVelocityIterations; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + case Property.Velocity: + target.velocity = iov.Value; + break; + case Property.AngularVelocity: + target.angularVelocity = iov.Value; + break; + case Property.Drag: + target.drag = iof.Value; + break; + case Property.AngularDrag: + target.angularDrag = iof.Value; + break; + case Property.Mass: + target.mass = iof.Value; + break; + case Property.UseGravity: + target.useGravity = iob.Value; + break; + case Property.MaxDepenetrationVelocity: + target.maxDepenetrationVelocity = iof.Value; + break; + case Property.IsKinematic: + target.isKinematic = iob.Value; + break; + case Property.FreezeRotation: + target.freezeRotation = iob.Value; + break; + case Property.CenterOfMass: + target.centerOfMass = iov.Value; + break; + case Property.InertiaTensorRotation: + target.inertiaTensorRotation = ioq.Value; + break; + case Property.InertiaTensor: + target.inertiaTensor = iov.Value; + break; + case Property.DetectCollisions: + target.detectCollisions = iob.Value; + break; + case Property.Position: + target.position = iov.Value; + break; + case Property.Rotation: + target.rotation = ioq.Value; + break; + case Property.SolverIterations: + target.solverIterations = ioi.Value; + break; + case Property.SleepThreshold: + target.sleepThreshold = iof.Value; + break; + case Property.MaxAngularVelocity: + target.maxAngularVelocity = iof.Value; + break; + case Property.SolverVelocityIterations: + target.solverVelocityIterations = ioi.Value; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (rigidbodyData.Value == null) + { + return "Error: no rigidbody set"; + } + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (rigidbodyData.rigidbodyRef == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/RigidbodyProperty.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/RigidbodyProperty.cs.meta new file mode 100644 index 0000000..c554411 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/RigidbodyProperty.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: cdf9b24957fec22439bac2223dd88461 +timeCreated: 1517558732 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/SpriteProperty.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/SpriteProperty.cs new file mode 100644 index 0000000..f9f6268 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/SpriteProperty.cs @@ -0,0 +1,121 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a Sprite component + /// + [CommandInfo("Property", + "Sprite", + "Get or Set a property of a Sprite component")] + [AddComponentMenu("")] + public class SpriteProperty : BaseVariableProperty + { + //generated property + public enum Property + { + Border, + PixelsPerUnit, + Pivot, + Packed, + TextureRectOffset, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + [VariableProperty(typeof(SpriteVariable))] + protected SpriteVariable spriteVar; + + [SerializeField] + [VariableProperty(typeof(Vector4Variable), + typeof(FloatVariable), + typeof(Vector2Variable), + typeof(BooleanVariable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var iov4 = inOutVar as Vector4Variable; + var iof = inOutVar as FloatVariable; + var iov2 = inOutVar as Vector2Variable; + var iob = inOutVar as BooleanVariable; + + + var target = spriteVar.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.Border: + iov4.Value = target.border; + break; + case Property.PixelsPerUnit: + iof.Value = target.pixelsPerUnit; + break; + case Property.Pivot: + iov2.Value = target.pivot; + break; + case Property.Packed: + iob.Value = target.packed; + break; + case Property.TextureRectOffset: + iov2.Value = target.textureRectOffset; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (spriteVar == null) + { + return "Error: no spriteVar set"; + } + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (spriteVar == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/SpriteProperty.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/SpriteProperty.cs.meta new file mode 100644 index 0000000..6702eb7 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/SpriteProperty.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c95150ec5d3a0374ba617655d4603934 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/TextureProperty.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/TextureProperty.cs new file mode 100644 index 0000000..9a293cd --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/TextureProperty.cs @@ -0,0 +1,141 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a Texture component + /// + [CommandInfo("Property", + "Texture", + "Get or Set a property of a Texture component")] + [AddComponentMenu("")] + public class TextureProperty : BaseVariableProperty + { + //generated property + public enum Property + { + Width, + Height, + IsReadable, + AnisoLevel, + MipMapBias, + TexelSize, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + [VariableProperty(typeof(TextureVariable))] + protected TextureVariable textureVar; + + [SerializeField] + [VariableProperty(typeof(IntegerVariable), + typeof(BooleanVariable), + typeof(FloatVariable), + typeof(Vector2Variable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var ioi = inOutVar as IntegerVariable; +#if UNITY_2019_2_OR_NEWER + var iob = inOutVar as BooleanVariable; +#endif + var iof = inOutVar as FloatVariable; + var iov2 = inOutVar as Vector2Variable; + + + var target = textureVar.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.Width: + ioi.Value = target.width; + break; + case Property.Height: + ioi.Value = target.height; + break; +#if UNITY_2019_2_OR_NEWER + case Property.IsReadable: + iob.Value = target.isReadable; + break; +#endif + case Property.AnisoLevel: + ioi.Value = target.anisoLevel; + break; + case Property.MipMapBias: + iof.Value = target.mipMapBias; + break; + case Property.TexelSize: + iov2.Value = target.texelSize; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + case Property.Width: + target.width = ioi.Value; + break; + case Property.Height: + target.height = ioi.Value; + break; + case Property.AnisoLevel: + target.anisoLevel = ioi.Value; + break; + case Property.MipMapBias: + target.mipMapBias = iof.Value; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (textureVar == null) + { + return "Error: no textureVar set"; + } + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (textureVar == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/TextureProperty.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/TextureProperty.cs.meta new file mode 100644 index 0000000..3da4179 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/TextureProperty.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31b49af150726234597bd728285c18f9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/TransformProperty.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/TransformProperty.cs new file mode 100644 index 0000000..af51c0c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/TransformProperty.cs @@ -0,0 +1,223 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ + +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Fungus +{ + // + /// Get or Set a property of a Transform component + /// + [CommandInfo("Property", + "Transform", + "Get or Set a property of a Transform component")] + [AddComponentMenu("")] + public class TransformProperty : BaseVariableProperty + { + //generated property + public enum Property + { + ChildCount, + EulerAngles, + Forward, + HasChanged, + HierarchyCapacity, + HierarchyCount, + LocalEulerAngles, + LocalPosition, + LocalScale, + LossyScale, + Parent, + Position, + Right, + Root, + Up, + Rotation, + LocalRotation, + WorldToLocalMatrix, + LocalToWorldMatrix, + } + + + [SerializeField] + protected Property property = Property.Position; + + [SerializeField] + protected TransformData transformData; + + [SerializeField] + [VariableProperty(typeof(Vector3Variable), + typeof(QuaternionVariable), + typeof(TransformVariable), + typeof(Matrix4x4Variable), + typeof(IntegerVariable), + typeof(BooleanVariable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var iov = inOutVar as Vector3Variable; + var ioq = inOutVar as QuaternionVariable; + var iot = inOutVar as TransformVariable; + var iom4 = inOutVar as Matrix4x4Variable; + var ioi = inOutVar as IntegerVariable; + var iob = inOutVar as BooleanVariable; + + var target = transformData.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.Position: + iov.Value = target.position; + break; + case Property.LocalPosition: + iov.Value = target.localPosition; + break; + case Property.EulerAngles: + iov.Value = target.eulerAngles; + break; + case Property.LocalEulerAngles: + iov.Value = target.localEulerAngles; + break; + case Property.Right: + iov.Value = target.right; + break; + case Property.Up: + iov.Value = target.up; + break; + case Property.Forward: + iov.Value = target.forward; + break; + case Property.Rotation: + ioq.Value = target.rotation; + break; + case Property.LocalRotation: + ioq.Value = target.localRotation; + break; + case Property.LocalScale: + iov.Value = target.localScale; + break; + case Property.Parent: + iot.Value = target.parent; + break; + case Property.WorldToLocalMatrix: + iom4.Value = target.worldToLocalMatrix; + break; + case Property.LocalToWorldMatrix: + iom4.Value = target.localToWorldMatrix; + break; + case Property.Root: + iot.Value = target.root; + break; + case Property.ChildCount: + ioi.Value = target.childCount; + break; + case Property.LossyScale: + iov.Value = target.lossyScale; + break; + case Property.HasChanged: + iob.Value = target.hasChanged; + break; + case Property.HierarchyCapacity: + ioi.Value = target.hierarchyCapacity; + break; + case Property.HierarchyCount: + ioi.Value = target.hierarchyCount; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + break; + case GetSet.Set: + switch (property) + { + case Property.Position: + target.position = iov.Value; + break; + case Property.LocalPosition: + target.localPosition = iov.Value; + break; + case Property.EulerAngles: + target.eulerAngles = iov.Value; + break; + case Property.LocalEulerAngles: + target.localEulerAngles = iov.Value; + break; + case Property.Right: + target.right = iov.Value; + break; + case Property.Up: + target.up = iov.Value; + break; + case Property.Forward: + target.forward = iov.Value; + break; + case Property.Rotation: + target.rotation = ioq.Value; + break; + case Property.LocalRotation: + target.localRotation = ioq.Value; + break; + case Property.LocalScale: + target.localScale = iov.Value; + break; + case Property.Parent: + target.parent = iot.Value; + break; + case Property.HasChanged: + target.hasChanged = iob.Value; + break; + case Property.HierarchyCapacity: + target.hierarchyCapacity = ioi.Value; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (transformData.Value == null) + { + return "Error: no transform set"; + } + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + //We could do further checks here, eg, you have selected childcount but set a vec3variable + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (transformData.transformRef == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/TransformProperty.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/TransformProperty.cs.meta new file mode 100644 index 0000000..a3fd7b3 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/TransformProperty.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2fb064de1b711a449845627f19b7f7b1 +timeCreated: 1504942828 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector2Property.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector2Property.cs new file mode 100644 index 0000000..e4a4f2a --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector2Property.cs @@ -0,0 +1,121 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a Vector2 component + /// + [CommandInfo("Property", + "Vector2", + "Get or Set a property of a Vector2 component")] + [AddComponentMenu("")] + public class Vector2Property : BaseVariableProperty + { + //generated property + public enum Property + { + X, + Y, + Normalized, + Magnitude, + SqrMagnitude, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + [VariableProperty(typeof(Vector2Variable))] + protected Vector2Variable vector2Var; + + [SerializeField] + [VariableProperty(typeof(FloatVariable), + typeof(Vector2Variable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var iof = inOutVar as FloatVariable; + var iov2 = inOutVar as Vector2Variable; + + + var target = vector2Var.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.X: + iof.Value = target.x; + break; + case Property.Y: + iof.Value = target.y; + break; + case Property.Normalized: + iov2.Value = target.normalized; + break; + case Property.Magnitude: + iof.Value = target.magnitude; + break; + case Property.SqrMagnitude: + iof.Value = target.sqrMagnitude; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + case Property.X: + target.x = iof.Value; + break; + case Property.Y: + target.y = iof.Value; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + vector2Var.Value = target; + + Continue(); + } + + public override string GetSummary() + { + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (vector2Var == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector2Property.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector2Property.cs.meta new file mode 100644 index 0000000..3f9cb9c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector2Property.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a7015dec6a71cdd4ba95bb85217200b5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector3Property.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector3Property.cs new file mode 100644 index 0000000..f80e0a8 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector3Property.cs @@ -0,0 +1,128 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a Vector3 component + /// + [CommandInfo("Property", + "Vector3", + "Get or Set a property of a Vector3 component")] + [AddComponentMenu("")] + public class Vector3Property : BaseVariableProperty + { + //generated property + public enum Property + { + X, + Y, + Z, + Normalized, + Magnitude, + SqrMagnitude, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + [VariableProperty(typeof(Vector3Variable))] + protected Vector3Variable vector3Var; + + [SerializeField] + [VariableProperty(typeof(FloatVariable), + typeof(Vector3Variable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var iof = inOutVar as FloatVariable; + var iov = inOutVar as Vector3Variable; + + + var target = vector3Var.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.X: + iof.Value = target.x; + break; + case Property.Y: + iof.Value = target.y; + break; + case Property.Z: + iof.Value = target.z; + break; + case Property.Normalized: + iov.Value = target.normalized; + break; + case Property.Magnitude: + iof.Value = target.magnitude; + break; + case Property.SqrMagnitude: + iof.Value = target.sqrMagnitude; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + case Property.X: + target.x = iof.Value; + break; + case Property.Y: + target.y = iof.Value; + break; + case Property.Z: + target.z = iof.Value; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + vector3Var.Value = target; + + Continue(); + } + + public override string GetSummary() + { + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (vector3Var == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector3Property.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector3Property.cs.meta new file mode 100644 index 0000000..79e8c09 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector3Property.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c9d421d283ce7de459ab56214f315618 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector4Property.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector4Property.cs new file mode 100644 index 0000000..7720c84 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector4Property.cs @@ -0,0 +1,135 @@ +/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ +using UnityEngine; + + +namespace Fungus +{ + // + /// Get or Set a property of a Vector4 component + /// + [CommandInfo("Property", + "Vector4", + "Get or Set a property of a Vector4 component")] + [AddComponentMenu("")] + public class Vector4Property : BaseVariableProperty + { + //generated property + public enum Property + { + X, + Y, + Z, + W, + Magnitude, + SqrMagnitude, + Normalized, + } + + + [SerializeField] + protected Property property; + + [SerializeField] + protected Vector4Data vector4Data; + + [SerializeField] + [VariableProperty(typeof(FloatVariable), + typeof(Vector4Variable))] + protected Variable inOutVar; + + public override void OnEnter() + { + var iof = inOutVar as FloatVariable; + var iov4 = inOutVar as Vector4Variable; + + + var target = vector4Data.Value; + + switch (getOrSet) + { + case GetSet.Get: + switch (property) + { + case Property.X: + iof.Value = target.x; + break; + case Property.Y: + iof.Value = target.y; + break; + case Property.Z: + iof.Value = target.z; + break; + case Property.W: + iof.Value = target.w; + break; + case Property.Normalized: + iov4.Value = target.normalized; + break; + case Property.Magnitude: + iof.Value = target.magnitude; + break; + case Property.SqrMagnitude: + iof.Value = target.sqrMagnitude; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + case GetSet.Set: + switch (property) + { + case Property.X: + target.x = iof.Value; + break; + case Property.Y: + target.y = iof.Value; + break; + case Property.Z: + target.z = iof.Value; + break; + case Property.W: + target.w = iof.Value; + break; + default: + Debug.Log("Unsupported get or set attempted"); + break; + } + + break; + default: + break; + } + + + vector4Data.Value = target; + + Continue(); + } + + public override string GetSummary() + { + if (inOutVar == null) + { + return "Error: no variable set to push or pull data to or from"; + } + + return getOrSet.ToString() + " " + property.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (vector4Data.vector4Ref == variable || inOutVar == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector4Property.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector4Property.cs.meta new file mode 100644 index 0000000..a60ca09 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Property/Vector4Property.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 218837ae2b5d9ad4cb51c47575ce1ffc +timeCreated: 1517559329 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchPosition.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchPosition.cs new file mode 100644 index 0000000..f2250c2 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchPosition.cs @@ -0,0 +1,67 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Applies a jolt of force to a GameObject's position and wobbles it back to its initial position. + /// + [CommandInfo("iTween", + "Punch Position", + "Applies a jolt of force to a GameObject's position and wobbles it back to its initial position.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class PunchPosition : iTweenCommand + { + [Tooltip("A translation offset in space the GameObject will animate to")] + [SerializeField] protected Vector3Data _amount; + + [Tooltip("Apply the transformation in either the world coordinate or local cordinate system")] + [SerializeField] protected Space space = Space.Self; + + #region Public members + + public override void DoTween() + { + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("name", _tweenName.Value); + tweenParams.Add("amount", _amount.Value); + tweenParams.Add("space", space); + tweenParams.Add("time", _duration.Value); + tweenParams.Add("easetype", easeType); + tweenParams.Add("looptype", loopType); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.PunchPosition(_targetObject.Value, tweenParams); + } + + public override bool HasReference(Variable variable) + { + return variable == _amount.vector3Ref; + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + + protected override void OnEnable() + { + base.OnEnable(); + + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + amountOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchPosition.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchPosition.cs.meta new file mode 100644 index 0000000..b553cf1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchPosition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 720f059c883c4402c89fcc507d5f7e0d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchRotation.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchRotation.cs new file mode 100644 index 0000000..1a04d3d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchRotation.cs @@ -0,0 +1,67 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Applies a jolt of force to a GameObject's rotation and wobbles it back to its initial rotation. + /// + [CommandInfo("iTween", + "Punch Rotation", + "Applies a jolt of force to a GameObject's rotation and wobbles it back to its initial rotation.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class PunchRotation : iTweenCommand + { + [Tooltip("A rotation offset in space the GameObject will animate to")] + [SerializeField] protected Vector3Data _amount; + + [Tooltip("Apply the transformation in either the world coordinate or local cordinate system")] + [SerializeField] protected Space space = Space.Self; + + #region Public members + + public override void DoTween() + { + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("name", _tweenName.Value); + tweenParams.Add("amount", _amount.Value); + tweenParams.Add("space", space); + tweenParams.Add("time", _duration.Value); + tweenParams.Add("easetype", easeType); + tweenParams.Add("looptype", loopType); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.PunchRotation(_targetObject.Value, tweenParams); + } + + public override bool HasReference(Variable variable) + { + return variable == _amount.vector3Ref; + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + + protected override void OnEnable() + { + base.OnEnable(); + + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + amountOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchRotation.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchRotation.cs.meta new file mode 100644 index 0000000..106e8f2 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchRotation.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ea1bc1400ac79424ba3c1aca77fb5d42 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchScale.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchScale.cs new file mode 100644 index 0000000..2d64298 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchScale.cs @@ -0,0 +1,63 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Applies a jolt of force to a GameObject's scale and wobbles it back to its initial scale. + /// + [CommandInfo("iTween", + "Punch Scale", + "Applies a jolt of force to a GameObject's scale and wobbles it back to its initial scale.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class PunchScale : iTweenCommand + { + [Tooltip("A scale offset in space the GameObject will animate to")] + [SerializeField] protected Vector3Data _amount; + + #region Public members + + public override void DoTween() + { + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("name", _tweenName.Value); + tweenParams.Add("amount", _amount.Value); + tweenParams.Add("time", _duration.Value); + tweenParams.Add("easetype", easeType); + tweenParams.Add("looptype", loopType); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.PunchScale(_targetObject.Value, tweenParams); + } + + public override bool HasReference(Variable variable) + { + return variable == _amount.vector3Ref; + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + + protected override void OnEnable() + { + base.OnEnable(); + + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + amountOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchScale.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchScale.cs.meta new file mode 100644 index 0000000..4e67539 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/PunchScale.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ea4591c01defd496586e9b7237c966c5 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Quit.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Quit.cs new file mode 100644 index 0000000..c017275 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Quit.cs @@ -0,0 +1,34 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Quits the application. Does not work in Editor or Webplayer builds. Shouldn't generally be used on iOS. + /// + [CommandInfo("Flow", + "Quit", + "Quits the application. Does not work in Editor or Webplayer builds. Shouldn't generally be used on iOS.")] + [AddComponentMenu("")] + public class Quit : Command + { + #region Public members + + public override void OnEnter() + { + Application.Quit(); + + // On platforms that don't support Quit we just continue onto the next command + Continue(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Quit.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Quit.cs.meta new file mode 100644 index 0000000..6cf5a9c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Quit.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3e1337544a71d4d5dab5510fe86ddca8 +timeCreated: 1434462164 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/RandomFloat.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/RandomFloat.cs new file mode 100644 index 0000000..6eec223 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/RandomFloat.cs @@ -0,0 +1,61 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Sets an float variable to a random value in the defined range. + /// + [CommandInfo("Variable", + "Random Float", + "Sets an float variable to a random value in the defined range.")] + [AddComponentMenu("")] + public class RandomFloat : Command + { + [Tooltip("The variable whos value will be set")] + [VariableProperty(typeof(FloatVariable))] + [SerializeField] protected FloatVariable variable; + + [Tooltip("Minimum value for random range")] + [SerializeField] protected FloatData minValue; + + [Tooltip("Maximum value for random range")] + [SerializeField] protected FloatData maxValue; + + #region Public members + + public override void OnEnter() + { + if (variable != null) + { + variable.Value = Random.Range(minValue.Value, maxValue.Value); + } + + Continue(); + } + + public override string GetSummary() + { + if (variable == null) + { + return "Error: Variable not selected"; + } + + return variable.Key; + } + + public override bool HasReference(Variable variable) + { + return (variable == this.variable) || minValue.floatRef == variable || maxValue.floatRef == variable; + } + + public override Color GetButtonColor() + { + return new Color32(253, 253, 150, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/RandomFloat.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/RandomFloat.cs.meta new file mode 100644 index 0000000..74be332 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/RandomFloat.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0ce1a662ad70c46f4b2de306ed2627a2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/RandomInteger.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/RandomInteger.cs new file mode 100644 index 0000000..f90b307 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/RandomInteger.cs @@ -0,0 +1,61 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Sets an integer variable to a random value in the defined range. + /// + [CommandInfo("Variable", + "Random Integer", + "Sets an integer variable to a random value in the defined range.")] + [AddComponentMenu("")] + public class RandomInteger : Command + { + [Tooltip("The variable whos value will be set")] + [VariableProperty(typeof(IntegerVariable))] + [SerializeField] protected IntegerVariable variable; + + [Tooltip("Minimum value for random range")] + [SerializeField] protected IntegerData minValue; + + [Tooltip("Maximum value for random range")] + [SerializeField] protected IntegerData maxValue; + + #region Public members + + public override void OnEnter() + { + if (variable != null) + { + variable.Value = Random.Range(minValue.Value, maxValue.Value); + } + + Continue(); + } + + public override string GetSummary() + { + if (variable == null) + { + return "Error: Variable not selected"; + } + + return variable.Key; + } + + public override bool HasReference(Variable variable) + { + return (variable == this.variable) || minValue.integerRef == variable || maxValue.integerRef == variable; + } + + public override Color GetButtonColor() + { + return new Color32(253, 253, 150, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/RandomInteger.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/RandomInteger.cs.meta new file mode 100644 index 0000000..6bee06f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/RandomInteger.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6af5dac98b0624702b476c1eac319eab +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ReadTextFile.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ReadTextFile.cs new file mode 100644 index 0000000..10f58bb --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ReadTextFile.cs @@ -0,0 +1,67 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using Fungus; + +namespace Fungus +{ + /// + /// Reads in a text file and stores the contents in a string variable. + /// + [CommandInfo("Variable", + "Read Text File", + "Reads in a text file and stores the contents in a string variable")] + public class ReadTextFile : Command + { + [Tooltip("Text file to read into the string variable")] + [SerializeField] protected TextAsset textFile; + + [Tooltip("String variable to store the tex file contents in")] + [VariableProperty(typeof(StringVariable))] + [SerializeField] protected StringVariable stringVariable; + + #region Public members + + public override void OnEnter() + { + if (textFile == null || + stringVariable == null) + { + Continue(); + return; + } + + stringVariable.Value = textFile.text; + + Continue(); + } + + public override string GetSummary() + { + if (stringVariable == null) + { + return "Error: Variable not selected"; + } + + if (textFile == null) + { + return "Error: Text file not selected"; + } + + return stringVariable.Key; + } + + public override bool HasReference(Variable variable) + { + return (variable == stringVariable); + } + + public override Color GetButtonColor() + { + return new Color32(253, 253, 150, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ReadTextFile.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ReadTextFile.cs.meta new file mode 100644 index 0000000..c42534d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ReadTextFile.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1c0d03b6eb503400fab7982a48c8a93a +timeCreated: 1445960955 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Reset.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Reset.cs new file mode 100644 index 0000000..2dce3a3 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Reset.cs @@ -0,0 +1,38 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Resets the state of all commands and variables in the Flowchart. + /// + [CommandInfo("Variable", + "Reset", + "Resets the state of all commands and variables in the Flowchart.")] + [AddComponentMenu("")] + public class Reset : Command + { + [Tooltip("Reset state of all commands in the script")] + [SerializeField] protected bool resetCommands = true; + + [Tooltip("Reset variables back to their default values")] + [SerializeField] protected bool resetVariables = true; + + #region Public members + + public override void OnEnter() + { + GetFlowchart().Reset(resetCommands, resetVariables); + Continue(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Reset.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Reset.cs.meta new file mode 100644 index 0000000..f588609 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Reset.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0000066e72e484959b6a314a95d0dcd2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ResetAnimTrigger.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ResetAnimTrigger.cs new file mode 100644 index 0000000..56ef180 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ResetAnimTrigger.cs @@ -0,0 +1,82 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Resets a trigger parameter on an Animator component. + /// + [CommandInfo("Animation", + "Reset Anim Trigger", + "Resets a trigger parameter on an Animator component.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class ResetAnimTrigger : Command + { + [Tooltip("Reference to an Animator component in a game object")] + [SerializeField] protected AnimatorData _animator; + + [Tooltip("Name of the trigger Animator parameter that will be reset")] + [SerializeField] protected StringData _parameterName; + + #region Public members + + public override void OnEnter() + { + if (_animator.Value != null) + { + _animator.Value.ResetTrigger(_parameterName.Value); + } + + Continue(); + } + + public override string GetSummary() + { + if (_animator.Value == null) + { + return "Error: No animator selected"; + } + + return _animator.Value.name + " (" + _parameterName.Value + ")"; + } + + public override Color GetButtonColor() + { + return new Color32(170, 204, 169, 255); + } + + public override bool HasReference(Variable variable) + { + return _animator.animatorRef == variable || _parameterName.stringRef == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD = ""; + + protected virtual void OnEnable() + { + if (animatorOLD != null) + { + _animator.Value = animatorOLD; + animatorOLD = null; + } + + if (parameterNameOLD != "") + { + _parameterName.Value = parameterNameOLD; + parameterNameOLD = ""; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ResetAnimTrigger.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ResetAnimTrigger.cs.meta new file mode 100644 index 0000000..58e2c78 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ResetAnimTrigger.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: acc125538d5aa46fb95fc7a78036d167 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D.meta new file mode 100644 index 0000000..8f47312 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 168ad11319df4784eaaf28cf8e564365 +folderAsset: yes +timeCreated: 1503731365 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/AddForce2D.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/AddForce2D.cs new file mode 100644 index 0000000..626124b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/AddForce2D.cs @@ -0,0 +1,88 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Fungus +{ + // + /// Add force to a Rigidbody2D + /// + [CommandInfo("Rigidbody2D", + "AddForce2D", + "Add force to a Rigidbody2D")] + [AddComponentMenu("")] + public class AddForce2D : Command + { + [SerializeField] + protected Rigidbody2DData rb; + + [SerializeField] + protected ForceMode2D forceMode = ForceMode2D.Force; + + public enum ForceFunction + { + AddForce, + AddForceAtPosition, + AddRelativeForce + } + + [SerializeField] + protected ForceFunction forceFunction = ForceFunction.AddForce; + + [Tooltip("Vector of force to be added")] + [SerializeField] + protected Vector2Data force; + + [Tooltip("Scale factor to be applied to force as it is used.")] + [SerializeField] + protected FloatData forceScaleFactor = new FloatData(1); + + [Tooltip("World position the force is being applied from. Used only in AddForceAtPosition")] + [SerializeField] + protected Vector2Data atPosition; + + public override void OnEnter() + { + switch (forceFunction) + { + case ForceFunction.AddForce: + rb.Value.AddForce(force.Value * forceScaleFactor.Value, forceMode); + break; + case ForceFunction.AddForceAtPosition: + rb.Value.AddForceAtPosition(force.Value * forceScaleFactor.Value, atPosition.Value, forceMode); + break; + case ForceFunction.AddRelativeForce: + rb.Value.AddRelativeForce(force.Value * forceScaleFactor.Value, forceMode); + break; + default: + break; + } + + + Continue(); + } + + public override string GetSummary() + { + return forceMode.ToString() + ": " + force.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (rb.rigidbody2DRef == variable || force.vector2Ref == variable || forceScaleFactor.floatRef == variable || + atPosition.vector2Ref == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/AddForce2D.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/AddForce2D.cs.meta new file mode 100644 index 0000000..f0b09f1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/AddForce2D.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 59927941e3d79be4dac4408058904465 +timeCreated: 1503094848 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/AddTorque2D.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/AddTorque2D.cs new file mode 100644 index 0000000..bfc2304 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/AddTorque2D.cs @@ -0,0 +1,59 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Fungus +{ + // + /// Add Torque to a Rigidbody2D + /// + [CommandInfo("Rigidbody2D", + "AddTorque2D", + "Add Torque to a Rigidbody2D")] + [AddComponentMenu("")] + public class AddTorque2D : Command + { + [SerializeField] + protected Rigidbody2DData rb; + + [SerializeField] + protected ForceMode2D forceMode = ForceMode2D.Force; + + [Tooltip("Amount of torque to be added")] + [SerializeField] + protected FloatData force; + + public override void OnEnter() + { + rb.Value.AddTorque(force.Value, forceMode); + + Continue(); + } + + public override string GetSummary() + { + if (rb.Value == null) + { + return "Error: rb not set"; + } + + return forceMode.ToString() + ": " + force.Value.ToString() + (force.floatRef != null ? " (" + force.floatRef.Key + ")" : ""); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (rb.rigidbody2DRef == variable || force.floatRef == variable) + return true; + + return false; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/AddTorque2D.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/AddTorque2D.cs.meta new file mode 100644 index 0000000..07ab3da --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/AddTorque2D.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 42fb61d4cee69b244bcf4fcc8e4ae28b +timeCreated: 1503744011 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/StopMotionRigidBody2D.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/StopMotionRigidBody2D.cs new file mode 100644 index 0000000..6f5f92b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/StopMotionRigidBody2D.cs @@ -0,0 +1,72 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Fungus +{ + // + /// Stop velocity and angular velocity on a Rigidbody2D + /// + [CommandInfo("Rigidbody2D", + "StopMotion2D", + "Stop velocity and angular velocity on a Rigidbody2D")] + [AddComponentMenu("")] + public class StopMotionRigidBody2D : Command + { + [SerializeField] + protected Rigidbody2DData rb; + + public enum Motion + { + Velocity, + AngularVelocity, + AngularAndLinearVelocity + } + + [SerializeField] + protected Motion motionToStop = Motion.AngularAndLinearVelocity; + + public override void OnEnter() + { + switch (motionToStop) + { + case Motion.Velocity: + rb.Value.velocity = Vector2.zero; + break; + case Motion.AngularVelocity: + rb.Value.angularVelocity = 0; + break; + case Motion.AngularAndLinearVelocity: + rb.Value.angularVelocity = 0; + rb.Value.velocity = Vector2.zero; + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + return motionToStop.ToString(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (rb.rigidbody2DRef == variable) + return true; + + return false; + } + + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/StopMotionRigidBody2D.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/StopMotionRigidBody2D.cs.meta new file mode 100644 index 0000000..07fd783 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Rigidbody2D/StopMotionRigidBody2D.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bd2e830ee16360d418acee50d83c9c13 +timeCreated: 1504225685 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateAdd.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateAdd.cs new file mode 100644 index 0000000..7bf7ae3 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateAdd.cs @@ -0,0 +1,68 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Rotates a game object by the specified angles over time. + /// + [CommandInfo("iTween", + "Rotate Add", + "Rotates a game object by the specified angles over time.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class RotateAdd : iTweenCommand + { + [Tooltip("A rotation offset in space the GameObject will animate to")] + [SerializeField] protected Vector3Data _offset; + + [Tooltip("Apply the transformation in either the world coordinate or local cordinate system")] + [SerializeField] protected Space space = Space.Self; + + #region Public members + + public override void DoTween() + { + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("name", _tweenName.Value); + tweenParams.Add("amount", _offset.Value); + tweenParams.Add("space", space); + tweenParams.Add("time", _duration.Value); + tweenParams.Add("easetype", easeType); + tweenParams.Add("looptype", loopType); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.RotateAdd(_targetObject.Value, tweenParams); + } + + public override bool HasReference(Variable variable) + { + return _offset.vector3Ref == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; + + protected override void OnEnable() + { + base.OnEnable(); + + if (offsetOLD != default(Vector3)) + { + _offset.Value = offsetOLD; + offsetOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateAdd.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateAdd.cs.meta new file mode 100644 index 0000000..7a747f1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateAdd.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1a5d3c95fea3b45a595a9993dd9c3158 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateFrom.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateFrom.cs new file mode 100644 index 0000000..c5fc556 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateFrom.cs @@ -0,0 +1,85 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Rotates a game object from the specified angles back to its starting orientation over time. + /// + [CommandInfo("iTween", + "Rotate From", + "Rotates a game object from the specified angles back to its starting orientation over time.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class RotateFrom : iTweenCommand + { + [Tooltip("Target transform that the GameObject will rotate from")] + [SerializeField] protected TransformData _fromTransform; + + [Tooltip("Target rotation that the GameObject will rotate from, if no From Transform is set")] + [SerializeField] protected Vector3Data _fromRotation; + + [Tooltip("Whether to animate in world space or relative to the parent. False by default.")] + [SerializeField] protected bool isLocal; + + #region Public members + + public override void DoTween() + { + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("name", _tweenName.Value); + if (_fromTransform.Value == null) + { + tweenParams.Add("rotation", _fromRotation.Value); + } + else + { + tweenParams.Add("rotation", _fromTransform.Value); + } + tweenParams.Add("time", _duration.Value); + tweenParams.Add("easetype", easeType); + tweenParams.Add("looptype", loopType); + tweenParams.Add("isLocal", isLocal); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.RotateFrom(_targetObject.Value, tweenParams); + } + + public override bool HasReference(Variable variable) + { + return _fromTransform.transformRef == variable || _fromRotation.vector3Ref == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; + [HideInInspector] [FormerlySerializedAs("fromRotation")] public Vector3 fromRotationOLD; + + protected override void OnEnable() + { + base.OnEnable(); + + if (fromTransformOLD != null) + { + _fromTransform.Value = fromTransformOLD; + fromTransformOLD = null; + } + + if (fromRotationOLD != default(Vector3)) + { + _fromRotation.Value = fromRotationOLD; + fromRotationOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateFrom.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateFrom.cs.meta new file mode 100644 index 0000000..ebed8b1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateFrom.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6cfc8560cbecd48adb3950b9dd7f2b82 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateTo.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateTo.cs new file mode 100644 index 0000000..4420af1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateTo.cs @@ -0,0 +1,85 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Rotates a game object to the specified angles over time. + /// + [CommandInfo("iTween", + "Rotate To", + "Rotates a game object to the specified angles over time.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class RotateTo : iTweenCommand + { + [Tooltip("Target transform that the GameObject will rotate to")] + [SerializeField] protected TransformData _toTransform; + + [Tooltip("Target rotation that the GameObject will rotate to, if no To Transform is set")] + [SerializeField] protected Vector3Data _toRotation; + + [Tooltip("Whether to animate in world space or relative to the parent. False by default.")] + [SerializeField] protected bool isLocal; + + #region Public members + + public override void DoTween() + { + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("name", _tweenName.Value); + if (_toTransform.Value == null) + { + tweenParams.Add("rotation", _toRotation.Value); + } + else + { + tweenParams.Add("rotation", _toTransform.Value); + } + tweenParams.Add("time", _duration.Value); + tweenParams.Add("easetype", easeType); + tweenParams.Add("looptype", loopType); + tweenParams.Add("isLocal", isLocal); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.RotateTo(_targetObject.Value, tweenParams); + } + + public override bool HasReference(Variable variable) + { + return _toTransform.transformRef == variable || _toRotation.vector3Ref == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; + [HideInInspector] [FormerlySerializedAs("toRotation")] public Vector3 toRotationOLD; + + protected override void OnEnable() + { + base.OnEnable(); + + if (toTransformOLD != null) + { + _toTransform.Value = toTransformOLD; + toTransformOLD = null; + } + + if (toRotationOLD != default(Vector3)) + { + _toRotation.Value = toRotationOLD; + toRotationOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateTo.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateTo.cs.meta new file mode 100644 index 0000000..f8a9f09 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/RotateTo.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d2dd111db90064d2cb85e3370cdfe3ac +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SavePoint.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SavePoint.cs new file mode 100644 index 0000000..2060f66 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SavePoint.cs @@ -0,0 +1,176 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +#if UNITY_5_3_OR_NEWER + +using UnityEngine; + +namespace Fungus +{ + [CommandInfo("Flow", + "Save Point", + "Creates a Save Point and adds it to the Save History. The player can save the Save History to persistent storage and load it again later using the Save Menu.")] + public class SavePoint : Command + { + /// + /// Supported modes for specifying a Save Point Key. + /// + public enum KeyMode + { + /// Use the parent Block's name as the Save Point Key. N.B. If you change the Block name later it will break the save file! + BlockName, + /// Use a custom string for the key. This allows you to use multiple Save Points in the same block and save files will still work if the Block is renamed later. + Custom, + /// Use both the parent Block's name as well as a custom string for the Save Point key. This allows you to use your custom key every block, provided your Block names are unique./// + BlockNameAndCustom + } + + /// + /// Supported modes for specifying a Save Point Description. + /// + public enum DescriptionMode + { + /// Uses the current date and time as the save point description. + Timestamp, + /// Use a custom string for the save point description. + Custom + } + + [Tooltip("Marks this Save Point as the starting point for Flowchart execution in the scene. Each scene in your game should have exactly one Save Point with this enabled.")] + [SerializeField] protected bool isStartPoint = false; + + [Tooltip("How the Save Point Key for this Save Point is defined.")] + [SerializeField] protected KeyMode keyMode = KeyMode.BlockName; + + [Tooltip("A string key which uniquely identifies this save point.")] + [SerializeField] protected string customKey = ""; + + [Tooltip("A string to seperate the block name and custom key when using KeyMode.Both.")] + [SerializeField] + protected string keySeparator = "_"; + + [Tooltip("How the description for this Save Point is defined.")] + [SerializeField] protected DescriptionMode descriptionMode = DescriptionMode.Timestamp; + + [Tooltip("A short description of this save point.")] + [SerializeField] protected string customDescription; + + [Tooltip("Fire a Save Point Loaded event when this command executes.")] + [SerializeField] protected bool fireEvent = true; + + [Tooltip("Resume execution from this location after loading this Save Point.")] + [SerializeField] protected bool resumeOnLoad = true; + + #region Public members + + /// + /// Marks this Save Point as the starting point for Flowchart execution in the scene. Each scene in your game should have exactly one Save Point with this enabled. + /// + public bool IsStartPoint { get { return isStartPoint; } set { isStartPoint = value; } } + + /// + /// Gets a string key which uniquely identifies this Save Point. + /// + public string SavePointKey + { + get + { + if (keyMode == KeyMode.BlockName) + { + return ParentBlock.BlockName; + } + else if (keyMode == KeyMode.BlockNameAndCustom) + { + return ParentBlock.BlockName + keySeparator + customKey; + } + else + { + return customKey; + } + } + } + + /// + /// Gets the save point description. + /// + public string SavePointDescription + { + get + { + if (descriptionMode == DescriptionMode.Timestamp) + { + return System.DateTime.UtcNow.ToString("HH:mm dd MMMM, yyyy"); + } + else + { + return customDescription; + } + } + } + + /// + /// Resume execution from this location after loading this Save Point. + /// + public bool ResumeOnLoad { get { return resumeOnLoad; } } + + public override void OnEnter() + { + var saveManager = FungusManager.Instance.SaveManager; + + saveManager.AddSavePoint(SavePointKey, SavePointDescription); + + if (fireEvent) + { + SavePointLoaded.NotifyEventHandlers(SavePointKey); + } + + Continue(); + } + + public override string GetSummary() + { + if (keyMode == KeyMode.BlockName) + { + return "key: " + ParentBlock.BlockName; + } + else if (keyMode == KeyMode.BlockNameAndCustom) + { + return "key: " + ParentBlock.BlockName + keySeparator + customKey; + } + + return "key: " + customKey; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool IsPropertyVisible(string propertyName) + { + if (propertyName == "customKey" && + (keyMode != KeyMode.Custom && keyMode != KeyMode.BlockNameAndCustom)) + { + return false; + } + + if (propertyName == "keySeparator" && + keyMode != KeyMode.BlockNameAndCustom) + { + return false; + } + + if (propertyName == "customDescription" && + descriptionMode != DescriptionMode.Custom) + { + return false; + } + + return true; + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SavePoint.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SavePoint.cs.meta new file mode 100644 index 0000000..2178e09 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SavePoint.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0b115619cb83b4d6ab8047d0e9407403 +timeCreated: 1478530280 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SaveVariable.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SaveVariable.cs new file mode 100644 index 0000000..08b3e94 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SaveVariable.cs @@ -0,0 +1,125 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Save an Boolean, Integer, Float or String variable to persistent storage using a string key. + /// The value can be loaded again later using the Load Variable command. You can also + /// use the Set Save Profile command to manage separate save profiles for multiple players. + /// + [CommandInfo("Variable", + "Save Variable", + "Save an Boolean, Integer, Float or String variable to persistent storage using a string key. " + + "The value can be loaded again later using the Load Variable command. You can also " + + "use the Set Save Profile command to manage separate save profiles for multiple players.")] + [AddComponentMenu("")] + public class SaveVariable : Command + { + [Tooltip("Name of the saved value. Supports variable substition e.g. \"player_{$PlayerNumber}")] + [SerializeField] protected string key = ""; + + [Tooltip("Variable to read the value from. Only Boolean, Integer, Float and String are supported.")] + [VariableProperty(typeof(BooleanVariable), + typeof(IntegerVariable), + typeof(FloatVariable), + typeof(StringVariable))] + [SerializeField] protected Variable variable; + + #region Public members + + public override void OnEnter() + { + if (key == "" || + variable == null) + { + Continue(); + return; + } + + var flowchart = GetFlowchart(); + + // Prepend the current save profile (if any) + string prefsKey = SetSaveProfile.SaveProfile + "_" + flowchart.SubstituteVariables(key); + + System.Type variableType = variable.GetType(); + + if (variableType == typeof(BooleanVariable)) + { + BooleanVariable booleanVariable = variable as BooleanVariable; + if (booleanVariable != null) + { + // PlayerPrefs does not have bool accessors, so just use int + PlayerPrefs.SetInt(prefsKey, booleanVariable.Value ? 1 : 0); + } + } + else if (variableType == typeof(IntegerVariable)) + { + IntegerVariable integerVariable = variable as IntegerVariable; + if (integerVariable != null) + { + PlayerPrefs.SetInt(prefsKey, integerVariable.Value); + } + } + else if (variableType == typeof(FloatVariable)) + { + FloatVariable floatVariable = variable as FloatVariable; + if (floatVariable != null) + { + PlayerPrefs.SetFloat(prefsKey, floatVariable.Value); + } + } + else if (variableType == typeof(StringVariable)) + { + StringVariable stringVariable = variable as StringVariable; + if (stringVariable != null) + { + PlayerPrefs.SetString(prefsKey, stringVariable.Value); + } + } + + Continue(); + } + + public override string GetSummary() + { + if (key.Length == 0) + { + return "Error: No stored value key selected"; + } + + if (variable == null) + { + return "Error: No variable selected"; + } + + return variable.Key + " into '" + key + "'"; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable in_variable) + { + return this.variable == in_variable || base.HasReference(in_variable); + } + + #endregion + #region Editor caches +#if UNITY_EDITOR + protected override void RefreshVariableCache() + { + base.RefreshVariableCache(); + + var f = GetFlowchart(); + + f.DetermineSubstituteVariables(key, referencedVariables); + } +#endif + #endregion Editor caches + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SaveVariable.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SaveVariable.cs.meta new file mode 100644 index 0000000..cffdea4 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SaveVariable.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1bef7966140464bd5a3ef4da2ff236b9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Say.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Say.cs new file mode 100644 index 0000000..451a002 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Say.cs @@ -0,0 +1,201 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Writes text in a dialog box. + /// + [CommandInfo("Narrative", + "Say", + "Writes text in a dialog box.")] + [AddComponentMenu("")] + public class Say : Command, ILocalizable + { + // Removed this tooltip as users's reported it obscures the text box + [TextArea(5,10)] + [SerializeField] protected string storyText = ""; + + [Tooltip("Notes about this story text for other authors, localization, etc.")] + [SerializeField] protected string description = ""; + + [Tooltip("Character that is speaking")] + [SerializeField] protected Character character; + + [Tooltip("Portrait that represents speaking character")] + [SerializeField] protected Sprite portrait; + + [Tooltip("Voiceover audio to play when writing the text")] + [SerializeField] protected AudioClip voiceOverClip; + + [Tooltip("Always show this Say text when the command is executed multiple times")] + [SerializeField] protected bool showAlways = true; + + [Tooltip("Number of times to show this Say text when the command is executed multiple times")] + [SerializeField] protected int showCount = 1; + + [Tooltip("Type this text in the previous dialog box.")] + [SerializeField] protected bool extendPrevious = false; + + [Tooltip("Fade out the dialog box when writing has finished and not waiting for input.")] + [SerializeField] protected bool fadeWhenDone = true; + + [Tooltip("Wait for player to click before continuing.")] + [SerializeField] protected bool waitForClick = true; + + [Tooltip("Stop playing voiceover when text finishes writing.")] + [SerializeField] protected bool stopVoiceover = true; + + [Tooltip("Wait for the Voice Over to complete before continuing")] + [SerializeField] protected bool waitForVO = false; + + //add wait for vo that overrides stopvo + + [Tooltip("Sets the active Say dialog with a reference to a Say Dialog object in the scene. All story text will now display using this Say Dialog.")] + [SerializeField] protected SayDialog setSayDialog; + + protected int executionCount; + + #region Public members + + /// + /// Character that is speaking. + /// + public virtual Character _Character { get { return character; } } + + /// + /// Portrait that represents speaking character. + /// + public virtual Sprite Portrait { get { return portrait; } set { portrait = value; } } + + /// + /// Type this text in the previous dialog box. + /// + public virtual bool ExtendPrevious { get { return extendPrevious; } } + + public override void OnEnter() + { + if (!showAlways && executionCount >= showCount) + { + Continue(); + return; + } + + executionCount++; + + // Override the active say dialog if needed + if (character != null && character.SetSayDialog != null) + { + SayDialog.ActiveSayDialog = character.SetSayDialog; + } + + if (setSayDialog != null) + { + SayDialog.ActiveSayDialog = setSayDialog; + } + + var sayDialog = SayDialog.GetSayDialog(); + if (sayDialog == null) + { + Continue(); + return; + } + + var flowchart = GetFlowchart(); + + sayDialog.SetActive(true); + + sayDialog.SetCharacter(character); + sayDialog.SetCharacterImage(portrait); + + string displayText = storyText; + + var activeCustomTags = CustomTag.activeCustomTags; + for (int i = 0; i < activeCustomTags.Count; i++) + { + var ct = activeCustomTags[i]; + displayText = displayText.Replace(ct.TagStartSymbol, ct.ReplaceTagStartWith); + if (ct.TagEndSymbol != "" && ct.ReplaceTagEndWith != "") + { + displayText = displayText.Replace(ct.TagEndSymbol, ct.ReplaceTagEndWith); + } + } + + string subbedText = flowchart.SubstituteVariables(displayText); + + sayDialog.Say(subbedText, !extendPrevious, waitForClick, fadeWhenDone, stopVoiceover, waitForVO, voiceOverClip, delegate { + Continue(); + }); + } + + public override string GetSummary() + { + string namePrefix = ""; + if (character != null) + { + namePrefix = character.NameText + ": "; + } + if (extendPrevious) + { + namePrefix = "EXTEND" + ": "; + } + return namePrefix + "\"" + storyText + "\""; + } + + public override Color GetButtonColor() + { + return new Color32(184, 210, 235, 255); + } + + public override void OnReset() + { + executionCount = 0; + } + + public override void OnStopExecuting() + { + var sayDialog = SayDialog.GetSayDialog(); + if (sayDialog == null) + { + return; + } + + sayDialog.Stop(); + } + + #endregion + + #region ILocalizable implementation + + public virtual string GetStandardText() + { + return storyText; + } + + public virtual void SetStandardText(string standardText) + { + storyText = standardText; + } + + public virtual string GetDescription() + { + return description; + } + + public virtual string GetStringId() + { + // String id for Say commands is SAY...[Character Name] + string stringId = "SAY." + GetFlowchartLocalizationId() + "." + itemId + "."; + if (character != null) + { + stringId += character.NameText; + } + + return stringId; + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Say.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Say.cs.meta new file mode 100644 index 0000000..2967a3e --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Say.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ec422cd568a9c4a31ad7c36d0572b9da +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleAdd.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleAdd.cs new file mode 100644 index 0000000..29dbd95 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleAdd.cs @@ -0,0 +1,64 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Changes a game object's scale by a specified offset over time. + /// + [CommandInfo("iTween", + "Scale Add", + "Changes a game object's scale by a specified offset over time.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class ScaleAdd : iTweenCommand + { + [Tooltip("A scale offset in space the GameObject will animate to")] + [SerializeField] protected Vector3Data _offset; + + #region Public members + + public override void DoTween() + { + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("name", _tweenName.Value); + tweenParams.Add("amount", _offset.Value); + tweenParams.Add("time", _duration.Value); + tweenParams.Add("easetype", easeType); + tweenParams.Add("looptype", loopType); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.ScaleAdd(_targetObject.Value, tweenParams); + } + + public override bool HasReference(Variable variable) + { + return _offset.vector3Ref == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; + + protected override void OnEnable() + { + base.OnEnable(); + + if (offsetOLD != default(Vector3)) + { + _offset.Value = offsetOLD; + offsetOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleAdd.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleAdd.cs.meta new file mode 100644 index 0000000..4e7bb02 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleAdd.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c4998e756a5d84f4ab55e075dad751b1 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleFrom.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleFrom.cs new file mode 100644 index 0000000..335196f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleFrom.cs @@ -0,0 +1,81 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Changes a game object's scale to the specified value and back to its original scale over time. + /// + [CommandInfo("iTween", + "Scale From", + "Changes a game object's scale to the specified value and back to its original scale over time.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class ScaleFrom : iTweenCommand + { + [Tooltip("Target transform that the GameObject will scale from")] + [SerializeField] protected TransformData _fromTransform; + + [Tooltip("Target scale that the GameObject will scale from, if no From Transform is set")] + [SerializeField] protected Vector3Data _fromScale; + + #region Public members + + public override void DoTween() + { + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("name", _tweenName.Value); + if (_fromTransform.Value == null) + { + tweenParams.Add("scale", _fromScale.Value); + } + else + { + tweenParams.Add("scale", _fromTransform.Value); + } + tweenParams.Add("time", _duration.Value); + tweenParams.Add("easetype", easeType); + tweenParams.Add("looptype", loopType); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.ScaleFrom(_targetObject.Value, tweenParams); + } + + public override bool HasReference(Variable variable) + { + return _fromTransform.transformRef == variable || _fromScale.vector3Ref == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; + [HideInInspector] [FormerlySerializedAs("fromScale")] public Vector3 fromScaleOLD; + + protected override void OnEnable() + { + base.OnEnable(); + + if (fromTransformOLD != null) + { + _fromTransform.Value = fromTransformOLD; + fromTransformOLD = null; + } + + if (fromScaleOLD != default(Vector3)) + { + _fromScale.Value = fromScaleOLD; + fromScaleOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleFrom.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleFrom.cs.meta new file mode 100644 index 0000000..103b49b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleFrom.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0d47cc719ae0d4d62a30b3cfa72b5785 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleTo.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleTo.cs new file mode 100644 index 0000000..939176a --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleTo.cs @@ -0,0 +1,81 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Changes a game object's scale to a specified value over time. + /// + [CommandInfo("iTween", + "Scale To", + "Changes a game object's scale to a specified value over time.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class ScaleTo : iTweenCommand + { + [Tooltip("Target transform that the GameObject will scale to")] + [SerializeField] protected TransformData _toTransform; + + [Tooltip("Target scale that the GameObject will scale to, if no To Transform is set")] + [SerializeField] protected Vector3Data _toScale = new Vector3Data(Vector3.one); + + #region Public members + + public override void DoTween() + { + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("name", _tweenName.Value); + if (_toTransform.Value == null) + { + tweenParams.Add("scale", _toScale.Value); + } + else + { + tweenParams.Add("scale", _toTransform.Value); + } + tweenParams.Add("time", _duration.Value); + tweenParams.Add("easetype", easeType); + tweenParams.Add("looptype", loopType); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.ScaleTo(_targetObject.Value, tweenParams); + } + + public override bool HasReference(Variable variable) + { + return _toTransform.transformRef == variable || _toScale.vector3Ref == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; + [HideInInspector] [FormerlySerializedAs("toScale")] public Vector3 toScaleOLD; + + protected override void OnEnable() + { + base.OnEnable(); + + if (toTransformOLD != null) + { + _toTransform.Value = toTransformOLD; + toTransformOLD = null; + } + + if (toScaleOLD != default(Vector3)) + { + _toScale.Value = toScaleOLD; + toScaleOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleTo.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleTo.cs.meta new file mode 100644 index 0000000..c1eec94 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ScaleTo.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 665e8847cab3749f597622c6c52997ad +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Scene.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Scene.meta new file mode 100644 index 0000000..f19e680 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Scene.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3c625aa42f45f484cb2a4f4bef7adede +folderAsset: yes +timeCreated: 1501237083 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Scene/ReloadScene.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Scene/ReloadScene.cs new file mode 100644 index 0000000..86f62a1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Scene/ReloadScene.cs @@ -0,0 +1,38 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Reload the current scene + /// + [CommandInfo("Scene", + "Reload", + "Reload the current scene")] + [AddComponentMenu("")] + public class ReloadScene : Command + { + [Tooltip("Image to display while loading the scene")] + [SerializeField] + protected Texture2D loadingImage; + + public override void OnEnter() + { + SceneLoader.LoadScene(UnityEngine.SceneManagement.SceneManager.GetActiveScene().name, loadingImage); + + Continue(); + } + + public override string GetSummary() + { + return ""; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Scene/ReloadScene.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Scene/ReloadScene.cs.meta new file mode 100644 index 0000000..c1c1fc6 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Scene/ReloadScene.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9c784b19efbe8424fa879e0d6d883281 +timeCreated: 1501237128 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SendMessage.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SendMessage.cs new file mode 100644 index 0000000..75024e8 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SendMessage.cs @@ -0,0 +1,109 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Supported target types for messages. + /// + public enum MessageTarget + { + /// + /// Send message to the Flowchart containing the SendMessage command. + /// + SameFlowchart, + /// + /// Broadcast message to all Flowcharts. + /// + AllFlowcharts + } + + /// + /// Sends a message to either the owner Flowchart or all Flowcharts in the scene. Blocks can listen for this message using a Message Received event handler. + /// + [CommandInfo("Flow", + "Send Message", + "Sends a message to either the owner Flowchart or all Flowcharts in the scene. Blocks can listen for this message using a Message Received event handler.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class SendMessage : Command + { + [Tooltip("Target flowchart(s) to send the message to")] + [SerializeField] protected MessageTarget messageTarget; + + [Tooltip("Name of the message to send")] + [SerializeField] protected StringData _message = new StringData(""); + + #region Public members + + public override void OnEnter() + { + if (_message.Value.Length == 0) + { + Continue(); + return; + } + + MessageReceived[] receivers = null; + if (messageTarget == MessageTarget.SameFlowchart) + { + receivers = GetComponents(); + } + else + { + receivers = GameObject.FindObjectsOfType(); + } + + if (receivers != null) + { + for (int i = 0; i < receivers.Length; i++) + { + var receiver = receivers[i]; + receiver.OnSendFungusMessage(_message.Value); + } + } + + Continue(); + } + + public override string GetSummary() + { + if (_message.Value.Length == 0) + { + return "Error: No message specified"; + } + + return _message.Value; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + return _message.stringRef == variable || base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("message")] public string messageOLD = ""; + + protected virtual void OnEnable() + { + if (messageOLD != "") + { + _message.Value = messageOLD; + messageOLD = ""; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SendMessage.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SendMessage.cs.meta new file mode 100644 index 0000000..97f1e5c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SendMessage.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c43743931d28f43f89eced820d907351 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetActive.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetActive.cs new file mode 100644 index 0000000..9013bae --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetActive.cs @@ -0,0 +1,75 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Sets a game object in the scene to be active / inactive. + /// + [CommandInfo("Scripting", + "Set Active", + "Sets a game object in the scene to be active / inactive.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class SetActive : Command + { + [Tooltip("Reference to game object to enable / disable")] + [SerializeField] protected GameObjectData _targetGameObject; + + [Tooltip("Set to true to enable the game object")] + [SerializeField] protected BooleanData activeState; + + #region Public members + + public override void OnEnter() + { + if (_targetGameObject.Value != null) + { + _targetGameObject.Value.SetActive(activeState.Value); + } + + Continue(); + } + + public override string GetSummary() + { + if (_targetGameObject.Value == null) + { + return "Error: No game object selected"; + } + + return _targetGameObject.Value.name + " = " + activeState.GetDescription(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + return _targetGameObject.gameObjectRef == variable || activeState.booleanRef == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("targetGameObject")] public GameObject targetGameObjectOLD; + + protected virtual void OnEnable() + { + if (targetGameObjectOLD != null) + { + _targetGameObject.Value = targetGameObjectOLD; + targetGameObjectOLD = null; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetActive.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetActive.cs.meta new file mode 100644 index 0000000..94fe6f3 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetActive.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dbd8c931f22994b9d90e2037fffaa770 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimBool.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimBool.cs new file mode 100644 index 0000000..88aae8e --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimBool.cs @@ -0,0 +1,85 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Sets a boolean parameter on an Animator component to control a Unity animation" + /// + [CommandInfo("Animation", + "Set Anim Bool", + "Sets a boolean parameter on an Animator component to control a Unity animation")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class SetAnimBool : Command + { + [Tooltip("Reference to an Animator component in a game object")] + [SerializeField] protected AnimatorData _animator; + + [Tooltip("Name of the boolean Animator parameter that will have its value changed")] + [SerializeField] protected StringData _parameterName; + + [Tooltip("The boolean value to set the parameter to")] + [SerializeField] protected BooleanData value; + + #region Public members + + public override void OnEnter() + { + if (_animator.Value != null) + { + _animator.Value.SetBool(_parameterName.Value, value.Value); + } + + Continue(); + } + + public override string GetSummary() + { + if (_animator.Value == null) + { + return "Error: No animator selected"; + } + + return _animator.Value.name + " (" + _parameterName.Value + ")"; + } + + public override Color GetButtonColor() + { + return new Color32(170, 204, 169, 255); + } + + public override bool HasReference(Variable variable) + { + return _animator.animatorRef == variable || _parameterName.stringRef == variable || value.booleanRef == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD = ""; + + protected virtual void OnEnable() + { + if (animatorOLD != null) + { + _animator.Value = animatorOLD; + animatorOLD = null; + } + + if (parameterNameOLD != "") + { + _parameterName.Value = parameterNameOLD; + parameterNameOLD = ""; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimBool.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimBool.cs.meta new file mode 100644 index 0000000..550898d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimBool.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ee63e642958494f1ebed8116ae4b1103 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimFloat.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimFloat.cs new file mode 100644 index 0000000..244d64f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimFloat.cs @@ -0,0 +1,85 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Sets a float parameter on an Animator component to control a Unity animation. + /// + [CommandInfo("Animation", + "Set Anim Float", + "Sets a float parameter on an Animator component to control a Unity animation")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class SetAnimFloat : Command + { + [Tooltip("Reference to an Animator component in a game object")] + [SerializeField] protected AnimatorData _animator; + + [Tooltip("Name of the float Animator parameter that will have its value changed")] + [SerializeField] protected StringData _parameterName; + + [Tooltip("The float value to set the parameter to")] + [SerializeField] protected FloatData value; + + #region Public members + + public override void OnEnter() + { + if (_animator.Value != null) + { + _animator.Value.SetFloat(_parameterName.Value, value.Value); + } + + Continue(); + } + + public override string GetSummary() + { + if (_animator.Value == null) + { + return "Error: No animator selected"; + } + + return _animator.Value.name + " (" + _parameterName.Value + ")"; + } + + public override Color GetButtonColor() + { + return new Color32(170, 204, 169, 255); + } + + public override bool HasReference(Variable variable) + { + return _animator.animatorRef == variable || _parameterName.stringRef == variable || value.floatRef == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD = ""; + + protected virtual void OnEnable() + { + if (animatorOLD != null) + { + _animator.Value = animatorOLD; + animatorOLD = null; + } + + if (parameterNameOLD != "") + { + _parameterName.Value = parameterNameOLD; + parameterNameOLD = ""; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimFloat.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimFloat.cs.meta new file mode 100644 index 0000000..b3105f5 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimFloat.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fb1f6a369ef8c40bda77241018ab6bd6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimInteger.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimInteger.cs new file mode 100644 index 0000000..3429b32 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimInteger.cs @@ -0,0 +1,85 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Sets an integer parameter on an Animator component to control a Unity animation. + /// + [CommandInfo("Animation", + "Set Anim Integer", + "Sets an integer parameter on an Animator component to control a Unity animation")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class SetAnimInteger : Command + { + [Tooltip("Reference to an Animator component in a game object")] + [SerializeField] protected AnimatorData _animator; + + [Tooltip("Name of the integer Animator parameter that will have its value changed")] + [SerializeField] protected StringData _parameterName; + + [Tooltip("The integer value to set the parameter to")] + [SerializeField] protected IntegerData value; + + #region Public members + + public override void OnEnter() + { + if (_animator.Value != null) + { + _animator.Value.SetInteger(_parameterName.Value, value.Value); + } + + Continue(); + } + + public override string GetSummary() + { + if (_animator.Value == null) + { + return "Error: No animator selected"; + } + + return _animator.Value.name + " (" + _parameterName.Value + ")"; + } + + public override Color GetButtonColor() + { + return new Color32(170, 204, 169, 255); + } + + public override bool HasReference(Variable variable) + { + return _animator.animatorRef == variable || _parameterName.stringRef == variable || value.integerRef == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD = ""; + + protected virtual void OnEnable() + { + if (animatorOLD != null) + { + _animator.Value = animatorOLD; + animatorOLD = null; + } + + if (parameterNameOLD != "") + { + _parameterName.Value = parameterNameOLD; + parameterNameOLD = ""; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimInteger.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimInteger.cs.meta new file mode 100644 index 0000000..8da48a9 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimInteger.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 76641c2c16481448eb6c0c1184fcdebe +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimTrigger.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimTrigger.cs new file mode 100644 index 0000000..c8c1e04 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimTrigger.cs @@ -0,0 +1,81 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Sets a trigger parameter on an Animator component to control a Unity animation. + /// + [CommandInfo("Animation", + "Set Anim Trigger", + "Sets a trigger parameter on an Animator component to control a Unity animation")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class SetAnimTrigger : Command + { + [Tooltip("Reference to an Animator component in a game object")] + [SerializeField] protected AnimatorData _animator; + + [Tooltip("Name of the trigger Animator parameter that will have its value changed")] + [SerializeField] protected StringData _parameterName; + + #region Public members + + public override void OnEnter() + { + if (_animator.Value != null) + { + _animator.Value.SetTrigger(_parameterName.Value); + } + + Continue(); + } + + public override string GetSummary() + { + if (_animator.Value == null) + { + return "Error: No animator selected"; + } + + return _animator.Value.name + " (" + _parameterName.Value + ")"; + } + + public override Color GetButtonColor() + { + return new Color32(170, 204, 169, 255); + } + + public override bool HasReference(Variable variable) + { + return _animator.animatorRef == variable || _parameterName.stringRef == variable || base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD = ""; + + protected virtual void OnEnable() + { + if (animatorOLD != null) + { + _animator.Value = animatorOLD; + animatorOLD = null; + } + + if (parameterNameOLD != "") + { + _parameterName.Value = parameterNameOLD; + parameterNameOLD = ""; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimTrigger.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimTrigger.cs.meta new file mode 100644 index 0000000..ed91e64 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAnimTrigger.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0729d4f369e6a4241a6e7e3b8b9c1933 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAudioPitch.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAudioPitch.cs new file mode 100644 index 0000000..e13af16 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAudioPitch.cs @@ -0,0 +1,61 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Sets the global pitch level for audio played with Play Music and Play Sound commands. + /// + [CommandInfo("Audio", + "Set Audio Pitch", + "Sets the global pitch level for audio played with Play Music and Play Sound commands.")] + [AddComponentMenu("")] + public class SetAudioPitch : Command + { + [Range(0,1)] + [Tooltip("Global pitch level for audio played using the Play Music and Play Sound commands")] + [SerializeField] protected float pitch = 1; + + [Range(0,30)] + [Tooltip("Time to fade between current pitch level and target pitch level.")] + [SerializeField] protected float fadeDuration; + + [Tooltip("Wait until the pitch change has finished before executing next command")] + [SerializeField] protected bool waitUntilFinished = true; + + #region Public members + + public override void OnEnter() + { + System.Action onComplete = () => { + if (waitUntilFinished) + { + Continue(); + } + }; + + var musicManager = FungusManager.Instance.MusicManager; + + musicManager.SetAudioPitch(pitch, fadeDuration, onComplete); + + if (!waitUntilFinished) + { + Continue(); + } + } + + public override string GetSummary() + { + return "Set to " + pitch + " over " + fadeDuration + " seconds."; + } + + public override Color GetButtonColor() + { + return new Color32(242, 209, 176, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAudioPitch.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAudioPitch.cs.meta new file mode 100644 index 0000000..964ffba --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAudioPitch.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2d3c9751268124c9390e807040e57447 +timeCreated: 1446825167 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAudioVolume.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAudioVolume.cs new file mode 100644 index 0000000..80a7362 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAudioVolume.cs @@ -0,0 +1,59 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Sets the global volume level for audio played with Play Music and Play Sound commands. + /// + [CommandInfo("Audio", + "Set Audio Volume", + "Sets the global volume level for audio played with Play Music and Play Sound commands.")] + [AddComponentMenu("")] + public class SetAudioVolume : Command + { + [Range(0,1)] + [Tooltip("Global volume level for audio played using Play Music and Play Sound")] + [SerializeField] protected float volume = 1f; + + [Range(0,30)] + [Tooltip("Time to fade between current volume level and target volume level.")] + [SerializeField] protected float fadeDuration = 1f; + + [Tooltip("Wait until the volume fade has completed before continuing.")] + [SerializeField] protected bool waitUntilFinished = true; + + #region Public members + + public override void OnEnter() + { + var musicManager = FungusManager.Instance.MusicManager; + + musicManager.SetAudioVolume(volume, fadeDuration, () => { + if (waitUntilFinished) + { + Continue(); + } + }); + + if (!waitUntilFinished) + { + Continue(); + } + } + + public override string GetSummary() + { + return "Set to " + volume + " over " + fadeDuration + " seconds."; + } + + public override Color GetButtonColor() + { + return new Color32(242, 209, 176, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAudioVolume.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAudioVolume.cs.meta new file mode 100644 index 0000000..c085875 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetAudioVolume.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a4015e84616cc45cfb498561373899d2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetClickable2D.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetClickable2D.cs new file mode 100644 index 0000000..c63e4ec --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetClickable2D.cs @@ -0,0 +1,58 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Sets a Clickable2D component to be clickable / non-clickable. + /// + [CommandInfo("Sprite", + "Set Clickable 2D", + "Sets a Clickable2D component to be clickable / non-clickable.")] + [AddComponentMenu("")] + public class SetClickable2D : Command + { + [Tooltip("Reference to Clickable2D component on a gameobject")] + [SerializeField] protected Clickable2D targetClickable2D; + + [Tooltip("Set to true to enable the component")] + [SerializeField] protected BooleanData activeState; + + #region Public members + + public override void OnEnter() + { + if (targetClickable2D != null) + { + targetClickable2D.ClickEnabled = activeState.Value; + } + + Continue(); + } + + public override string GetSummary() + { + if (targetClickable2D == null) + { + return "Error: No Clickable2D component selected"; + } + + return targetClickable2D.gameObject.name; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + return activeState.booleanRef == variable || base.HasReference(variable); + } + + #endregion + } + +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetClickable2D.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetClickable2D.cs.meta new file mode 100644 index 0000000..e015d4c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetClickable2D.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a598660d01b2343bb92adebcbb629ec5 +timeCreated: 1427811782 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetCollider.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetCollider.cs new file mode 100644 index 0000000..d5a947d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetCollider.cs @@ -0,0 +1,113 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using System.Collections.Generic; + +namespace Fungus +{ + /// + /// Sets all collider (2d or 3d) components on the target objects to be active / inactive. + /// + [CommandInfo("Sprite", + "Set Collider", + "Sets all collider (2d or 3d) components on the target objects to be active / inactive")] + [AddComponentMenu("")] + public class SetCollider : Command + { + [Tooltip("A list of gameobjects containing collider components to be set active / inactive")] + [SerializeField] protected List targetObjects = new List(); + + [Tooltip("All objects with this tag will have their collider set active / inactive")] + [SerializeField] protected string targetTag = ""; + + [Tooltip("Set to true to enable the collider components")] + [SerializeField] protected BooleanData activeState; + + protected virtual void SetColliderActive(GameObject go) + { + if (go != null) + { + // 3D objects + var colliders = go.GetComponentsInChildren(); + for (int i = 0; i < colliders.Length; i++) + { + var c = colliders[i]; + c.enabled = activeState.Value; + } + + // 2D objects + var collider2Ds = go.GetComponentsInChildren(); + for (int i = 0; i < collider2Ds.Length; i++) + { + var c = collider2Ds[i]; + c.enabled = activeState.Value; + } + } + } + + #region Public members + + public override void OnEnter() + { + for (int i = 0; i < targetObjects.Count; i++) + { + var go = targetObjects[i]; + SetColliderActive(go); + } + + GameObject[] taggedObjects = null; + try + { + taggedObjects = GameObject.FindGameObjectsWithTag(targetTag); + } + catch + { + // The tag has not been declared in this scene + } + + if (taggedObjects != null) + { + for (int i = 0; i < taggedObjects.Length; i++) + { + var go = taggedObjects[i]; + SetColliderActive(go); + } + } + + Continue(); + } + + public override string GetSummary() + { + int count = targetObjects.Count; + + if (activeState.Value) + { + return "Enable " + count + " collider objects."; + } + else + { + return "Disable " + count + " collider objects."; + } + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool IsReorderableArray(string propertyName) + { + return propertyName == "targetObjects"; + } + + public override bool HasReference(Variable variable) + { + return activeState.booleanRef == variable || base.HasReference(variable); + } + + #endregion + } + +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetCollider.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetCollider.cs.meta new file mode 100644 index 0000000..86799ca --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetCollider.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 985454614aca94d16906c0f2bd0b26f6 +timeCreated: 1432220559 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetDraggable2D.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetDraggable2D.cs new file mode 100644 index 0000000..0f24ecd --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetDraggable2D.cs @@ -0,0 +1,57 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Sets a Draggable2D component to be draggable / non-draggable. + /// + [CommandInfo("Sprite", + "Set Draggable 2D", + "Sets a Draggable2D component to be draggable / non-draggable.")] + [AddComponentMenu("")] + public class SetDraggable2D : Command + { + [Tooltip("Reference to Draggable2D component on a gameobject")] + [SerializeField] protected Draggable2D targetDraggable2D; + + [Tooltip("Set to true to enable the component")] + [SerializeField] protected BooleanData activeState; + + #region Public members + + public override void OnEnter() + { + if (targetDraggable2D != null) + { + targetDraggable2D.DragEnabled = activeState.Value; + } + + Continue(); + } + + public override string GetSummary() + { + if (targetDraggable2D == null) + { + return "Error: No Draggable2D component selected"; + } + + return targetDraggable2D.gameObject.name; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + return activeState.booleanRef == variable || base.HasReference(variable); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetDraggable2D.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetDraggable2D.cs.meta new file mode 100644 index 0000000..1f19c7d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetDraggable2D.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c987b33e737044fb185f6ae869a7bc17 +timeCreated: 1453469154 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetInteractable.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetInteractable.cs new file mode 100644 index 0000000..d6680a4 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetInteractable.cs @@ -0,0 +1,111 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.UI; +using System.Collections.Generic; + +namespace Fungus +{ + /// + /// Set the interactable state of selectable objects. + /// + [CommandInfo("UI", + "Set Interactable", + "Set the interactable state of selectable objects.")] + public class SetInteractable : Command + { + [Tooltip("List of objects to be affected by the command")] + [SerializeField] protected List targetObjects = new List(); + + [Tooltip("Controls if the selectable UI object be interactable or not")] + [SerializeField] protected BooleanData interactableState = new BooleanData(true); + + #region Public members + + public override void OnEnter() + { + if (targetObjects.Count == 0) + { + Continue(); + return; + } + + for (int i = 0; i < targetObjects.Count; i++) + { + var targetObject = targetObjects[i]; + var selectables = targetObject.GetComponents(); + for (int j = 0; j < selectables.Length; j++) + { + var selectable = selectables[j]; + selectable.interactable = interactableState.Value; + } + } + + Continue(); + } + + public override string GetSummary() + { + if (targetObjects.Count == 0) + { + return "Error: No targetObjects selected"; + } + else if (targetObjects.Count == 1) + { + if (targetObjects[0] == null) + { + return "Error: No targetObjects selected"; + } + return targetObjects[0].name + " = " + interactableState.Value; + } + + string objectList = ""; + for (int i = 0; i < targetObjects.Count; i++) + { + var go = targetObjects[i]; + if (go == null) + { + continue; + } + if (objectList == "") + { + objectList += go.name; + } + else + { + objectList += ", " + go.name; + } + } + + return objectList + " = " + interactableState.Value; + } + + public override Color GetButtonColor() + { + return new Color32(180, 250, 250, 255); + } + + public override void OnCommandAdded(Block parentBlock) + { + targetObjects.Add(null); + } + + public override bool IsReorderableArray(string propertyName) + { + if (propertyName == "targetObjects") + { + return true; + } + + return false; + } + + public override bool HasReference(Variable variable) + { + return interactableState.booleanRef == variable || base.HasReference(variable); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetInteractable.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetInteractable.cs.meta new file mode 100644 index 0000000..6cb44e8 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetInteractable.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ab0d0ed4a2ca94c81a230a0ecce6e6e4 +timeCreated: 1442403493 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetLanguage.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetLanguage.cs new file mode 100644 index 0000000..f1c069a --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetLanguage.cs @@ -0,0 +1,73 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Set the active language for the scene. A Localization object with a localization file must be present in the scene. + /// + [CommandInfo("Narrative", + "Set Language", + "Set the active language for the scene. A Localization object with a localization file must be present in the scene.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class SetLanguage : Command + { + [Tooltip("Code of the language to set. e.g. ES, DE, JA")] + [SerializeField] protected StringData _languageCode = new StringData(); + + #region Public members + + public static string mostRecentLanguage = ""; + + public override void OnEnter() + { + Localization localization = GameObject.FindObjectOfType(); + if (localization != null) + { + localization.SetActiveLanguage(_languageCode.Value, true); + + // Cache the most recently set language code so we can continue to + // use the same language in subsequent scenes. + mostRecentLanguage = _languageCode.Value; + } + + Continue(); + } + + public override string GetSummary() + { + return _languageCode.Value; + } + + public override Color GetButtonColor() + { + return new Color32(184, 210, 235, 255); + } + + public override bool HasReference(Variable variable) + { + return _languageCode.stringRef == variable || base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("languageCode")] public string languageCodeOLD = ""; + + protected virtual void OnEnable() + { + if (languageCodeOLD != "") + { + _languageCode.Value = languageCodeOLD; + languageCodeOLD = ""; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetLanguage.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetLanguage.cs.meta new file mode 100644 index 0000000..712a8ab --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetLanguage.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3fc625e237d6048bf86f34835d8266d9 +timeCreated: 1428591017 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetLayerOrder.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetLayerOrder.cs new file mode 100644 index 0000000..9e4e312 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetLayerOrder.cs @@ -0,0 +1,68 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Sets the Renderer sorting layer of every child of a game object. Applies to all Renderers (including mesh, skinned mesh, and sprite). + /// + [CommandInfo("Sprite", + "Set Sorting Layer", + "Sets the Renderer sorting layer of every child of a game object. Applies to all Renderers (including mesh, skinned mesh, and sprite).")] + [AddComponentMenu("")] + public class SetSortingLayer : Command + { + [Tooltip("Root Object that will have the Sorting Layer set. Any children will also be affected")] + [SerializeField] protected GameObject targetObject; + + [Tooltip("The New Layer Name to apply")] + [SerializeField] protected string sortingLayer; + + protected void ApplySortingLayer(Transform target, string layerName) + { + var renderer = target.gameObject.GetComponent(); + if (renderer) + { + renderer.sortingLayerName = layerName; + Debug.Log(target.name); + } + + var targetTransform = target.transform; + foreach (Transform child in targetTransform) + { + ApplySortingLayer(child, layerName); + } + } + + #region Public members + + public override void OnEnter() + { + if (targetObject != null) + { + ApplySortingLayer(targetObject.transform, sortingLayer); + } + + Continue(); + } + + public override string GetSummary() + { + if (targetObject == null) + { + return "Error: No game object selected"; + } + + return targetObject.name; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetLayerOrder.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetLayerOrder.cs.meta new file mode 100644 index 0000000..0087a3b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetLayerOrder.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 673d76133d8494386801a5efa9dd6b7c +timeCreated: 1441190679 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetMenuDialog.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetMenuDialog.cs new file mode 100644 index 0000000..df5c135 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetMenuDialog.cs @@ -0,0 +1,49 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Sets a custom menu dialog to use when displaying multiple choice menus. + /// + [CommandInfo("Narrative", + "Set Menu Dialog", + "Sets a custom menu dialog to use when displaying multiple choice menus")] + [AddComponentMenu("")] + public class SetMenuDialog : Command + { + [Tooltip("The Menu Dialog to use for displaying menu buttons")] + [SerializeField] protected MenuDialog menuDialog; + + #region Public members + + public override void OnEnter() + { + if (menuDialog != null) + { + MenuDialog.ActiveMenuDialog = menuDialog; + } + + Continue(); + } + + public override string GetSummary() + { + if (menuDialog == null) + { + return "Error: No menu dialog selected"; + } + + return menuDialog.name; + } + + public override Color GetButtonColor() + { + return new Color32(184, 210, 235, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetMenuDialog.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetMenuDialog.cs.meta new file mode 100644 index 0000000..e02c8b6 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetMenuDialog.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b097b9790a8a1456a86bc4d322b487db +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetMouseCursor.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetMouseCursor.cs new file mode 100644 index 0000000..bb67c57 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetMouseCursor.cs @@ -0,0 +1,62 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Sets the mouse cursor sprite. + /// + [CommandInfo("Sprite", + "Set Mouse Cursor", + "Sets the mouse cursor sprite.")] + [AddComponentMenu("")] + public class SetMouseCursor : Command + { + [Tooltip("Texture to use for cursor. Will use default mouse cursor if no sprite is specified")] + [SerializeField] protected Texture2D cursorTexture; + + [Tooltip("The offset from the top left of the texture to use as the target point")] + [SerializeField] protected Vector2 hotSpot; + + // Cached static cursor settings + protected static Texture2D activeCursorTexture; + protected static Vector2 activeHotspot; + + #region Public members + + public static void ResetMouseCursor() + { + // Change mouse cursor back to most recent settings + Cursor.SetCursor(activeCursorTexture, activeHotspot, CursorMode.Auto); + } + + public override void OnEnter() + { + Cursor.SetCursor(cursorTexture, hotSpot, CursorMode.Auto); + + activeCursorTexture = cursorTexture; + activeHotspot = hotSpot; + + Continue(); + } + + public override string GetSummary() + { + if (cursorTexture == null) + { + return "Error: No cursor sprite selected"; + } + + return cursorTexture.name; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetMouseCursor.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetMouseCursor.cs.meta new file mode 100644 index 0000000..688a391 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetMouseCursor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fb6f88496f37c444a91acef47749f723 +timeCreated: 1439302629 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSaveProfile.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSaveProfile.cs new file mode 100644 index 0000000..22552f8 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSaveProfile.cs @@ -0,0 +1,50 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using System; +using System.Collections; + +namespace Fungus +{ + /// + /// Sets the active profile that the Save Variable and Load Variable commands will use. This is useful to crete multiple player save games. Once set, the profile applies across all Flowcharts and will also persist across scene loads. + /// + [CommandInfo("Variable", + "Set Save Profile", + "Sets the active profile that the Save Variable and Load Variable commands will use. This is useful to crete multiple player save games. Once set, the profile applies across all Flowcharts and will also persist across scene loads.")] + [AddComponentMenu("")] + public class SetSaveProfile : Command + { + [Tooltip("Name of save profile to make active.")] + [SerializeField] protected string saveProfileName = ""; + + /// + /// Shared save profile name used by SaveVariable and LoadVariable. + /// + private static string saveProfile = ""; + + #region Public members + + public static String SaveProfile { get { return saveProfile; } } + + public override void OnEnter() + { + saveProfile = saveProfileName; + + Continue(); + } + + public override string GetSummary() + { + return saveProfileName; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSaveProfile.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSaveProfile.cs.meta new file mode 100644 index 0000000..29e82ed --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSaveProfile.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9a240aa44597844f89e6d1ba15a96b04 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSayDialog.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSayDialog.cs new file mode 100644 index 0000000..8297b2d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSayDialog.cs @@ -0,0 +1,49 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Sets a custom say dialog to use when displaying story text. + /// + [CommandInfo("Narrative", + "Set Say Dialog", + "Sets a custom say dialog to use when displaying story text")] + [AddComponentMenu("")] + public class SetSayDialog : Command + { + [Tooltip("The Say Dialog to use for displaying Say story text")] + [SerializeField] protected SayDialog sayDialog; + + #region Public members + + public override void OnEnter() + { + if (sayDialog != null) + { + SayDialog.ActiveSayDialog = sayDialog; + } + + Continue(); + } + + public override string GetSummary() + { + if (sayDialog == null) + { + return "Error: No say dialog selected"; + } + + return sayDialog.name; + } + + public override Color GetButtonColor() + { + return new Color32(184, 210, 235, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSayDialog.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSayDialog.cs.meta new file mode 100644 index 0000000..5c3ac7f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSayDialog.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d65d551a201c94bc79950076ff3eaf2e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSliderValue.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSliderValue.cs new file mode 100644 index 0000000..a3e3d93 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSliderValue.cs @@ -0,0 +1,57 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.UI; + +namespace Fungus +{ + /// + /// Sets the value property of a slider object. + /// + [CommandInfo("UI", + "Set Slider Value", + "Sets the value property of a slider object")] + public class SetSliderValue : Command + { + [Tooltip("Target slider object to set the value on")] + [SerializeField] protected Slider slider; + + [Tooltip("Float value to set the slider value to.")] + [SerializeField] protected FloatData value; + + #region Public members + + public override void OnEnter() + { + if (slider != null) + { + slider.value = value; + } + + Continue(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override string GetSummary() + { + if (slider == null) + { + return "Error: Slider object not selected"; + } + + return slider.name + " = " + value.GetDescription(); + } + + public override bool HasReference(Variable variable) + { + return value.floatRef == variable || base.HasReference(variable); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSliderValue.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSliderValue.cs.meta new file mode 100644 index 0000000..d94fc64 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSliderValue.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2d82f2f1b848347c19a48abd65541523 +timeCreated: 1444656241 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSprite.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSprite.cs new file mode 100644 index 0000000..1968fc9 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSprite.cs @@ -0,0 +1,87 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +// Snippet added by ducksonthewater, 2019-01-03 - www.ducks-on-the-water.com + +using UnityEngine; +using System.Collections.Generic; + +namespace Fungus +{ + /// + /// Changes the sprite on a SpriteRenderer. + /// + [CommandInfo("Sprite", + "Set Sprite", + "Changes the sprite property of a list of Sprite Renderers.")] + [AddComponentMenu("")] + public class SetSprite : Command + { + [Tooltip("List of sprites to set the sprite property on")] + [SerializeField] protected List spriteRenderers = new List(); + + [Tooltip("The sprite set on the target sprite renderers")] + [SerializeField] protected Sprite sprite; + + #region Public members + + public override void OnEnter() + { + for (int i = 0; i < spriteRenderers.Count; i++) + { + var spriteRenderer = spriteRenderers[i]; + spriteRenderer.sprite = sprite; + } + + Continue(); + } + + public override string GetSummary() + { + string summary = ""; + for (int i = 0; i < spriteRenderers.Count; i++) + { + var spriteRenderer = spriteRenderers[i]; + if (spriteRenderer == null) + { + continue; + } + if (summary.Length > 0) + { + summary += ", "; + } + summary += spriteRenderer.name; + } + + if (summary.Length == 0) + { + return "Error: No sprite selected"; + } + + return summary + " = " + sprite; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool IsReorderableArray(string propertyName) + { + if (propertyName == "spriteRenderers") + { + return true; + } + + return false; + } + + public override void OnCommandAdded(Block parentBlock) + { + // Add a default empty entry + spriteRenderers.Add(null); + } + + #endregion + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSprite.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSprite.cs.meta new file mode 100644 index 0000000..aa8315a --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSprite.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8bacd6d8da56644cbb2c9a43f96750c3 +timeCreated: 1439385260 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSpriteOrder.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSpriteOrder.cs new file mode 100644 index 0000000..a233f4d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSpriteOrder.cs @@ -0,0 +1,90 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using System.Collections.Generic; + +namespace Fungus +{ + /// + /// Controls the render order of sprites by setting the Order In Layer property of a list of sprites. + /// + [CommandInfo("Sprite", + "Set Sprite Order", + "Controls the render order of sprites by setting the Order In Layer property of a list of sprites.")] + [AddComponentMenu("")] + public class SetSpriteOrder : Command + { + [Tooltip("List of sprites to set the order in layer property on")] + [SerializeField] protected List targetSprites = new List(); + + [Tooltip("The order in layer value to set on the target sprites")] + [SerializeField] protected IntegerData orderInLayer; + + #region Public members + + public override void OnEnter() + { + for (int i = 0; i < targetSprites.Count; i++) + { + var spriteRenderer = targetSprites[i]; + spriteRenderer.sortingOrder = orderInLayer; + } + + Continue(); + } + + public override string GetSummary() + { + string summary = ""; + for (int i = 0; i < targetSprites.Count; i++) + { + var spriteRenderer = targetSprites[i]; + if (spriteRenderer == null) + { + continue; + } + if (summary.Length > 0) + { + summary += ", "; + } + summary += spriteRenderer.name; + } + + if (summary.Length == 0) + { + return "Error: No cursor sprite selected"; + } + + return summary + " = " + orderInLayer.Value; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool IsReorderableArray(string propertyName) + { + if (propertyName == "targetSprites") + { + return true; + } + + return false; + } + + public override void OnCommandAdded(Block parentBlock) + { + // Add a default empty entry + targetSprites.Add(null); + } + + public override bool HasReference(Variable variable) + { + return orderInLayer.integerRef == variable || base.HasReference(variable); + } + + #endregion + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSpriteOrder.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSpriteOrder.cs.meta new file mode 100644 index 0000000..c8b1862 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetSpriteOrder.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5d1724bb98f694376b7653fa24a54541 +timeCreated: 1439385260 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetText.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetText.cs new file mode 100644 index 0000000..2591805 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetText.cs @@ -0,0 +1,130 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Sets the text property on a UI Text object and/or an Input Field object. + /// + [CommandInfo("UI", + "Set Text", + "Sets the text property on a UI Text object and/or an Input Field object.")] + [AddComponentMenu("")] + public class SetText : Command, ILocalizable + { + [Tooltip("Text object to set text on. Can be a UI Text, Text Field or Text Mesh object.")] + [SerializeField] protected GameObject targetTextObject; + + [Tooltip("String value to assign to the text object")] + [FormerlySerializedAs("stringData")] + [SerializeField] protected StringDataMulti text; + + [Tooltip("Notes about this story text for other authors, localization, etc.")] + [SerializeField] protected string description; + + #region Public members + + public override void OnEnter() + { + var flowchart = GetFlowchart(); + string newText = flowchart.SubstituteVariables(text.Value); + + if (targetTextObject == null) + { + Continue(); + return; + } + + TextAdapter textAdapter = new TextAdapter(); + textAdapter.InitFromGameObject(targetTextObject); + + if (textAdapter.HasTextObject()) + { + textAdapter.Text = newText; + } + + Continue(); + } + + public override string GetSummary() + { + if (targetTextObject != null) + { + return targetTextObject.name + " : " + text.Value; + } + + return "Error: No text object selected"; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + return text.stringRef == variable || base.HasReference(variable); + } + + #endregion + + + #region Editor caches +#if UNITY_EDITOR + protected override void RefreshVariableCache() + { + base.RefreshVariableCache(); + + var f = GetFlowchart(); + + f.DetermineSubstituteVariables(text, referencedVariables); + } +#endif + #endregion Editor caches + + #region ILocalizable implementation + + public virtual string GetStandardText() + { + return text; + } + + public virtual void SetStandardText(string standardText) + { + text.Value = standardText; + } + + public virtual string GetDescription() + { + return description; + } + + public virtual string GetStringId() + { + // String id for Set Text commands is SETTEXT.. + return "SETTEXT." + GetFlowchartLocalizationId() + "." + itemId; + } + + #endregion + + #region Backwards compatibility + + // Backwards compatibility with Fungus v2.1.2 + [HideInInspector] + [FormerlySerializedAs("textObject")] + public Text _textObjectObsolete; + protected virtual void OnEnable() + { + if (_textObjectObsolete != null) + { + targetTextObject = _textObjectObsolete.gameObject; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetText.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetText.cs.meta new file mode 100644 index 0000000..1717530 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetText.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 78c0367bf08d147bd80b5454de50e9d4 +timeCreated: 1438782798 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetToggleState.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetToggleState.cs new file mode 100644 index 0000000..361f9d4 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetToggleState.cs @@ -0,0 +1,57 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.UI; + +namespace Fungus +{ + /// + /// Sets the state of a toggle UI object. + /// + [CommandInfo("UI", + "Set Toggle State", + "Sets the state of a toggle UI object")] + public class SetToggleState : Command + { + [Tooltip("Target toggle object to set the state on")] + [SerializeField] protected Toggle toggle; + + [Tooltip("Boolean value to set the toggle state to.")] + [SerializeField] protected BooleanData value; + + #region Public members + + public override void OnEnter() + { + if (toggle != null) + { + toggle.isOn = value.Value; + } + + Continue(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override string GetSummary() + { + if (toggle == null) + { + return "Error: Toggle object not selected"; + } + + return toggle.name + " = " + value.GetDescription(); + } + + public override bool HasReference(Variable variable) + { + return value.booleanRef == variable || base.HasReference(variable); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetToggleState.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetToggleState.cs.meta new file mode 100644 index 0000000..b33987c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetToggleState.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 41ef36697f78e4c6e909d158bd8ccc83 +timeCreated: 1444656241 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetUIImage.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetUIImage.cs new file mode 100644 index 0000000..5a811bd --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetUIImage.cs @@ -0,0 +1,86 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using System.Collections.Generic; +using UnityEngine.UI; + +namespace Fungus +{ + /// + /// Changes the Image property on a UI element. + /// + [CommandInfo("UI", + "Set UI Image", + "Changes the Image property of a list of UI Images.")] + [AddComponentMenu("")] + public class SetUIImage : Command + { + [Tooltip("List of UI Images to set the source image property on")] + [SerializeField] protected List images = new List(); + + [Tooltip("The sprite set on the source image property")] + [SerializeField] protected Sprite sprite; + + #region Public members + + public override void OnEnter() + { + for (int i = 0; i < images.Count; i++) + { + var image = images[i]; + image.sprite = sprite; + } + + Continue(); + } + + public override string GetSummary() + { + string summary = ""; + for (int i = 0; i < images.Count; i++) + { + var targetImage = images[i]; + if (targetImage == null) + { + continue; + } + if (summary.Length > 0) + { + summary += ", "; + } + summary += targetImage.name; + } + + if (summary.Length == 0) + { + return "Error: No sprite selected"; + } + + return summary + " = " + sprite; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool IsReorderableArray(string propertyName) + { + if (propertyName == "images") + { + return true; + } + + return false; + } + + public override void OnCommandAdded(Block parentBlock) + { + // Add a default empty entry + images.Add(null); + } + + #endregion + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetUIImage.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetUIImage.cs.meta new file mode 100644 index 0000000..39b80dd --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetUIImage.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 82e4c082f762243f6943909a4272096d +timeCreated: 1439385260 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetVariable.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetVariable.cs new file mode 100644 index 0000000..d55650e --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetVariable.cs @@ -0,0 +1,245 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using System.Collections.Generic; + +namespace Fungus +{ + /// + /// Sets a Boolean, Integer, Float or String variable to a new value using a simple arithmetic operation. The value can be a constant or reference another variable of the same type. + /// + [CommandInfo("Variable", + "Set Variable", + "Sets a Boolean, Integer, Float or String variable to a new value using a simple arithmetic operation. The value can be a constant or reference another variable of the same type.")] + [AddComponentMenu("")] + public class SetVariable : Command, ISerializationCallbackReceiver + { + [SerializeField] protected AnyVariableAndDataPair anyVar = new AnyVariableAndDataPair(); + + [Tooltip("The type of math operation to be performed")] + [SerializeField] protected SetOperator setOperator; + + protected virtual void DoSetOperation() + { + if (anyVar.variable == null) + { + return; + } + + anyVar.SetOp(setOperator); + } + + #region Public members + + /// + /// The type of math operation to be performed. + /// + public virtual SetOperator _SetOperator { get { return setOperator; } } + + public override void OnEnter() + { + DoSetOperation(); + + Continue(); + } + + public override string GetSummary() + { + if (anyVar.variable == null) + { + return "Error: Variable not selected"; + } + + string description = anyVar.variable.Key; + description += " " + VariableUtil.GetSetOperatorDescription(setOperator) + " "; + description += anyVar.GetDataDescription(); + + + return description; + } + + public override bool HasReference(Variable variable) + { + return anyVar.HasReference(variable); + } + + public override Color GetButtonColor() + { + return new Color32(253, 253, 150, 255); + } + + #endregion + + + + #region Editor caches +#if UNITY_EDITOR + protected override void RefreshVariableCache() + { + base.RefreshVariableCache(); + + if(anyVar != null) + anyVar.RefreshVariableCacheHelper(GetFlowchart(), ref referencedVariables); + } +#endif + #endregion Editor caches + + #region backwards compat + + + [Tooltip("Variable to use in expression")] + [VariableProperty(AllVariableTypes.VariableAny.Any)] + [SerializeField] protected Variable variable; + + [Tooltip("Boolean value to compare against")] + [SerializeField] protected BooleanData booleanData; + + [Tooltip("Integer value to compare against")] + [SerializeField] protected IntegerData integerData; + + [Tooltip("Float value to compare against")] + [SerializeField] protected FloatData floatData; + + [Tooltip("String value to compare against")] + [SerializeField] protected StringDataMulti stringData; + + [Tooltip("Animator value to compare against")] + [SerializeField] protected AnimatorData animatorData; + + [Tooltip("AudioSource value to compare against")] + [SerializeField] protected AudioSourceData audioSourceData; + + [Tooltip("Color value to compare against")] + [SerializeField] protected ColorData colorData; + + [Tooltip("GameObject value to compare against")] + [SerializeField] protected GameObjectData gameObjectData; + + [Tooltip("Material value to compare against")] + [SerializeField] protected MaterialData materialData; + + [Tooltip("Object value to compare against")] + [SerializeField] protected ObjectData objectData; + + [Tooltip("Rigidbody2D value to compare against")] + [SerializeField] protected Rigidbody2DData rigidbody2DData; + + [Tooltip("Sprite value to compare against")] + [SerializeField] protected SpriteData spriteData; + + [Tooltip("Texture value to compare against")] + [SerializeField] protected TextureData textureData; + + [Tooltip("Transform value to compare against")] + [SerializeField] protected TransformData transformData; + + [Tooltip("Vector2 value to compare against")] + [SerializeField] protected Vector2Data vector2Data; + + [Tooltip("Vector3 value to compare against")] + [SerializeField] protected Vector3Data vector3Data; + + public void OnBeforeSerialize() + { + } + + void ISerializationCallbackReceiver.OnAfterDeserialize() + { + if (variable == null) + { + return; + } + else + { + anyVar.variable = variable; + } + + if (variable.GetType() == typeof(BooleanVariable) && !booleanData.Equals(new BooleanData())) + { + anyVar.data.booleanData = booleanData; + booleanData = new BooleanData(); + } + else if (variable.GetType() == typeof(IntegerVariable) && !integerData.Equals(new IntegerData())) + { + anyVar.data.integerData = integerData; + integerData = new IntegerData(); + } + else if (variable.GetType() == typeof(FloatVariable) && !floatData.Equals(new FloatData())) + { + anyVar.data.floatData = floatData; + floatData = new FloatData(); + } + else if (variable.GetType() == typeof(StringVariable) && !stringData.Equals(new StringDataMulti())) + { + anyVar.data.stringData.stringRef = stringData.stringRef; + anyVar.data.stringData.stringVal = stringData.stringVal; + stringData = new StringDataMulti(); + } + else if (variable.GetType() == typeof(AnimatorVariable) && !animatorData.Equals(new AnimatorData())) + { + anyVar.data.animatorData = animatorData; + animatorData = new AnimatorData(); + } + else if (variable.GetType() == typeof(AudioSourceVariable) && !audioSourceData.Equals(new AudioSourceData())) + { + anyVar.data.audioSourceData = audioSourceData; + audioSourceData = new AudioSourceData(); + } + else if (variable.GetType() == typeof(ColorVariable) && !colorData.Equals(new ColorData())) + { + anyVar.data.colorData = colorData; + colorData = new ColorData(); + } + else if (variable.GetType() == typeof(GameObjectVariable) && !gameObjectData.Equals(new GameObjectData())) + { + anyVar.data.gameObjectData = gameObjectData; + gameObjectData = new GameObjectData(); + } + else if (variable.GetType() == typeof(MaterialVariable) && !materialData.Equals(new MaterialData())) + { + anyVar.data.materialData = materialData; + materialData = new MaterialData(); + } + else if (variable.GetType() == typeof(ObjectVariable) && !objectData.Equals(new ObjectData())) + { + anyVar.data.objectData = objectData; + objectData = new ObjectData(); + } + else if (variable.GetType() == typeof(Rigidbody2DVariable) && !rigidbody2DData.Equals(new Rigidbody2DData())) + { + anyVar.data.rigidbody2DData = rigidbody2DData; + rigidbody2DData = new Rigidbody2DData(); + } + else if (variable.GetType() == typeof(SpriteVariable) && !spriteData.Equals(new SpriteData())) + { + anyVar.data.spriteData = spriteData; + spriteData = new SpriteData(); + } + else if (variable.GetType() == typeof(TextureVariable) && !textureData.Equals(new TextureData())) + { + anyVar.data.textureData = textureData; + textureData = new TextureData(); + } + else if (variable.GetType() == typeof(TransformVariable) && !transformData.Equals(new TransformData())) + { + anyVar.data.transformData = transformData; + transformData = new TransformData(); + } + else if (variable.GetType() == typeof(Vector2Variable) && !vector2Data.Equals(new Vector2Data())) + { + anyVar.data.vector2Data = vector2Data; + vector2Data = new Vector2Data(); + } + else if (variable.GetType() == typeof(Vector3Variable) && !vector3Data.Equals(new Vector3Data())) + { + anyVar.data.vector3Data = vector3Data; + vector3Data = new Vector3Data(); + } + + //now converted to new AnyVar storage, remove the legacy. + variable = null; + } + #endregion + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SetVariable.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetVariable.cs.meta new file mode 100644 index 0000000..efb68c0 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SetVariable.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fb77d0ce495044f6e9feb91b31798e8c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeCamera.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeCamera.cs new file mode 100644 index 0000000..aca845b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeCamera.cs @@ -0,0 +1,72 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using System.Collections; + +namespace Fungus +{ + /// + /// Applies a camera shake effect to the main camera. + /// + [CommandInfo("Camera", + "Shake Camera", + "Applies a camera shake effect to the main camera.")] + [AddComponentMenu("")] + public class ShakeCamera : Command + { + [Tooltip("Time for camera shake effect to complete")] + [SerializeField] protected float duration = 0.5f; + + [Tooltip("Magnitude of shake effect in x & y axes")] + [SerializeField] protected Vector2 amount = new Vector2(1, 1); + + [Tooltip("Wait until the shake effect has finished before executing next command")] + [SerializeField] protected bool waitUntilFinished; + + protected virtual void OniTweenComplete(object param) + { + Command command = param as Command; + if (command != null && command.Equals(this)) + { + if (waitUntilFinished) + { + Continue(); + } + } + } + + #region Public members + + public override void OnEnter() + { + Vector3 v = new Vector3(); + v = amount; + + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("amount", v); + tweenParams.Add("time", duration); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.ShakePosition(Camera.main.gameObject, tweenParams); + + if (!waitUntilFinished) + { + Continue(); + } + } + + public override string GetSummary() + { + return "For " + duration + " seconds."; + } + + public override Color GetButtonColor() + { + return new Color32(216, 228, 170, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeCamera.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeCamera.cs.meta new file mode 100644 index 0000000..e6b9dfa --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeCamera.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 616cd37e21c7645c58a89edf5abee56f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakePosition.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakePosition.cs new file mode 100644 index 0000000..86a1c48 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakePosition.cs @@ -0,0 +1,82 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Randomly shakes a GameObject's position by a diminishing amount over time. + /// + [CommandInfo("iTween", + "Shake Position", + "Randomly shakes a GameObject's position by a diminishing amount over time.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class ShakePosition : iTweenCommand + { + [Tooltip("A translation offset in space the GameObject will animate to")] + [SerializeField] protected Vector3Data _amount; + + [Tooltip("Whether to animate in world space or relative to the parent. False by default.")] + [SerializeField] protected bool isLocal; + + [Tooltip("Restricts rotation to the supplied axis only")] + [SerializeField] protected iTweenAxis axis; + + #region Public members + + public override void DoTween() + { + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("name", _tweenName.Value); + tweenParams.Add("amount", _amount.Value); + switch (axis) + { + case iTweenAxis.X: + tweenParams.Add("axis", "x"); + break; + case iTweenAxis.Y: + tweenParams.Add("axis", "y"); + break; + case iTweenAxis.Z: + tweenParams.Add("axis", "z"); + break; + } + tweenParams.Add("time", _duration.Value); + tweenParams.Add("easetype", easeType); + tweenParams.Add("looptype", loopType); + tweenParams.Add("isLocal", isLocal); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.ShakePosition(_targetObject.Value, tweenParams); + } + + public override bool HasReference(Variable variable) + { + return _amount.vector3Ref == variable || base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + + protected override void OnEnable() + { + base.OnEnable(); + + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + amountOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakePosition.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakePosition.cs.meta new file mode 100644 index 0000000..012ad42 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakePosition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 358f65040c3ef4327b70b2813cc197c7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeRotation.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeRotation.cs new file mode 100644 index 0000000..a5982cd --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeRotation.cs @@ -0,0 +1,67 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Randomly shakes a GameObject's rotation by a diminishing amount over time. + /// + [CommandInfo("iTween", + "Shake Rotation", + "Randomly shakes a GameObject's rotation by a diminishing amount over time.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class ShakeRotation : iTweenCommand + { + [Tooltip("A rotation offset in space the GameObject will animate to")] + [SerializeField] protected Vector3Data _amount; + + [Tooltip("Apply the transformation in either the world coordinate or local cordinate system")] + [SerializeField] protected Space space = Space.Self; + + #region Public members + + public override void DoTween() + { + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("name", _tweenName.Value); + tweenParams.Add("amount", _amount.Value); + tweenParams.Add("space", space); + tweenParams.Add("time", _duration.Value); + tweenParams.Add("easetype", easeType); + tweenParams.Add("looptype", loopType); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.ShakeRotation(_targetObject.Value, tweenParams); + } + + public override bool HasReference(Variable variable) + { + return _amount.vector3Ref == variable || base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + + protected override void OnEnable() + { + base.OnEnable(); + + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + amountOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeRotation.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeRotation.cs.meta new file mode 100644 index 0000000..419b0fc --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeRotation.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 82c753a90aa184bd88472f4589167f0b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeScale.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeScale.cs new file mode 100644 index 0000000..5bb96b8 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeScale.cs @@ -0,0 +1,63 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Randomly shakes a GameObject's rotation by a diminishing amount over time. + /// + [CommandInfo("iTween", + "Shake Scale", + "Randomly shakes a GameObject's rotation by a diminishing amount over time.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class ShakeScale : iTweenCommand + { + [Tooltip("A scale offset in space the GameObject will animate to")] + [SerializeField] protected Vector3Data _amount; + + #region Public members + + public override void DoTween() + { + Hashtable tweenParams = new Hashtable(); + tweenParams.Add("name", _tweenName.Value); + tweenParams.Add("amount", _amount.Value); + tweenParams.Add("time", _duration.Value); + tweenParams.Add("easetype", easeType); + tweenParams.Add("looptype", loopType); + tweenParams.Add("oncomplete", "OniTweenComplete"); + tweenParams.Add("oncompletetarget", gameObject); + tweenParams.Add("oncompleteparams", this); + iTween.ShakeScale(_targetObject.Value, tweenParams); + } + + public override bool HasReference(Variable variable) + { + return _amount.vector3Ref == variable || base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + + protected override void OnEnable() + { + base.OnEnable(); + + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + amountOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeScale.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeScale.cs.meta new file mode 100644 index 0000000..aec79a0 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShakeScale.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e61780d2ea956492a8f59308dae6f12c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ShowSprite.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShowSprite.cs new file mode 100644 index 0000000..ce4b032 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShowSprite.cs @@ -0,0 +1,96 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Makes a sprite visible / invisible by setting the color alpha. + /// + [CommandInfo("Sprite", + "Show Sprite", + "Makes a sprite visible / invisible by setting the color alpha.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class ShowSprite : Command + { + [Tooltip("Sprite object to be made visible / invisible")] + [SerializeField] protected SpriteRenderer spriteRenderer; + + [Tooltip("Make the sprite visible or invisible")] + [SerializeField] protected BooleanData _visible = new BooleanData(false); + + [Tooltip("Affect the visibility of child sprites")] + [SerializeField] protected bool affectChildren = true; + + protected virtual void SetSpriteAlpha(SpriteRenderer renderer, bool visible) + { + Color spriteColor = renderer.color; + spriteColor.a = visible ? 1f : 0f; + renderer.color = spriteColor; + } + + #region Public members + + public override void OnEnter() + { + if (spriteRenderer != null) + { + if (affectChildren) + { + var spriteRenderers = spriteRenderer.gameObject.GetComponentsInChildren(); + for (int i = 0; i < spriteRenderers.Length; i++) + { + var sr = spriteRenderers[i]; + SetSpriteAlpha(sr, _visible.Value); + } + } + else + { + SetSpriteAlpha(spriteRenderer, _visible.Value); + } + } + + Continue(); + } + + public override string GetSummary() + { + if (spriteRenderer == null) + { + return "Error: No sprite renderer selected"; + } + + return spriteRenderer.name + " to " + (_visible.Value ? "visible" : "invisible"); + } + + public override Color GetButtonColor() + { + return new Color32(221, 184, 169, 255); + } + + public override bool HasReference(Variable variable) + { + return _visible.booleanRef == variable || base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("visible")] public bool visibleOLD; + + protected virtual void OnEnable() + { + if (visibleOLD != default(bool)) + { + _visible.Value = visibleOLD; + visibleOLD = default(bool); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ShowSprite.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShowSprite.cs.meta new file mode 100644 index 0000000..2cf83bf --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ShowSprite.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 10cd462c89cb047158ccfb8a8df3f60a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SpawnObject.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/SpawnObject.cs new file mode 100644 index 0000000..7bff6e2 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SpawnObject.cs @@ -0,0 +1,140 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Spawns a new object based on a reference to a scene or prefab game object. + /// + [CommandInfo("Scripting", + "Spawn Object", + "Spawns a new object based on a reference to a scene or prefab game object.", + Priority = 10)] + [CommandInfo("GameObject", + "Instantiate", + "Instantiate a game object")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class SpawnObject : Command + { + [Tooltip("Game object to copy when spawning. Can be a scene object or a prefab.")] + [SerializeField] protected GameObjectData _sourceObject; + + [Tooltip("Transform to use as parent during instantiate.")] + [SerializeField] protected TransformData _parentTransform; + + [Tooltip("If true, will use the Transfrom of this Flowchart for the position and rotation.")] + [SerializeField] protected BooleanData _spawnAtSelf = new BooleanData(false); + + [Tooltip("Local position of newly spawned object.")] + [SerializeField] protected Vector3Data _spawnPosition; + + [Tooltip("Local rotation of newly spawned object.")] + [SerializeField] protected Vector3Data _spawnRotation; + + + + [Tooltip("Optional variable to store the GameObject that was just created.")] + [SerializeField] + protected GameObjectData _newlySpawnedObject; + + #region Public members + + public override void OnEnter() + { + if (_sourceObject.Value == null) + { + Continue(); + return; + } + + GameObject newObject = null; + + if (_parentTransform.Value != null) + { + newObject = GameObject.Instantiate(_sourceObject.Value,_parentTransform.Value); + } + else + { + newObject = GameObject.Instantiate(_sourceObject.Value); + } + + if (!_spawnAtSelf.Value) + { + newObject.transform.localPosition = _spawnPosition.Value; + newObject.transform.localRotation = Quaternion.Euler(_spawnRotation.Value); + } + else + { + newObject.transform.SetPositionAndRotation(transform.position, transform.rotation); + } + + _newlySpawnedObject.Value = newObject; + + Continue(); + } + + public override string GetSummary() + { + if (_sourceObject.Value == null) + { + return "Error: No source GameObject specified"; + } + + return _sourceObject.Value.name; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (_sourceObject.gameObjectRef == variable || _parentTransform.transformRef == variable || + _spawnAtSelf.booleanRef == variable || _spawnPosition.vector3Ref == variable || + _spawnRotation.vector3Ref == variable) + return true; + + return false; + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("sourceObject")] public GameObject sourceObjectOLD; + [HideInInspector] [FormerlySerializedAs("parentTransform")] public Transform parentTransformOLD; + [HideInInspector] [FormerlySerializedAs("spawnPosition")] public Vector3 spawnPositionOLD; + [HideInInspector] [FormerlySerializedAs("spawnRotation")] public Vector3 spawnRotationOLD; + + protected virtual void OnEnable() + { + if (sourceObjectOLD != null) + { + _sourceObject.Value = sourceObjectOLD; + sourceObjectOLD = null; + } + if (parentTransformOLD != null) + { + _parentTransform.Value = parentTransformOLD; + parentTransformOLD = null; + } + if (spawnPositionOLD != default(Vector3)) + { + _spawnPosition.Value = spawnPositionOLD; + spawnPositionOLD = default(Vector3); + } + if (spawnRotationOLD != default(Vector3)) + { + _spawnRotation.Value = spawnRotationOLD; + spawnRotationOLD = default(Vector3); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/SpawnObject.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/SpawnObject.cs.meta new file mode 100644 index 0000000..51ff33f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/SpawnObject.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bb3e86f556e074b84af1cc7eb8f8e5e7 +timeCreated: 1431443741 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/StartSwipe.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/StartSwipe.cs new file mode 100644 index 0000000..23281cf --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/StartSwipe.cs @@ -0,0 +1,83 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Activates swipe panning mode where the player can pan the camera within the area between viewA & viewB. + /// + [CommandInfo("Camera", + "Start Swipe", + "Activates swipe panning mode where the player can pan the camera within the area between viewA & viewB.")] + [AddComponentMenu("")] + public class StartSwipe : Command + { + [Tooltip("Defines one extreme of the scrollable area that the player can pan around")] + [SerializeField] protected View viewA; + + [Tooltip("Defines one extreme of the scrollable area that the player can pan around")] + [SerializeField] protected View viewB; + + [Tooltip("Time to move the camera to a valid starting position between the two views")] + [SerializeField] protected float duration = 0.5f; + + [Tooltip("Multiplier factor for speed of swipe pan")] + [SerializeField] protected float speedMultiplier = 1f; + + [Tooltip("Camera to use for the pan. Will use main camera if set to none.")] + [SerializeField] protected Camera targetCamera; + + #region Public members + + public virtual void Start() + { + if (targetCamera == null) + { + targetCamera = Camera.main; + } + if (targetCamera == null) + { + targetCamera = GameObject.FindObjectOfType(); + } + } + + public override void OnEnter() + { + if (targetCamera == null || + viewA == null || + viewB == null) + { + Continue(); + return; + } + + var cameraManager = FungusManager.Instance.CameraManager; + + cameraManager.StartSwipePan(targetCamera, viewA, viewB, duration, speedMultiplier, () => Continue() ); + } + + public override string GetSummary() + { + if (viewA == null) + { + return "Error: No view selected for View A"; + } + + if (viewB == null) + { + return "Error: No view selected for View B"; + } + + return viewA.name + " to " + viewB.name; + } + + public override Color GetButtonColor() + { + return new Color32(216, 228, 170, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/StartSwipe.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/StartSwipe.cs.meta new file mode 100644 index 0000000..177a4fe --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/StartSwipe.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 893af7b9a2a87449e9bb197699aa46b5 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Stop.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Stop.cs new file mode 100644 index 0000000..02b6cb1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Stop.cs @@ -0,0 +1,31 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Stop executing the Block that contains this command. + /// + [CommandInfo("Flow", + "Stop", + "Stop executing the Block that contains this command.")] + [AddComponentMenu("")] + public class Stop : Command + { + #region Public members + + public override void OnEnter() + { + StopParentBlock(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Stop.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Stop.cs.meta new file mode 100644 index 0000000..f9b8c8b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Stop.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5f1ca510a57aa47568a5e4ee558ff41f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/StopAmbiance.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopAmbiance.cs new file mode 100644 index 0000000..8aaa4a2 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopAmbiance.cs @@ -0,0 +1,35 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Stops the currently playing game music. + /// + [CommandInfo("Audio", + "Stop Ambiance", + "Stops the currently playing game ambiance.")] + [AddComponentMenu("")] + public class StopAmbiance : Command + { + #region Public members + + public override void OnEnter() + { + var musicManager = FungusManager.Instance.MusicManager; + + musicManager.StopAmbiance(); + + Continue(); + } + + public override Color GetButtonColor() + { + return new Color32(242, 209, 176, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/StopAmbiance.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopAmbiance.cs.meta new file mode 100644 index 0000000..b4e0d21 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopAmbiance.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4bce3bd679be2c94196f3f6aaeb33f0b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/StopBlock.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopBlock.cs new file mode 100644 index 0000000..7cb31a4 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopBlock.cs @@ -0,0 +1,72 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Stops executing the named Block. + /// + [CommandInfo("Flow", + "Stop Block", + "Stops executing the named Block")] + public class StopBlock : Command, IBlockCaller + { + [Tooltip("Flowchart containing the Block. If none is specified, the parent Flowchart is used.")] + [SerializeField] protected Flowchart flowchart; + + [Tooltip("Name of the Block to stop")] + [SerializeField] protected StringData blockName = new StringData(""); + + #region Public members + + public override void OnEnter() + { + if (blockName.Value == "") + { + Continue(); + } + + if (flowchart == null) + { + flowchart = (Flowchart)GetFlowchart(); + } + + var block = flowchart.FindBlock(blockName.Value); + if (block == null || + !block.IsExecuting()) + { + Continue(); + } + + block.Stop(); + + Continue(); + } + + public override string GetSummary() + { + return blockName; + } + + public override Color GetButtonColor() + { + return new Color32(253, 253, 150, 255); + } + + public override bool HasReference(Variable variable) + { + return blockName.stringRef == variable || base.HasReference(variable); + } + + public bool MayCallBlock(Block block) + { + if(flowchart != null) + return block == flowchart.FindBlock(blockName.Value); + return false; + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/StopBlock.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopBlock.cs.meta new file mode 100644 index 0000000..d74fc2d --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopBlock.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0d52ce2dfbc0b4dc4aa04334fc76695e +timeCreated: 1460500129 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/StopFlowchart.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopFlowchart.cs new file mode 100644 index 0000000..d28b71c --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopFlowchart.cs @@ -0,0 +1,64 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using System.Collections.Generic; + +namespace Fungus +{ + /// + /// Stops execution of all Blocks in a Flowchart. + /// + [CommandInfo("Flow", + "Stop Flowchart", + "Stops execution of all Blocks in a Flowchart")] + [AddComponentMenu("")] + public class StopFlowchart : Command + { + [Tooltip("Stop all executing Blocks in the Flowchart that contains this command")] + [SerializeField] protected bool stopParentFlowchart; + + [Tooltip("Stop all executing Blocks in a list of target Flowcharts")] + [SerializeField] protected List targetFlowcharts = new List(); + + #region Public members + + public override void OnEnter() + { + var flowchart = GetFlowchart(); + + for (int i = 0; i < targetFlowcharts.Count; i++) + { + var f = targetFlowcharts[i]; + f.StopAllBlocks(); + } + + //current block and command logic doesn't require it in this order but it makes sense to + // stop everything but yourself first + if (stopParentFlowchart) + { + flowchart.StopAllBlocks(); + } + + //you might not be stopping this flowchart so keep going + Continue(); + } + + public override bool IsReorderableArray(string propertyName) + { + if (propertyName == "targetFlowcharts") + { + return true; + } + + return false; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/StopFlowchart.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopFlowchart.cs.meta new file mode 100644 index 0000000..c528201 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopFlowchart.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ae67a23cb4aa74793b41258ae40bf321 +timeCreated: 1442408419 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/StopMusic.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopMusic.cs new file mode 100644 index 0000000..fea8a83 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopMusic.cs @@ -0,0 +1,35 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Stops the currently playing game music. + /// + [CommandInfo("Audio", + "Stop Music", + "Stops the currently playing game music.")] + [AddComponentMenu("")] + public class StopMusic : Command + { + #region Public members + + public override void OnEnter() + { + var musicManager = FungusManager.Instance.MusicManager; + + musicManager.StopMusic(); + + Continue(); + } + + public override Color GetButtonColor() + { + return new Color32(242, 209, 176, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/StopMusic.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopMusic.cs.meta new file mode 100644 index 0000000..93822f1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopMusic.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b359b09a7ba2e4af981f07c07f8af85a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/StopSwipe.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopSwipe.cs new file mode 100644 index 0000000..0201244 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopSwipe.cs @@ -0,0 +1,35 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Deactivates swipe panning mode. + /// + [CommandInfo("Camera", + "Stop Swipe", + "Deactivates swipe panning mode.")] + [AddComponentMenu("")] + public class StopSwipe : Command + { + #region Public members + + public override void OnEnter() + { + var cameraManager = FungusManager.Instance.CameraManager; + + cameraManager.StopSwipePan(); + + Continue(); + } + + public override Color GetButtonColor() + { + return new Color32(216, 228, 170, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/StopSwipe.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopSwipe.cs.meta new file mode 100644 index 0000000..568fb09 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopSwipe.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3e862766e64934bd1987a5ce891d04fb +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/StopTween.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopTween.cs new file mode 100644 index 0000000..431c2fd --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopTween.cs @@ -0,0 +1,52 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Stops an active iTween by name. + /// + [CommandInfo("iTween", + "Stop Tween", + "Stops an active iTween by name.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class StopTween : Command + { + [Tooltip("Stop and destroy any Tweens in current scene with the supplied name")] + [SerializeField] protected StringData _tweenName; + + #region Public members + + public override void OnEnter() + { + iTween.StopByName(_tweenName.Value); + Continue(); + } + + public override bool HasReference(Variable variable) + { + return _tweenName.stringRef == variable || base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("tweenName")] public string tweenNameOLD = ""; + + protected virtual void OnEnable() + { + if (tweenNameOLD != "") + { + _tweenName.Value = tweenNameOLD; + tweenNameOLD = ""; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/StopTween.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopTween.cs.meta new file mode 100644 index 0000000..f5b44f8 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopTween.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e7026a0b1ea104ec0af471324ee3daea +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/StopTweens.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopTweens.cs new file mode 100644 index 0000000..4615ddc --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopTweens.cs @@ -0,0 +1,27 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Stop all active iTweens in the current scene. + /// + [CommandInfo("iTween", + "Stop Tweens", + "Stop all active iTweens in the current scene.")] + [AddComponentMenu("")] + public class StopTweens : Command + { + #region Public members + + public override void OnEnter() + { + iTween.Stop(); + Continue(); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/StopTweens.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopTweens.cs.meta new file mode 100644 index 0000000..b5321d7 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/StopTweens.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 46af98f4c7e084a5a96eb982e7271174 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ThrowException.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ThrowException.cs new file mode 100644 index 0000000..6d78b8e --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ThrowException.cs @@ -0,0 +1,59 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + [System.Serializable] + public class FungusException : System.Exception + { + public FungusException() + { + } + + public FungusException(string message) : base(message) + { + } + + public FungusException(string message, System.Exception inner) : base(message, inner) + { + } + + protected FungusException( + System.Runtime.Serialization.SerializationInfo info, + System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + } + + /// + /// Throw a Fungus.Exception + /// + [CommandInfo("Scripting", + "Throw Exception", + "Throw a fungus exception")] + [AddComponentMenu("")] + public class ThrowException : Command + { + [SerializeField] + protected StringData message; + + public override void OnEnter() + { + throw new FungusException(GetLocationIdentifier() + " " + message.Value); + +#pragma warning disable CS0162 // Unreachable code detected + Continue(); +#pragma warning restore CS0162 // Unreachable code detected + } + + public override string GetSummary() + { + return message.Value; + } + + public override bool HasReference(Variable variable) + { + return variable == message.stringRef || base.HasReference(variable); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ThrowException.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ThrowException.cs.meta new file mode 100644 index 0000000..4fc1e5a --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ThrowException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8d1a861c2b31cf8488fd9d576d533474 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ToString.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/ToString.cs new file mode 100644 index 0000000..60e6dfa --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ToString.cs @@ -0,0 +1,63 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Stores the result of a ToString on given variable in a string. + /// + [CommandInfo("Variable", + "To String", + "Stores the result of a ToString on given variable in a string.")] + [AddComponentMenu("")] + public class ToString : Command + { + [Tooltip("Target variable to get String of.")] + [VariableProperty()] + [SerializeField] protected Variable variable; + + [Tooltip("Variable to store the result of ToString")] + [VariableProperty(typeof(StringVariable))] + [SerializeField] protected StringVariable outValue; + + //[Tooltip("Optional formatting string given to ToString")] + //[SerializeField] protected StringData format; + + public override void OnEnter() + { + if (variable != null && outValue != null) + { + outValue.Value = variable.ToString(); + } + + Continue(); + } + + public override string GetSummary() + { + if (variable == null) + { + return "Error: Variable not selected"; + } + + if (outValue == null) + { + return "Error: outValue not set"; + } + + return outValue.Key + " = " + variable.Key + ".ToString"; + } + + public override bool HasReference(Variable variable) + { + return (variable == this.variable) || outValue == variable; + } + + public override Color GetButtonColor() + { + return new Color32(253, 253, 150, 255); + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/ToString.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/ToString.cs.meta new file mode 100644 index 0000000..1668c94 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/ToString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e76deb01172e9c64c9f78361b06b85bd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/TweenUI.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/TweenUI.cs new file mode 100644 index 0000000..401f523 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/TweenUI.cs @@ -0,0 +1,142 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using System.Collections.Generic; +using Fungus; + +namespace Fungus +{ + /// + /// Abstract base class for TweenUI commands. + /// + public abstract class TweenUI : Command + { + [Tooltip("List of objects to be affected by the tween")] + [SerializeField] protected List targetObjects = new List(); + + [Tooltip("Type of tween easing to apply")] + [SerializeField] protected LeanTweenType tweenType = LeanTweenType.easeOutQuad; + + [Tooltip("Wait until this command completes before continuing execution")] + [SerializeField] protected BooleanData waitUntilFinished = new BooleanData(true); + + [Tooltip("Time for the tween to complete")] + [SerializeField] protected FloatData duration = new FloatData(1f); + + protected virtual void ApplyTween() + { + for (int i = 0; i < targetObjects.Count; i++) + { + var targetObject = targetObjects[i]; + if (targetObject == null) + { + continue; + } + ApplyTween(targetObject); + } + + if (waitUntilFinished) + { + LeanTween.value(gameObject, 0f, 1f, duration).setOnComplete(OnComplete); + } + } + + protected abstract void ApplyTween(GameObject go); + + protected virtual void OnComplete() + { + Continue(); + } + + protected virtual string GetSummaryValue() + { + return ""; + } + + #region Public members + + public override void OnEnter() + { + if (targetObjects.Count == 0) + { + Continue(); + return; + } + + ApplyTween(); + + if (!waitUntilFinished) + { + Continue(); + } + } + + public override void OnCommandAdded(Block parentBlock) + { + // Add an empty slot by default. Saves an unnecessary user click. + if (targetObjects.Count == 0) + { + targetObjects.Add(null); + } + } + + public override string GetSummary() + { + if (targetObjects.Count == 0) + { + return "Error: No targetObjects selected"; + } + else if (targetObjects.Count == 1) + { + if (targetObjects[0] == null) + { + return "Error: No targetObjects selected"; + } + return targetObjects[0].name + " = " + GetSummaryValue(); + } + + string objectList = ""; + for (int i = 0; i < targetObjects.Count; i++) + { + var go = targetObjects[i]; + if (go == null) + { + continue; + } + if (objectList == "") + { + objectList += go.name; + } + else + { + objectList += ", " + go.name; + } + } + + return objectList + " = " + GetSummaryValue(); + } + + public override Color GetButtonColor() + { + return new Color32(180, 250, 250, 255); + } + + public override bool IsReorderableArray(string propertyName) + { + if (propertyName == "targetObjects") + { + return true; + } + + return false; + } + + public override bool HasReference(Variable variable) + { + return waitUntilFinished.booleanRef == variable || duration.floatRef == variable || base.HasReference(variable); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/TweenUI.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/TweenUI.cs.meta new file mode 100644 index 0000000..a828cc8 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/TweenUI.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c43a65504f4024abaa7581ddfa448f2d +timeCreated: 1444819884 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/VariableCondition.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/VariableCondition.cs new file mode 100644 index 0000000..2c64b20 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/VariableCondition.cs @@ -0,0 +1,338 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System.Collections.Generic; +using System.Text; +using UnityEngine; + +namespace Fungus +{ + /// + /// class for a single condition. A list of this is used for multiple conditions. + /// + [System.Serializable] + public class ConditionExpression + { + [SerializeField] protected CompareOperator compareOperator; + [SerializeField] protected AnyVariableAndDataPair anyVar; + + public virtual AnyVariableAndDataPair AnyVar { get { return anyVar; } } + public virtual CompareOperator CompareOperator { get { return compareOperator; } } + + public ConditionExpression() + { + } + + public ConditionExpression(CompareOperator op, AnyVariableAndDataPair variablePair) + { + compareOperator = op; + anyVar = variablePair; + } + } + + public abstract class VariableCondition : Condition, ISerializationCallbackReceiver + { + public enum AnyOrAll + { + AnyOf_OR,//Use as a chain of ORs + AllOf_AND,//Use as a chain of ANDs + } + + [Tooltip("Selecting AnyOf will result in true if at least one of the conditions is true. Selecting AllOF will result in true only when all the conditions are true.")] + [SerializeField] protected AnyOrAll anyOrAllConditions; + + [SerializeField] protected List conditions = new List(); + + /// + /// Called when the script is loaded or a value is changed in the + /// inspector (Called in the editor only). + /// + public override void OnValidate() + { + base.OnValidate(); + + if (conditions == null) + { + conditions = new List(); + } + + if (conditions.Count == 0) + { + conditions.Add(new ConditionExpression()); + } + } + + protected override bool EvaluateCondition() + { + if (conditions == null || conditions.Count == 0) + { + return false; + } + + bool resultAny = false, resultAll = true; + foreach (ConditionExpression condition in conditions) + { + bool curResult = false; + if (condition.AnyVar == null) + { + resultAll &= curResult; + resultAny |= curResult; + continue; + } + condition.AnyVar.Compare(condition.CompareOperator, ref curResult); + resultAll &= curResult; + resultAny |= curResult; + } + + if (anyOrAllConditions == AnyOrAll.AnyOf_OR) return resultAny; + + return resultAll; + } + + protected override bool HasNeededProperties() + { + if (conditions == null || conditions.Count == 0) + { + return false; + } + + foreach (ConditionExpression condition in conditions) + { + if (condition.AnyVar == null || condition.AnyVar.variable == null) + { + return false; + } + } + return true; + } + + public override string GetSummary() + { + if (!this.HasNeededProperties()) + { + return "Error: No variable selected"; + } + + string connector = ""; + if (anyOrAllConditions == AnyOrAll.AnyOf_OR) + { + connector = " OR "; + } + else + { + connector = " AND "; + } + + StringBuilder summary = new StringBuilder(""); + for (int i = 0; i < conditions.Count; i++) + { + summary.Append(conditions[i].AnyVar.variable.Key + " " + + VariableUtil.GetCompareOperatorDescription(conditions[i].CompareOperator) + " " + + conditions[i].AnyVar.GetDataDescription()); + + if (i < conditions.Count - 1) + { + summary.Append(connector); + } + } + return summary.ToString(); + } + + public override bool HasReference(Variable variable) + { + return anyVar.HasReference(variable); + } + + + + #region Editor caches +#if UNITY_EDITOR + protected override void RefreshVariableCache() + { + base.RefreshVariableCache(); + + if (conditions != null) + { + foreach (var item in conditions) + { + item.AnyVar.RefreshVariableCacheHelper(GetFlowchart(), ref referencedVariables); + } + } + } +#endif + #endregion Editor caches + + #region backwards compat + + [HideInInspector] + [SerializeField] protected CompareOperator compareOperator; + + [HideInInspector] + [SerializeField] protected AnyVariableAndDataPair anyVar; + + [Tooltip("Variable to use in expression")] + [VariableProperty(AllVariableTypes.VariableAny.Any)] + [SerializeField] protected Variable variable; + + [Tooltip("Boolean value to compare against")] + [SerializeField] protected BooleanData booleanData; + + [Tooltip("Integer value to compare against")] + [SerializeField] protected IntegerData integerData; + + [Tooltip("Float value to compare against")] + [SerializeField] protected FloatData floatData; + + [Tooltip("String value to compare against")] + [SerializeField] protected StringDataMulti stringData; + + [Tooltip("Animator value to compare against")] + [SerializeField] protected AnimatorData animatorData; + + [Tooltip("AudioSource value to compare against")] + [SerializeField] protected AudioSourceData audioSourceData; + + [Tooltip("Color value to compare against")] + [SerializeField] protected ColorData colorData; + + [Tooltip("GameObject value to compare against")] + [SerializeField] protected GameObjectData gameObjectData; + + [Tooltip("Material value to compare against")] + [SerializeField] protected MaterialData materialData; + + [Tooltip("Object value to compare against")] + [SerializeField] protected ObjectData objectData; + + [Tooltip("Rigidbody2D value to compare against")] + [SerializeField] protected Rigidbody2DData rigidbody2DData; + + [Tooltip("Sprite value to compare against")] + [SerializeField] protected SpriteData spriteData; + + [Tooltip("Texture value to compare against")] + [SerializeField] protected TextureData textureData; + + [Tooltip("Transform value to compare against")] + [SerializeField] protected TransformData transformData; + + [Tooltip("Vector2 value to compare against")] + [SerializeField] protected Vector2Data vector2Data; + + [Tooltip("Vector3 value to compare against")] + [SerializeField] protected Vector3Data vector3Data; + + void ISerializationCallbackReceiver.OnBeforeSerialize() + { + } + + void ISerializationCallbackReceiver.OnAfterDeserialize() + { + if (variable != null) + { + anyVar.variable = variable; + + if (variable.GetType() == typeof(BooleanVariable) && !booleanData.Equals(new BooleanData())) + { + anyVar.data.booleanData = booleanData; + booleanData = new BooleanData(); + } + else if (variable.GetType() == typeof(IntegerVariable) && !integerData.Equals(new IntegerData())) + { + anyVar.data.integerData = integerData; + integerData = new IntegerData(); + } + else if (variable.GetType() == typeof(FloatVariable) && !floatData.Equals(new FloatData())) + { + anyVar.data.floatData = floatData; + floatData = new FloatData(); + } + else if (variable.GetType() == typeof(StringVariable) && !stringData.Equals(new StringDataMulti())) + { + anyVar.data.stringData.stringRef = stringData.stringRef; + anyVar.data.stringData.stringVal = stringData.stringVal; + stringData = new StringDataMulti(); + } + else if (variable.GetType() == typeof(AnimatorVariable) && !animatorData.Equals(new AnimatorData())) + { + anyVar.data.animatorData = animatorData; + animatorData = new AnimatorData(); + } + else if (variable.GetType() == typeof(AudioSourceVariable) && !audioSourceData.Equals(new AudioSourceData())) + { + anyVar.data.audioSourceData = audioSourceData; + audioSourceData = new AudioSourceData(); + } + else if (variable.GetType() == typeof(ColorVariable) && !colorData.Equals(new ColorData())) + { + anyVar.data.colorData = colorData; + colorData = new ColorData(); + } + else if (variable.GetType() == typeof(GameObjectVariable) && !gameObjectData.Equals(new GameObjectData())) + { + anyVar.data.gameObjectData = gameObjectData; + gameObjectData = new GameObjectData(); + } + else if (variable.GetType() == typeof(MaterialVariable) && !materialData.Equals(new MaterialData())) + { + anyVar.data.materialData = materialData; + materialData = new MaterialData(); + } + else if (variable.GetType() == typeof(ObjectVariable) && !objectData.Equals(new ObjectData())) + { + anyVar.data.objectData = objectData; + objectData = new ObjectData(); + } + else if (variable.GetType() == typeof(Rigidbody2DVariable) && !rigidbody2DData.Equals(new Rigidbody2DData())) + { + anyVar.data.rigidbody2DData = rigidbody2DData; + rigidbody2DData = new Rigidbody2DData(); + } + else if (variable.GetType() == typeof(SpriteVariable) && !spriteData.Equals(new SpriteData())) + { + anyVar.data.spriteData = spriteData; + spriteData = new SpriteData(); + } + else if (variable.GetType() == typeof(TextureVariable) && !textureData.Equals(new TextureData())) + { + anyVar.data.textureData = textureData; + textureData = new TextureData(); + } + else if (variable.GetType() == typeof(TransformVariable) && !transformData.Equals(new TransformData())) + { + anyVar.data.transformData = transformData; + transformData = new TransformData(); + } + else if (variable.GetType() == typeof(Vector2Variable) && !vector2Data.Equals(new Vector2Data())) + { + anyVar.data.vector2Data = vector2Data; + vector2Data = new Vector2Data(); + } + else if (variable.GetType() == typeof(Vector3Variable) && !vector3Data.Equals(new Vector3Data())) + { + anyVar.data.vector3Data = vector3Data; + vector3Data = new Vector3Data(); + } + + //moved to new anyvar storage, clear legacy. + variable = null; + } + + // just checking for anyVar != null fails here. is any var being reintilaized somewhere? + + if (anyVar != null && anyVar.variable != null) + { + ConditionExpression c = new ConditionExpression(compareOperator, anyVar); + if (!conditions.Contains(c)) + { + conditions.Add(c); + } + + anyVar = null; + variable = null; + } + } + + #endregion backwards compat + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/VariableCondition.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/VariableCondition.cs.meta new file mode 100644 index 0000000..6277678 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/VariableCondition.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b065f7dff8779442ab5841ccc6ae375b +timeCreated: 1493077787 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3.meta new file mode 100644 index 0000000..70aff79 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9c57d4347eae5354b8bcf942c2b3468a +folderAsset: yes +timeCreated: 1503030603 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Arithmetic.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Arithmetic.cs new file mode 100644 index 0000000..748002b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Arithmetic.cs @@ -0,0 +1,85 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Fungus +{ + /// + /// Vector3 add, sub, mul, div arithmetic + /// + [CommandInfo("Vector3", + "Arithmetic", + "Vector3 add, sub, mul, div arithmetic")] + [AddComponentMenu("")] + public class Vector3Arithmetic : Command + { + [SerializeField] + protected Vector3Data lhs, rhs, output; + + public enum Operation + { + Add, + Sub, + Mul, + Div + } + + [SerializeField] + protected Operation operation = Operation.Add; + + public override void OnEnter() + { + Vector3 tmp; + switch (operation) + { + case Operation.Add: + output.Value = lhs.Value + rhs.Value; + break; + case Operation.Sub: + output.Value = lhs.Value - rhs.Value; + break; + case Operation.Mul: + tmp = lhs.Value; + tmp.Scale(rhs.Value); + output.Value = tmp; + break; + case Operation.Div: + tmp = lhs.Value; + tmp.Scale(new Vector3(1.0f / rhs.Value.x, + 1.0f / rhs.Value.y, + 1.0f / rhs.Value.z)); + output.Value = tmp; + break; + default: + break; + } + Continue(); + } + + public override string GetSummary() + { + if (output.vector3Ref == null) + { + return "Error: no output set"; + } + + return operation.ToString() + ": stored in " + output.vector3Ref.Key; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (lhs.vector3Ref == variable || rhs.vector3Ref == variable || output.vector3Ref == variable) + return true; + + return false; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Arithmetic.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Arithmetic.cs.meta new file mode 100644 index 0000000..c9a97be --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Arithmetic.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: dfc8e8d5ce363ec43815496d321b4d55 +timeCreated: 1503313996 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Fields.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Fields.cs new file mode 100644 index 0000000..31db3c9 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Fields.cs @@ -0,0 +1,77 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Fungus +{ + // + /// Get or Set the x,y,z fields of a vector3 via floatvars + /// + [CommandInfo("Vector3", + "Fields", + "Get or Set the x,y,z fields of a vector3 via floatvars")] + [AddComponentMenu("")] + public class Vector3Fields : Command + { + public enum GetSet + { + Get, + Set, + } + public GetSet getOrSet = GetSet.Get; + + [SerializeField] + protected Vector3Data vec3; + + [SerializeField] + protected FloatData x, y, z; + + public override void OnEnter() + { + switch (getOrSet) + { + case GetSet.Get: + + var v = vec3.Value; + + x.Value = v.x; + y.Value = v.y; + z.Value = v.z; + break; + case GetSet.Set: + vec3.Value = new Vector3(x.Value, y.Value, z.Value); + break; + default: + break; + } + + Continue(); + } + + public override string GetSummary() + { + if (vec3.vector3Ref == null) + { + return "Error: vec3 not set"; + } + + return getOrSet.ToString() + " (" + vec3.vector3Ref.Key + ")"; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (vec3.vector3Ref == variable || x.floatRef == variable || y.floatRef == variable || z.floatRef == variable) + return true; + + return false; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Fields.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Fields.cs.meta new file mode 100644 index 0000000..84af4e7 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Fields.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 96fb07b07bec30544a6c3c01df5345ee +timeCreated: 1504933522 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Normalise.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Normalise.cs new file mode 100644 index 0000000..344c3cc --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Normalise.cs @@ -0,0 +1,50 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Fungus +{ + // + /// Normalise a vector3, output can be the same as the input + /// + [CommandInfo("Vector3", + "Normalise", + "Normalise a Vector3")] + [AddComponentMenu("")] + public class Vector3Normalise : Command + { + [SerializeField] + protected Vector3Data vec3In, vec3Out; + + public override void OnEnter() + { + vec3Out.Value = vec3In.Value.normalized; + + Continue(); + } + + public override string GetSummary() + { + if (vec3Out.vector3Ref == null) + return ""; + else + return vec3Out.vector3Ref.Key; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + if (vec3In.vector3Ref == variable || vec3Out.vector3Ref == variable) + return true; + + return false; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Normalise.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Normalise.cs.meta new file mode 100644 index 0000000..3088262 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3Normalise.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b9c975313c082cd43a310bfd62ebb893 +timeCreated: 1504171804 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3ToVector2.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3ToVector2.cs new file mode 100644 index 0000000..e29a769 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3ToVector2.cs @@ -0,0 +1,57 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Fungus +{ + // + /// Convert fungus vec3 to vec2 + /// + [CommandInfo("Vector3", + "ToVector2", + "Convert Fungus Vector3 to Fungus Vector2")] + [AddComponentMenu("")] + public class Vector3ToVector2 : Command + { + [SerializeField] + protected Vector3Data vec3; + + + [SerializeField] + protected Vector2Data vec2; + + public override void OnEnter() + { + vec2.Value = vec3.Value; + + Continue(); + } + + public override string GetSummary() + { + if (vec3.vector3Ref != null && vec2.vector2Ref != null) + { + return "Converting " + vec3.vector3Ref.Key + " to " + vec2.vector2Ref.Key; + } + + return "Error: variables not set"; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + + public override bool HasReference(Variable variable) + { + if (variable == vec3.vector3Ref || variable == vec2.vector2Ref) + return true; + + return false; + } + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3ToVector2.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3ToVector2.cs.meta new file mode 100644 index 0000000..2f6ea5f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Vector3/Vector3ToVector2.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d3b374d347ec80647b7c01956f291a84 +timeCreated: 1504171432 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Wait.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Wait.cs new file mode 100644 index 0000000..a1d1553 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Wait.cs @@ -0,0 +1,66 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Waits for period of time before executing the next command in the block. + /// + [CommandInfo("Flow", + "Wait", + "Waits for period of time before executing the next command in the block.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class Wait : Command + { + [Tooltip("Duration to wait for")] + [SerializeField] protected FloatData _duration = new FloatData(1); + + protected virtual void OnWaitComplete() + { + Continue(); + } + + #region Public members + + public override void OnEnter() + { + Invoke ("OnWaitComplete", _duration.Value); + } + + public override string GetSummary() + { + return _duration.Value.ToString() + " seconds"; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + return _duration.floatRef == variable || base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; + + protected virtual void OnEnable() + { + if (durationOLD != default(float)) + { + _duration.Value = durationOLD; + durationOLD = default(float); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Wait.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Wait.cs.meta new file mode 100644 index 0000000..891ee20 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Wait.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3315ad2ebb85443909a1203d56d9344e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/WaitFrames.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/WaitFrames.cs new file mode 100644 index 0000000..2a01089 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/WaitFrames.cs @@ -0,0 +1,59 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace Fungus +{ + /// + /// Waits for a number of frames before executing the next command in the block. + /// + [CommandInfo("Flow", + "Wait Frames", + "Waits for a number of frames before executing the next command in the block.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class WaitFrames : Command + { + [Tooltip("Number of frames to wait for")] + [SerializeField] protected IntegerData frameCount = new IntegerData(1); + + protected virtual IEnumerator WaitForFrames() + { + int count = frameCount.Value; + while (count > 0) + { + yield return new WaitForEndOfFrame(); + count--; + } + + Continue(); + } + + #region Public members + + public override void OnEnter() + { + StartCoroutine(WaitForFrames()); + } + + public override string GetSummary() + { + return frameCount.Value.ToString() + " frames"; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override bool HasReference(Variable variable) + { + return frameCount.integerRef == variable || base.HasReference(variable); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/WaitFrames.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/WaitFrames.cs.meta new file mode 100644 index 0000000..fdfd318 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/WaitFrames.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: de9232e9295ed476a8cfb707b5c242b9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/While.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/While.cs new file mode 100644 index 0000000..6f9c613 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/While.cs @@ -0,0 +1,23 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Continuously loop through a block of commands while the condition is true. Use the Break command to force the loop to terminate immediately. + /// + [CommandInfo("Flow", + "While", + "Continuously loop through a block of commands while the condition is true. Use the Break command to force the loop to terminate immediately.")] + [AddComponentMenu("")] + public class While : If + { + #region Public members + + public override bool IsLooping { get { return true; } } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/While.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/While.cs.meta new file mode 100644 index 0000000..4ef44e4 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/While.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 663c8a7831a104d16ad7078a4dc2bd10 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Write.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/Write.cs new file mode 100644 index 0000000..afd483f --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Write.cs @@ -0,0 +1,165 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Text coloring mode for Write command. + /// + public enum TextColor + { + /// Don't change the text color. + Default, + /// Set the text alpha to 1. + SetVisible, + /// Set the text alpha to a value. + SetAlpha, + /// Set the text color to a value. + SetColor + } + + /// + /// Writes content to a UI Text or Text Mesh object. + /// + [CommandInfo("UI", + "Write", + "Writes content to a UI Text or Text Mesh object.")] + [AddComponentMenu("")] + public class Write : Command, ILocalizable + { + [Tooltip("Text object to set text on. Text, Input Field and Text Mesh objects are supported.")] + [SerializeField] protected GameObject textObject; + + [Tooltip("String value to assign to the text object")] + [SerializeField] protected StringDataMulti text; + + [Tooltip("Notes about this story text for other authors, localization, etc.")] + [SerializeField] protected string description; + + [Tooltip("Clear existing text before writing new text")] + [SerializeField] protected bool clearText = true; + + [Tooltip("Wait until this command finishes before executing the next command")] + [SerializeField] protected bool waitUntilFinished = true; + + [Tooltip("Color mode to apply to the text.")] + [SerializeField] protected TextColor textColor = TextColor.Default; + + [Tooltip("Alpha to apply to the text.")] + [SerializeField] protected FloatData setAlpha = new FloatData(1f); + + [Tooltip("Color to apply to the text.")] + [SerializeField] protected ColorData setColor = new ColorData(Color.white); + + protected Writer GetWriter() + { + var writer = textObject.GetComponent(); + if (writer == null) + { + writer = textObject.AddComponent(); + } + + return writer; + } + + #region Public members + + public override void OnEnter() + { + if (textObject == null) + { + Continue(); + return; + } + + var writer = GetWriter(); + if (writer == null) + { + Continue(); + return; + } + + switch (textColor) + { + case TextColor.SetAlpha: + writer.SetTextAlpha(setAlpha); + break; + case TextColor.SetColor: + writer.SetTextColor(setColor); + break; + case TextColor.SetVisible: + writer.SetTextAlpha(1f); + break; + } + + var flowchart = GetFlowchart(); + string newText = flowchart.SubstituteVariables(text.Value); + + if (!waitUntilFinished) + { + StartCoroutine(writer.Write(newText, clearText, false, true, false, null, null)); + Continue(); + } + else + { + StartCoroutine(writer.Write(newText, clearText, false, true, false, null, + () => { Continue (); } + )); + } + } + + public override string GetSummary() + { + if (textObject != null) + { + return textObject.name + " : " + text.Value; + } + + return "Error: No text object selected"; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override void OnStopExecuting() + { + GetWriter().Stop(); + } + + #endregion + + #region ILocalizable implementation + + public virtual string GetStandardText() + { + return text; + } + + public virtual void SetStandardText(string standardText) + { + text.Value = standardText; + } + + public virtual string GetDescription() + { + return description; + } + + public virtual string GetStringId() + { + // String id for Write commands is WRITE.. + return "WRITE." + GetFlowchartLocalizationId() + "." + itemId; + } + + public override bool HasReference(Variable variable) + { + return text.stringRef == variable || setAlpha.floatRef == variable || setColor.colorRef == variable || base.HasReference(variable); + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/Write.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/Write.cs.meta new file mode 100644 index 0000000..5a76fd5 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/Write.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ad2261dbe44de43a980e6f7c77c88f7f +timeCreated: 1437682443 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/iTweenCommand.cs b/Fungus Basics/Assets/Fungus/Scripts/Commands/iTweenCommand.cs new file mode 100644 index 0000000..00b34af --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/iTweenCommand.cs @@ -0,0 +1,148 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; + +namespace Fungus +{ + /// + /// Axis to apply the tween on. + /// + public enum iTweenAxis + { + /// Don't specify an axis. + None, + /// Apply the tween on the X axis only. + X, + /// Apply the tween on the Y axis only. + Y, + /// Apply the tween on the Z axis only. + Z + } + + /// + /// Abstract base class for iTween commands. + /// + [ExecuteInEditMode] + public abstract class iTweenCommand : Command + { + [Tooltip("Target game object to apply the Tween to")] + [SerializeField] protected GameObjectData _targetObject; + + [Tooltip("An individual name useful for stopping iTweens by name")] + [SerializeField] protected StringData _tweenName; + + [Tooltip("The time in seconds the animation will take to complete")] + [SerializeField] protected FloatData _duration = new FloatData(1f); + + [Tooltip("The shape of the easing curve applied to the animation")] + [SerializeField] protected iTween.EaseType easeType = iTween.EaseType.easeInOutQuad; + + [Tooltip("The type of loop to apply once the animation has completed")] + [SerializeField] protected iTween.LoopType loopType = iTween.LoopType.none; + + [Tooltip("Stop any previously added iTweens on this object before adding this iTween")] + [SerializeField] protected bool stopPreviousTweens = false; + + [Tooltip("Wait until the tween has finished before executing the next command")] + [SerializeField] protected bool waitUntilFinished = true; + + protected virtual void OniTweenComplete(object param) + { + Command command = param as Command; + if (command != null && command.Equals(this)) + { + if (waitUntilFinished) + { + Continue(); + } + } + } + + #region Public members + + public override void OnEnter() + { + if (_targetObject.Value == null) + { + Continue(); + return; + } + + if (stopPreviousTweens) + { + // Force any existing iTweens on this target object to complete immediately + var tweens = _targetObject.Value.GetComponents(); + for (int i = 0; i < tweens.Length; i++) + { + var tween = tweens[i]; + tween.time = 0; + tween.SendMessage("Update"); + } + } + + DoTween(); + + if (!waitUntilFinished) + { + Continue(); + } + } + + public virtual void DoTween() + {} + + public override string GetSummary() + { + if (_targetObject.Value == null) + { + return "Error: No target object selected"; + } + + return _targetObject.Value.name + " over " + _duration.Value + " seconds"; + } + + public override Color GetButtonColor() + { + return new Color32(233, 163, 180, 255); + } + + public override bool HasReference(Variable variable) + { + return _targetObject.gameObjectRef == variable || _tweenName.stringRef == variable || + base.HasReference(variable); + } + + #endregion + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("target")] [FormerlySerializedAs("targetObject")] public GameObject targetObjectOLD; + [HideInInspector] [FormerlySerializedAs("tweenName")] public string tweenNameOLD = ""; + [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; + + protected virtual void OnEnable() + { + if (targetObjectOLD != null) + { + _targetObject.Value = targetObjectOLD; + targetObjectOLD = null; + } + + if (tweenNameOLD != "") + { + _tweenName.Value = tweenNameOLD; + tweenNameOLD = ""; + } + + if (durationOLD != default(float)) + { + _duration.Value = durationOLD; + durationOLD = default(float); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Commands/iTweenCommand.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Commands/iTweenCommand.cs.meta new file mode 100644 index 0000000..941a734 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Commands/iTweenCommand.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f7826996074154feba94755721eaa9d4 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components.meta b/Fungus Basics/Assets/Fungus/Scripts/Components.meta new file mode 100644 index 0000000..1458923 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: cd598e3b678e74763876d546c8b0fd9f +folderAsset: yes +timeCreated: 1473770363 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/Block.cs b/Fungus Basics/Assets/Fungus/Scripts/Components/Block.cs new file mode 100644 index 0000000..1be1f33 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/Block.cs @@ -0,0 +1,497 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Fungus +{ + /// + /// Execution state of a Block. + /// + public enum ExecutionState + { + /// No command executing + Idle, + /// Executing a command + Executing, + } + + /// + /// A container for a sequence of Fungus comands. + /// + [ExecuteInEditMode] + [RequireComponent(typeof(Flowchart))] + [AddComponentMenu("")] + public class Block : Node + { + [SerializeField] protected int itemId = -1; // Invalid flowchart item id + + [FormerlySerializedAs("sequenceName")] + [Tooltip("The name of the block node as displayed in the Flowchart window")] + [SerializeField] protected string blockName = "New Block"; + + [TextArea(2, 5)] + [Tooltip("Description text to display under the block node")] + [SerializeField] protected string description = ""; + + [Tooltip("An optional Event Handler which can execute the block when an event occurs")] + [SerializeField] protected EventHandler eventHandler; + + [SerializeField] protected List commandList = new List(); + + protected ExecutionState executionState; + + protected Command activeCommand; + + protected Action lastOnCompleteAction; + + /// + // Index of last command executed before the current one. + // -1 indicates no previous command. + /// + protected int previousActiveCommandIndex = -1; + + public int PreviousActiveCommandIndex { get { return previousActiveCommandIndex; } } + + protected int jumpToCommandIndex = -1; + + protected int executionCount; + + protected bool executionInfoSet = false; + + /// + /// If set, flowchart will not auto select when it is next executed, used by eventhandlers. + /// Only effects the editor. + /// + public bool SuppressNextAutoSelection { get; set; } + + [SerializeField] bool suppressAllAutoSelections = false; + + + protected virtual void Awake() + { + SetExecutionInfo(); + } + + /// + /// Populate the command metadata used to control execution. + /// + protected virtual void SetExecutionInfo() + { + // Give each child command a reference back to its parent block + // and tell each command its index in the list. + int index = 0; + for (int i = 0; i < commandList.Count; i++) + { + var command = commandList[i]; + if (command == null) + { + continue; + } + command.ParentBlock = this; + command.CommandIndex = index++; + } + + // Ensure all commands are at their correct indent level + // This should have already happened in the editor, but may be necessary + // if commands are added to the Block at runtime. + UpdateIndentLevels(); + + executionInfoSet = true; + } + +#if UNITY_EDITOR + // The user can modify the command list order while playing in the editor, + // so we keep the command indices updated every frame. There's no need to + // do this in player builds so we compile this bit out for those builds. + protected virtual void Update() + { + int index = 0; + for (int i = 0; i < commandList.Count; i++) + { + var command = commandList[i]; + if (command == null)// Null entry will be deleted automatically later + + { + continue; + } + command.CommandIndex = index++; + } + } + +#endif + //editor only state for speeding up flowchart window drawing + public bool IsSelected { get; set; } //local cache of selectedness + public enum FilteredState { Full, Partial, None} + public FilteredState FilterState { get; set; } //local cache of filteredness + public bool IsControlSelected { get; set; } //local cache of being part of the control exclusion group + + #region Public members + + /// + /// The execution state of the Block. + /// + public virtual ExecutionState State { get { return executionState; } } + + /// + /// Unique identifier for the Block. + /// + public virtual int ItemId { get { return itemId; } set { itemId = value; } } + + /// + /// The name of the block node as displayed in the Flowchart window. + /// + public virtual string BlockName { get { return blockName; } set { blockName = value; } } + + /// + /// Description text to display under the block node + /// + public virtual string Description { get { return description; } } + + /// + /// An optional Event Handler which can execute the block when an event occurs. + /// Note: Using the concrete class instead of the interface here because of weird editor behaviour. + /// + public virtual EventHandler _EventHandler { get { return eventHandler; } set { eventHandler = value; } } + + /// + /// The currently executing command. + /// + public virtual Command ActiveCommand { get { return activeCommand; } } + + /// + /// Timer for fading Block execution icon. + /// + public virtual float ExecutingIconTimer { get; set; } + + /// + /// The list of commands in the sequence. + /// + public virtual List CommandList { get { return commandList; } } + + /// + /// Controls the next command to execute in the block execution coroutine. + /// + public virtual int JumpToCommandIndex { set { jumpToCommandIndex = value; } } + + /// + /// Returns the parent Flowchart for this Block. + /// + public virtual Flowchart GetFlowchart() + { + return GetComponent(); + } + + /// + /// Returns true if the Block is executing a command. + /// + public virtual bool IsExecuting() + { + return (executionState == ExecutionState.Executing); + } + + /// + /// Returns the number of times this Block has executed. + /// + public virtual int GetExecutionCount() + { + return executionCount; + } + + /// + /// Start a coroutine which executes all commands in the Block. Only one running instance of each Block is permitted. + /// + public virtual void StartExecution() + { + StartCoroutine(Execute()); + } + + /// + /// A coroutine method that executes all commands in the Block. Only one running instance of each Block is permitted. + /// + /// Index of command to start execution at + /// Delegate function to call when execution completes + public virtual IEnumerator Execute(int commandIndex = 0, Action onComplete = null) + { + if (executionState != ExecutionState.Idle) + { + Debug.LogWarning(BlockName + " cannot be executed, it is already running."); + yield break; + } + + lastOnCompleteAction = onComplete; + + if (!executionInfoSet) + { + SetExecutionInfo(); + } + + executionCount++; + var executionCountAtStart = executionCount; + + var flowchart = GetFlowchart(); + executionState = ExecutionState.Executing; + BlockSignals.DoBlockStart(this); + + bool suppressSelectionChanges = false; + + #if UNITY_EDITOR + // Select the executing block & the first command + if (suppressAllAutoSelections || SuppressNextAutoSelection) + { + SuppressNextAutoSelection = false; + suppressSelectionChanges = true; + } + else + { + flowchart.SelectedBlock = this; + if (commandList.Count > 0) + { + flowchart.ClearSelectedCommands(); + flowchart.AddSelectedCommand(commandList[0]); + } + } + #endif + + jumpToCommandIndex = commandIndex; + + int i = 0; + while (true) + { + // Executing commands specify the next command to skip to by setting jumpToCommandIndex using Command.Continue() + if (jumpToCommandIndex > -1) + { + i = jumpToCommandIndex; + jumpToCommandIndex = -1; + } + + // Skip disabled commands, comments and labels + while (i < commandList.Count && + (!commandList[i].enabled || + commandList[i].GetType() == typeof(Comment) || + commandList[i].GetType() == typeof(Label))) + { + i = commandList[i].CommandIndex + 1; + } + + if (i >= commandList.Count) + { + break; + } + + // The previous active command is needed for if / else / else if commands + if (activeCommand == null) + { + previousActiveCommandIndex = -1; + } + else + { + previousActiveCommandIndex = activeCommand.CommandIndex; + } + + var command = commandList[i]; + activeCommand = command; + + if (flowchart.IsActive() && !suppressSelectionChanges) + { + // Auto select a command in some situations + if ((flowchart.SelectedCommands.Count == 0 && i == 0) || + (flowchart.SelectedCommands.Count == 1 && flowchart.SelectedCommands[0].CommandIndex == previousActiveCommandIndex)) + { + flowchart.ClearSelectedCommands(); + flowchart.AddSelectedCommand(commandList[i]); + } + } + + command.IsExecuting = true; + // This icon timer is managed by the FlowchartWindow class, but we also need to + // set it here in case a command starts and finishes execution before the next window update. + command.ExecutingIconTimer = Time.realtimeSinceStartup + FungusConstants.ExecutingIconFadeTime; + BlockSignals.DoCommandExecute(this, command, i, commandList.Count); + +#if UNITY_EDITOR + try + { + command.Execute(); + } + catch (Exception) + { + Debug.LogError("Rethrowing Exception thrown by:" + command.GetLocationIdentifier()); + throw; + } +#else + command.Execute(); +#endif + + // Wait until the executing command sets another command to jump to via Command.Continue() + while (jumpToCommandIndex == -1) + { + yield return null; + } + + #if UNITY_EDITOR + if (flowchart.StepPause > 0f) + { + yield return new WaitForSeconds(flowchart.StepPause); + } + #endif + + command.IsExecuting = false; + } + + if(State == ExecutionState.Executing && + //ensure we aren't dangling from a previous stopage and stopping a future run + executionCountAtStart == executionCount) + { + ReturnToIdle(); + } + } + + private void ReturnToIdle() + { + executionState = ExecutionState.Idle; + activeCommand = null; + BlockSignals.DoBlockEnd(this); + + if (lastOnCompleteAction != null) + { + lastOnCompleteAction(); + } + lastOnCompleteAction = null; + } + + /// + /// Stop executing commands in this Block. + /// + public virtual void Stop() + { + // Tell the executing command to stop immediately + if (activeCommand != null) + { + activeCommand.IsExecuting = false; + activeCommand.OnStopExecuting(); + } + + // This will cause the execution loop to break on the next iteration + jumpToCommandIndex = int.MaxValue; + + //force idle here so other commands that rely on block not executing are informed this frame rather than next + ReturnToIdle(); + } + + /// + /// Returns a list of all Blocks connected to this one. + /// + public virtual List GetConnectedBlocks() + { + var connectedBlocks = new List(); + GetConnectedBlocks(ref connectedBlocks); + return connectedBlocks; + } + + public virtual void GetConnectedBlocks(ref List connectedBlocks) + { + for (int i = 0; i < commandList.Count; i++) + { + var command = commandList[i]; + if (command != null) + { + command.GetConnectedBlocks(ref connectedBlocks); + } + } + } + + /// + /// Returns the type of the previously executing command. + /// + /// The previous active command type. + public virtual System.Type GetPreviousActiveCommandType() + { + if (previousActiveCommandIndex >= 0 && + previousActiveCommandIndex < commandList.Count) + { + return commandList[previousActiveCommandIndex].GetType(); + } + + return null; + } + + public virtual int GetPreviousActiveCommandIndent() + { + if (previousActiveCommandIndex >= 0 && + previousActiveCommandIndex < commandList.Count) + { + return commandList[previousActiveCommandIndex].IndentLevel; + } + + return -1; + } + + public virtual Command GetPreviousActiveCommand() + { + if (previousActiveCommandIndex >= 0 && + previousActiveCommandIndex < commandList.Count) + { + return commandList[previousActiveCommandIndex]; + } + + return null; + } + + /// + /// Recalculate the indent levels for all commands in the list. + /// + public virtual void UpdateIndentLevels() + { + int indentLevel = 0; + for (int i = 0; i < commandList.Count; i++) + { + var command = commandList[i]; + if (command == null) + { + continue; + } + if (command.CloseBlock()) + { + indentLevel--; + } + // Negative indent level is not permitted + indentLevel = Math.Max(indentLevel, 0); + command.IndentLevel = indentLevel; + if (command.OpenBlock()) + { + indentLevel++; + } + } + } + + /// + /// Returns the index of the Label command with matching key, or -1 if not found. + /// + public virtual int GetLabelIndex(string labelKey) + { + if (labelKey.Length == 0) + { + return -1; + } + + for (int i = 0; i < commandList.Count; i++) + { + var command = commandList[i]; + var labelCommand = command as Label; + if (labelCommand != null && String.Compare(labelCommand.Key, labelKey, true) == 0) + { + return i; + } + } + + return -1; + } + + #endregion + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/Block.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Components/Block.cs.meta new file mode 100644 index 0000000..96e1216 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/Block.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3d3d73aef2cfc4f51abf34ac00241f60 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/CameraManager.cs b/Fungus Basics/Assets/Fungus/Scripts/Components/CameraManager.cs new file mode 100644 index 0000000..b973ba1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/CameraManager.cs @@ -0,0 +1,427 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using System; +using System.Collections; +using System.Collections.Generic; +using Fungus; + +namespace Fungus +{ + /// + /// Manager for main camera. Supports several types of camera transition including snap, pan & fade. + /// + public class CameraManager : MonoBehaviour + { + [Tooltip("Full screen texture used for screen fade effect.")] + [SerializeField] protected Texture2D screenFadeTexture; + + [Tooltip("Icon to display when swipe pan mode is active.")] + [SerializeField] protected Texture2D swipePanIcon; + + [Tooltip("Position of continue and swipe icons in normalized screen space coords. (0,0) = top left, (1,1) = bottom right")] + [SerializeField] protected Vector2 swipeIconPosition = new Vector2(1,0); + + [Tooltip("Set the camera z coordinate to a fixed value every frame.")] + [SerializeField] protected bool setCameraZ = true; + + [Tooltip("Fixed Z coordinate of main camera.")] + [SerializeField] protected float cameraZ = -10f; + + [Tooltip("Camera to use when in swipe mode")] + [SerializeField] protected Camera swipeCamera; + + protected float fadeAlpha = 0f; + + // Swipe panning control + protected bool swipePanActive; + + protected float swipeSpeedMultiplier = 1f; + protected View swipePanViewA; + protected View swipePanViewB; + protected Vector3 previousMousePos; + + //Coroutine handles for panning and fading commands + protected LTDescr fadeTween, sizeTween, camPosTween, camRotTween; + + protected class CameraView + { + public Vector3 cameraPos; + public Quaternion cameraRot; + public float cameraSize; + }; + + protected Dictionary storedViews = new Dictionary(); + + protected virtual void OnGUI() + { + if (swipePanActive) + { + // Draw the swipe panning icon + if (swipePanIcon) + { + float x = Screen.width * swipeIconPosition.x; + float y = Screen.height * swipeIconPosition.y; + float width = swipePanIcon.width; + float height = swipePanIcon.height; + + x = Mathf.Max(x, 0); + y = Mathf.Max(y, 0); + x = Mathf.Min(x, Screen.width - width); + y = Mathf.Min(y, Screen.height - height); + + Rect rect = new Rect(x, y, width, height); + GUI.DrawTexture(rect, swipePanIcon); + } + } + + // Draw full screen fade texture + if (fadeAlpha > 0f && + screenFadeTexture != null) + { + // 1 = scene fully visible + // 0 = scene fully obscured + GUI.color = new Color(1,1,1, fadeAlpha); + GUI.depth = -1000; + GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), screenFadeTexture); + } + } + + protected virtual void SetCameraZ(Camera camera) + { + if (!setCameraZ) + { + return; + } + + if (camera == null) + { + Debug.LogWarning("Camera is null"); + return; + } + + camera.transform.position = new Vector3(camera.transform.position.x, camera.transform.position.y, cameraZ); + } + + protected virtual void Update() + { + if (!swipePanActive) + { + return; + } + + if (swipeCamera == null) + { + Debug.LogWarning("Camera is null"); + return; + } + + Vector3 delta = Vector3.zero; + + if (Input.touchCount > 0) + { + if (Input.GetTouch(0).phase == TouchPhase.Moved) + { + delta = Input.GetTouch(0).deltaPosition; + } + } + + if (Input.GetMouseButtonDown(0)) + { + previousMousePos = Input.mousePosition; + } + else if (Input.GetMouseButton(0)) + { + delta = Input.mousePosition - previousMousePos; + previousMousePos = Input.mousePosition; + } + + Vector3 cameraDelta = swipeCamera.ScreenToViewportPoint(delta); + cameraDelta.x *= -2f * swipeSpeedMultiplier; + cameraDelta.y *= -2f * swipeSpeedMultiplier; + cameraDelta.z = 0f; + + Vector3 cameraPos = swipeCamera.transform.position; + + cameraPos += cameraDelta; + + swipeCamera.transform.position = CalcCameraPosition(cameraPos, swipePanViewA, swipePanViewB); + swipeCamera.orthographicSize = CalcCameraSize(cameraPos, swipePanViewA, swipePanViewB); + } + + // Clamp camera position to region defined by the two views + protected virtual Vector3 CalcCameraPosition(Vector3 pos, View viewA, View viewB) + { + Vector3 safePos = pos; + + // Clamp camera position to region defined by the two views + safePos.x = Mathf.Max(safePos.x, Mathf.Min(viewA.transform.position.x, viewB.transform.position.x)); + safePos.x = Mathf.Min(safePos.x, Mathf.Max(viewA.transform.position.x, viewB.transform.position.x)); + safePos.y = Mathf.Max(safePos.y, Mathf.Min(viewA.transform.position.y, viewB.transform.position.y)); + safePos.y = Mathf.Min(safePos.y, Mathf.Max(viewA.transform.position.y, viewB.transform.position.y)); + + return safePos; + } + + // Smoothly interpolate camera orthographic size based on relative position to two views + protected virtual float CalcCameraSize(Vector3 pos, View viewA, View viewB) + { + // Get ray and point in same space + Vector3 toViewB = viewB.transform.position - viewA.transform.position; + Vector3 localPos = pos - viewA.transform.position; + + // Normalize + float distance = toViewB.magnitude; + toViewB /= distance; + localPos /= distance; + + // Project point onto ray + float t = Vector3.Dot(toViewB, localPos); + t = Mathf.Clamp01(t); // Not really necessary but no harm + + float cameraSize = Mathf.Lerp(viewA.ViewSize, viewB.ViewSize, t); + + return cameraSize; + } + + #region Public members + + /// + /// Creates a flat colored texture. + /// + 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; + } + + /// + /// Full screen texture used for screen fade effect. + /// + /// The screen fade texture. + public Texture2D ScreenFadeTexture { set { screenFadeTexture = value; } } + + /// + /// Perform a fullscreen fade over a duration. + /// + public virtual void Fade(float targetAlpha, float fadeDuration, Action fadeAction, LeanTweenType leanTweenType = LeanTweenType.easeInOutQuad) + { + StopFadeTween(); + + if (Mathf.Approximately(fadeDuration, 0)) + { + fadeAlpha = targetAlpha; + if (fadeAction != null) fadeAction(); + } + else + { + fadeTween = LeanTween.value(fadeAlpha, targetAlpha, fadeDuration) + .setEase(leanTweenType) + .setOnUpdate((x) => fadeAlpha = x) + .setOnComplete(() => + { + fadeAlpha = targetAlpha; + var tempFadeActin = fadeAction; + fadeAction = null; + if (tempFadeActin != null) tempFadeActin(); + }); + } + } + + /// + /// Fade out, move camera to view and then fade back in. + /// + public virtual void FadeToView(Camera camera, View view, float fadeDuration, bool fadeOut, Action fadeAction, + LeanTweenType fadeType = LeanTweenType.easeInOutQuad, LeanTweenType sizeTweenType = LeanTweenType.easeInOutQuad, + LeanTweenType posTweenType = LeanTweenType.easeInOutQuad, LeanTweenType rotTweenType = LeanTweenType.easeInOutQuad) + { + swipePanActive = false; + fadeAlpha = 0f; + + float outDuration; + float inDuration; + + if (fadeOut) + { + outDuration = fadeDuration / 2f; + inDuration = fadeDuration / 2f; + } + else + { + outDuration = 0; + inDuration = fadeDuration; + } + + // Fade out + Fade(1f, outDuration, delegate { + + // Snap to new view + PanToPosition(camera, view.transform.position, view.transform.rotation, view.ViewSize, 0f, null, sizeTweenType, posTweenType, rotTweenType); + + // Fade in + Fade(0f, inDuration, delegate { + if (fadeAction != null) + { + fadeAction(); + } + }, fadeType); + }, fadeType); + } + + /// + /// Stop all camera tweening. + /// + public virtual void Stop() + { + StopFadeTween(); + StopPosTweens(); + } + + protected void StopFadeTween() + { + if (fadeTween != null) + { + LeanTween.cancel(fadeTween.id, true); + fadeTween = null; + } + } + + protected void StopPosTweens() + { + if (sizeTween != null) + { + LeanTween.cancel(sizeTween.id, true); + sizeTween = null; + } + if (camPosTween != null) + { + LeanTween.cancel(camPosTween.id, true); + camPosTween = null; + } + if (camRotTween != null) + { + LeanTween.cancel(camRotTween.id, true); + camRotTween = null; + } + } + + /// + /// Moves camera from current position to a target position over a period of time. + /// + public virtual void PanToPosition(Camera camera, Vector3 targetPosition, Quaternion targetRotation, float targetSize, float duration, Action arriveAction, + LeanTweenType sizeTweenType = LeanTweenType.easeInOutQuad, LeanTweenType posTweenType = LeanTweenType.easeInOutQuad, LeanTweenType rotTweenType = LeanTweenType.easeInOutQuad) + { + if (camera == null) + { + Debug.LogWarning("Camera is null"); + return; + } + + if(setCameraZ) + { + targetPosition.z = camera.transform.position.z; + } + + // Stop any pan that is currently active + StopPosTweens(); + swipePanActive = false; + + if (Mathf.Approximately(duration, 0f)) + { + // Move immediately + camera.orthographicSize = targetSize; + camera.transform.position = targetPosition; + camera.transform.rotation = targetRotation; + + SetCameraZ(camera); + + if (arriveAction != null) + { + arriveAction(); + } + } + else + { + sizeTween = LeanTween.value(camera.orthographicSize, targetSize, duration) + .setEase(sizeTweenType) + .setOnUpdate(x => camera.orthographicSize = x) + .setOnComplete(() => + { + camera.orthographicSize = targetSize; + if (arriveAction != null) arriveAction(); + sizeTween = null; + }); + + camPosTween = LeanTween.move(camera.gameObject, targetPosition, duration) + .setEase(posTweenType) + .setOnComplete(() => + { + camera.transform.position = targetPosition; + camPosTween = null; + }); + + camRotTween = LeanTween.rotate(camera.gameObject, targetRotation.eulerAngles, duration) + .setEase(rotTweenType) + .setOnComplete(() => + { + camera.transform.rotation = targetRotation; + camRotTween = null; + }); + } + } + + /// + /// Activates swipe panning mode. The player can pan the camera within the area between viewA & viewB. + /// + public virtual void StartSwipePan(Camera camera, View viewA, View viewB, float duration, float speedMultiplier, Action arriveAction) + { + if (camera == null) + { + Debug.LogWarning("Camera is null"); + return; + } + + swipePanViewA = viewA; + swipePanViewB = viewB; + swipeSpeedMultiplier = speedMultiplier; + + Vector3 cameraPos = camera.transform.position; + + Vector3 targetPosition = CalcCameraPosition(cameraPos, swipePanViewA, swipePanViewB); + float targetSize = CalcCameraSize(cameraPos, swipePanViewA, swipePanViewB); + + PanToPosition(camera, targetPosition, Quaternion.identity, targetSize, duration, delegate { + + swipePanActive = true; + swipeCamera = camera; + + if (arriveAction != null) + { + arriveAction(); + } + }); + } + + /// + /// Deactivates swipe panning mode. + /// + public virtual void StopSwipePan() + { + swipePanActive = false; + swipePanViewA = null; + swipePanViewB = null; + swipeCamera = null; + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/CameraManager.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Components/CameraManager.cs.meta new file mode 100644 index 0000000..9c68508 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/CameraManager.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: efb7bb24722d4469bbd789bd2e01db19 +MonoImporter: + serializedVersion: 2 + defaultReferences: + - screenFadeTexture: {fileID: 2800000, guid: f6c7b1f3a78a24703b70c746d8b9c768, type: 3} + - swipePanIcon: {fileID: 2800000, guid: 41bc737f4dc1b40db872aca00bcd7d4b, type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/Character.cs b/Fungus Basics/Assets/Fungus/Scripts/Components/Character.cs new file mode 100644 index 0000000..5d45ce3 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/Character.cs @@ -0,0 +1,203 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections.Generic; +using System.Globalization; + +namespace Fungus +{ + /// + /// A Character that can be used in dialogue via the Say, Conversation and Portrait commands. + /// + [ExecuteInEditMode] + public class Character : MonoBehaviour, ILocalizable, IComparer + { + [Tooltip("Character name as displayed in Say Dialog.")] + [SerializeField] protected string nameText; // We need a separate name as the object name is used for character variations (e.g. "Smurf Happy", "Smurf Sad") + + [Tooltip("Color to display the character name in Say Dialog.")] + [SerializeField] protected Color nameColor = Color.white; + + [Tooltip("Sound effect to play when this character is speaking.")] + [SerializeField] protected AudioClip soundEffect; + + [Tooltip("List of portrait images that can be displayed for this character.")] + [SerializeField] protected List portraits; + + [Tooltip("Direction that portrait sprites face.")] + [SerializeField] protected FacingDirection portraitsFace; + + [Tooltip("Sets the active Say dialog with a reference to a Say Dialog object in the scene. This Say Dialog will be used whenever the character speaks.")] + [SerializeField] protected SayDialog setSayDialog; + + [FormerlySerializedAs("notes")] + [TextArea(5,10)] + [SerializeField] protected string description; + + protected PortraitState portaitState = new PortraitState(); + + protected static List activeCharacters = new List(); + + protected virtual void OnEnable() + { + if (!activeCharacters.Contains(this)) + { + activeCharacters.Add(this); + activeCharacters.Sort(this); + } + } + + protected virtual void OnDisable() + { + activeCharacters.Remove(this); + } + + #region Public members + + /// + /// Gets the list of active characters. + /// + public static List ActiveCharacters { get { return activeCharacters; } } + + /// + /// Character name as displayed in Say Dialog. + /// + public virtual string NameText { get { return nameText; } } + + /// + /// Color to display the character name in Say Dialog. + /// + public virtual Color NameColor { get { return nameColor; } } + + /// + /// Sound effect to play when this character is speaking. + /// + /// The sound effect. + public virtual AudioClip SoundEffect { get { return soundEffect; } } + + /// + /// List of portrait images that can be displayed for this character. + /// + public virtual List Portraits { get { return portraits; } } + + /// + /// Direction that portrait sprites face. + /// + public virtual FacingDirection PortraitsFace { get { return portraitsFace; } } + + /// + /// Currently display profile sprite for this character. + /// + /// The profile sprite. + public virtual Sprite ProfileSprite { get; set; } + + /// + /// Current display state of this character's portrait. + /// + /// The state. + public virtual PortraitState State { get { return portaitState; } } + + /// + /// Sets the active Say dialog with a reference to a Say Dialog object in the scene. This Say Dialog will be used whenever the character speaks. + /// + public virtual SayDialog SetSayDialog { get { return setSayDialog; } } + + /// + /// Returns the name of the game object. + /// + public string GetObjectName() { return gameObject.name; } + + /// + /// Returns true if the character name starts with the specified string. Case insensitive. + /// + public virtual bool NameStartsWith(string matchString) + { +#if NETFX_CORE + return name.StartsWith(matchString, StringComparison.CurrentCultureIgnoreCase) + || nameText.StartsWith(matchString, StringComparison.CurrentCultureIgnoreCase); +#else + return name.StartsWith(matchString, true, System.Globalization.CultureInfo.CurrentCulture) + || nameText.StartsWith(matchString, true, System.Globalization.CultureInfo.CurrentCulture); +#endif + } + + /// + /// Returns true if the character name is a complete match to the specified string. Case insensitive. + /// + public virtual bool NameMatch(string matchString) + { + return string.Compare(name, matchString, true, CultureInfo.CurrentCulture) == 0 + || string.Compare(nameText, matchString, true, CultureInfo.CurrentCulture) == 0; + } + + public int Compare(Character x, Character y) + { + if (x == y) + return 0; + if (y == null) + return 1; + if (x == null) + return -1; + + return x.name.CompareTo(y.name); + } + + /// + /// Looks for a portrait by name on a character + /// If none is found, give a warning and return a blank sprite + /// + public virtual Sprite GetPortrait(string portraitString) + { + if (string.IsNullOrEmpty(portraitString)) + { + return null; + } + + for (int i = 0; i < portraits.Count; i++) + { + if (portraits[i] != null && string.Compare(portraits[i].name, portraitString, true) == 0) + { + return portraits[i]; + } + } + return null; + } + + #endregion + + #region ILocalizable implementation + + public virtual string GetStandardText() + { + return nameText; + } + + public virtual void SetStandardText(string standardText) + { + nameText = standardText; + } + + public virtual string GetDescription() + { + return description; + } + + public virtual string GetStringId() + { + // String id for character names is CHARACTER. + return "CHARACTER." + nameText; + } + + #endregion + + protected virtual void OnValidate() + { + if (portraits != null && portraits.Count > 1) + { + portraits.Sort(PortraitUtil.PortraitCompareTo); + } + } + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/Character.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Components/Character.cs.meta new file mode 100644 index 0000000..b3029da --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/Character.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 25fb867d2049d41f597aefdd6b19f598 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/Clickable2D.cs b/Fungus Basics/Assets/Fungus/Scripts/Components/Clickable2D.cs new file mode 100644 index 0000000..7f74583 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/Clickable2D.cs @@ -0,0 +1,131 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.EventSystems; + +namespace Fungus +{ + /// + /// Detects mouse clicks and touches on a Game Object, and sends an event to all Flowchart event handlers in the scene. + /// The Game Object must have a Collider or Collider2D component attached. + /// Use in conjunction with the ObjectClicked Flowchart event handler. + /// + public class Clickable2D : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler + { + [Tooltip("Is object clicking enabled")] + [SerializeField] protected bool clickEnabled = true; + + [Tooltip("Mouse texture to use when hovering mouse over object")] + [SerializeField] protected Texture2D hoverCursor; + + [Tooltip("Use the UI Event System to check for clicks. Clicks that hit an overlapping UI object will be ignored. Camera must have a PhysicsRaycaster component, or a Physics2DRaycaster for 2D colliders.")] + [SerializeField] protected bool useEventSystem; + + protected virtual void ChangeCursor(Texture2D cursorTexture) + { + if (!clickEnabled) + { + return; + } + + Cursor.SetCursor(cursorTexture, Vector2.zero, CursorMode.Auto); + } + + protected virtual void DoPointerClick() + { + if (!clickEnabled) + { + return; + } + + var eventDispatcher = FungusManager.Instance.EventDispatcher; + + eventDispatcher.Raise(new ObjectClicked.ObjectClickedEvent(this)); + } + + protected virtual void DoPointerEnter() + { + ChangeCursor(hoverCursor); + } + + protected virtual void DoPointerExit() + { + // Always reset the mouse cursor to be on the safe side + SetMouseCursor.ResetMouseCursor(); + } + + #region Legacy OnMouseX methods + + protected virtual void OnMouseDown() + { + if (!useEventSystem) + { + DoPointerClick(); + } + } + + protected virtual void OnMouseEnter() + { + if (!useEventSystem) + { + DoPointerEnter(); + } + } + + protected virtual void OnMouseExit() + { + if (!useEventSystem) + { + DoPointerExit(); + } + } + + #endregion + + #region Public members + + /// + /// Is object clicking enabled. + /// + public bool ClickEnabled { set { clickEnabled = value; } } + + #endregion + + #region IPointerClickHandler implementation + + public void OnPointerClick(PointerEventData eventData) + { + if (useEventSystem) + { + DoPointerClick(); + } + } + + #endregion + + #region IPointerEnterHandler implementation + + public void OnPointerEnter(PointerEventData eventData) + { + if (useEventSystem) + { + DoPointerEnter(); + } + } + + #endregion + + #region IPointerExitHandler implementation + + public void OnPointerExit(PointerEventData eventData) + { + if (useEventSystem) + { + DoPointerExit(); + } + } + + #endregion + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/Clickable2D.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Components/Clickable2D.cs.meta new file mode 100644 index 0000000..45e3309 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/Clickable2D.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cc03961113fa349c09cb06ef2911013d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/Command.cs b/Fungus Basics/Assets/Fungus/Scripts/Components/Command.cs new file mode 100644 index 0000000..fca8395 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/Command.cs @@ -0,0 +1,336 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System; +using System.Collections.Generic; + +namespace Fungus +{ + /// + /// Attribute class for Fungus commands. + /// + /// + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] + public class CommandInfoAttribute : Attribute + { + /// + /// Metadata atribute for the Command class. + /// + /// The category to place this command in. + /// The display name of the command. + /// Help information to display in the inspector. + /// If two command classes have the same name, the one with highest priority is listed. Negative priority removess the command from the list./// + public CommandInfoAttribute(string category, string commandName, string helpText, int priority = 0) + { + this.Category = category; + this.CommandName = commandName; + this.HelpText = helpText; + this.Priority = priority; + } + + public string Category { get; set; } + public string CommandName { get; set; } + public string HelpText { get; set; } + public int Priority { get; set; } + } + + /// + /// Base class for Commands. Commands can be added to Blocks to create an execution sequence. + /// + public abstract class Command : MonoBehaviour, IVariableReference + { + [FormerlySerializedAs("commandId")] + [HideInInspector] + [SerializeField] protected int itemId = -1; // Invalid flowchart item id + + [HideInInspector] + [SerializeField] protected int indentLevel; + + protected string errorMessage = ""; + + #region Editor caches +#if UNITY_EDITOR + // + protected List referencedVariables = new List(); + + //used by var list adapter to highlight variables + public bool IsVariableReferenced(Variable variable) + { + return referencedVariables.Contains(variable) || HasReference(variable); + } + + /// + /// Called by OnValidate + /// + /// Child classes to specialise to add variable references to referencedVariables, either directly or + /// via the use of Flowchart.DetermineSubstituteVariables + /// + protected virtual void RefreshVariableCache() + { + referencedVariables.Clear(); + } +#endif + #endregion Editor caches + + #region Public members + + /// + /// Unique identifier for this command. + /// Unique for this Flowchart. + /// + public virtual int ItemId { get { return itemId; } set { itemId = value; } } + + /// + /// Error message to display in the command inspector. + /// + public virtual string ErrorMessage { get { return errorMessage; } } + + /// + /// Indent depth of the current commands. + /// Commands are indented inside If, While, etc. sections. + /// + public virtual int IndentLevel { get { return indentLevel; } set { indentLevel = value; } } + + /// + /// Index of the command in the parent block's command list. + /// + public virtual int CommandIndex { get; set; } + + /// + /// Set to true by the parent block while the command is executing. + /// + public virtual bool IsExecuting { get; set; } + + /// + /// Timer used to control appearance of executing icon in inspector. + /// + public virtual float ExecutingIconTimer { get; set; } + + /// + /// Reference to the Block object that this command belongs to. + /// This reference is only populated at runtime and in the editor when the + /// block is selected. + /// + public virtual Block ParentBlock { get; set; } + + /// + /// Returns the Flowchart that this command belongs to. + /// + public virtual Flowchart GetFlowchart() + { + var flowchart = GetComponent(); + if (flowchart == null && + transform.parent != null) + { + flowchart = transform.parent.GetComponent(); + } + return flowchart; + } + + /// + /// Execute the command. + /// + public virtual void Execute() + { + OnEnter(); + } + + /// + /// End execution of this command and continue execution at the next command. + /// + public virtual void Continue() + { + // This is a noop if the Block has already been stopped + if (IsExecuting) + { + Continue(CommandIndex + 1); + } + } + + /// + /// End execution of this command and continue execution at a specific command index. + /// + /// Next command index. + public virtual void Continue(int nextCommandIndex) + { + OnExit(); + if (ParentBlock != null) + { + ParentBlock.JumpToCommandIndex = nextCommandIndex; + } + } + + /// + /// Stops the parent Block executing. + /// + public virtual void StopParentBlock() + { + OnExit(); + if (ParentBlock != null) + { + ParentBlock.Stop(); + } + } + + /// + /// Called when the parent block has been requested to stop executing, and + /// this command is the currently executing command. + /// Use this callback to terminate any asynchronous operations and + /// cleanup state so that the command is ready to execute again later on. + /// + public virtual void OnStopExecuting() + {} + + /// + /// Called when the new command is added to a block in the editor. + /// + public virtual void OnCommandAdded(Block parentBlock) + {} + + /// + /// Called when the command is deleted from a block in the editor. + /// + public virtual void OnCommandRemoved(Block parentBlock) + {} + + /// + /// Called when this command starts execution. + /// + public virtual void OnEnter() + {} + + /// + /// Called when this command ends execution. + /// + public virtual void OnExit() + {} + + /// + /// Called when this command is reset. This happens when the Reset command is used. + /// + public virtual void OnReset() + {} + + /// + /// Populates a list with the Blocks that this command references. + /// + public virtual void GetConnectedBlocks(ref List connectedBlocks) + {} + + /// + /// Returns true if this command references the variable. + /// Used to highlight variables in the variable list when a command is selected. + /// + public virtual bool HasReference(Variable variable) + { + return false; + } + + public virtual string GetLocationIdentifier() + { + return ParentBlock.GetFlowchart().GetName() + ":" + ParentBlock.BlockName + "." + this.GetType().Name + "#" + CommandIndex.ToString(); + } + + /// + /// Called by unity when script is loaded or its data changed by editor + /// + public virtual void OnValidate() + { +#if UNITY_EDITOR + RefreshVariableCache(); +#endif + } + + /// + /// Returns the summary text to display in the command inspector. + /// + public virtual string GetSummary() + { + return ""; + } + + /// + /// Returns the searchable content for searches on the flowchart window. + /// + public virtual string GetSearchableContent() + { + return GetSummary(); + } + + /// + /// Returns the help text to display for this command. + /// + public virtual string GetHelpText() + { + return ""; + } + + /// + /// Return true if this command opens a block of commands. Used for indenting commands. + /// + public virtual bool OpenBlock() + { + return false; + } + + /// + /// Return true if this command closes a block of commands. Used for indenting commands. + /// + public virtual bool CloseBlock() + { + return false; + } + + /// + /// Return the color for the command background in inspector. + /// + /// The button color. + public virtual Color GetButtonColor() + { + return Color.white; + } + + /// + /// Returns true if the specified property should be displayed in the inspector. + /// This is useful for hiding certain properties based on the value of another property. + /// + public virtual bool IsPropertyVisible(string propertyName) + { + return true; + } + + /// + /// Returns true if the specified property should be displayed as a reorderable list in the inspector. + /// This only applies for array properties and has no effect for non-array properties. + /// + public virtual bool IsReorderableArray(string propertyName) + { + return false; + } + + /// + /// Returns the localization id for the Flowchart that contains this command. + /// + public virtual string GetFlowchartLocalizationId() + { + // If no localization id has been set then use the Flowchart name + var flowchart = GetFlowchart(); + if (flowchart == null) + { + return ""; + } + + string localizationId = GetFlowchart().LocalizationId; + if (localizationId.Length == 0) + { + localizationId = flowchart.GetName(); + } + + return localizationId; + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/Command.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Components/Command.cs.meta new file mode 100644 index 0000000..5496c01 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/Command.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8e206154a3e694fb2bfc9e518a474603 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/CommandCopyBuffer.cs b/Fungus Basics/Assets/Fungus/Scripts/Components/CommandCopyBuffer.cs new file mode 100644 index 0000000..157ac42 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/CommandCopyBuffer.cs @@ -0,0 +1,75 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Temporary buffer object used when copying and pasting commands. + /// + [AddComponentMenu("")] + public class CommandCopyBuffer : Block + { + protected static CommandCopyBuffer instance; + + protected virtual void Start() + { + if (Application.isPlaying) + { + Destroy(this.gameObject); + } + } + + #region Public members + + /// + /// Returns the CommandCopyBuffer singleton instance. + /// Will create a CommandCopyBuffer game object if none currently exists. + /// + public static CommandCopyBuffer GetInstance() + { + if (instance == null) + { + // Static variables are not serialized (e.g. when playing in the editor) + // We need to reaquire the static reference to the game object in this case + GameObject go = GameObject.Find("_CommandCopyBuffer"); + if (go == null) + { + go = new GameObject("_CommandCopyBuffer"); + go.hideFlags = HideFlags.HideAndDontSave; + } + + instance = go.GetComponent(); + if (instance == null) + { + instance = go.AddComponent(); + } + } + + return instance; + } + + public virtual bool HasCommands() + { + return GetCommands().Length > 0; + } + + public virtual Command[] GetCommands() + { + return GetComponents(); + } + + public virtual void Clear() + { + var commands = GetCommands(); + for (int i = 0; i < commands.Length; i++) + { + var command = commands[i]; + DestroyImmediate(command); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/CommandCopyBuffer.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Components/CommandCopyBuffer.cs.meta new file mode 100644 index 0000000..6960f81 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/CommandCopyBuffer.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 28859462f29464188bb29cc9f1f6e92c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/CustomTag.cs b/Fungus Basics/Assets/Fungus/Scripts/Components/CustomTag.cs new file mode 100644 index 0000000..f56bbdc --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/CustomTag.cs @@ -0,0 +1,66 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using System.Collections.Generic; + +namespace Fungus +{ + /// + /// Create custom tags for use in Say text. + /// + [ExecuteInEditMode] + public class CustomTag : MonoBehaviour + { + [Tooltip("String that defines the start of the tag.")] + [SerializeField] protected string tagStartSymbol; + + [Tooltip("String that defines the end of the tag.")] + [SerializeField] protected string tagEndSymbol; + + [Tooltip("String to replace the start tag with.")] + [SerializeField] protected string replaceTagStartWith; + + [Tooltip("String to replace the end tag with.")] + [SerializeField] protected string replaceTagEndWith; + + protected virtual void OnEnable() + { + if (!activeCustomTags.Contains(this)) + { + activeCustomTags.Add(this); + } + } + + protected virtual void OnDisable() + { + activeCustomTags.Remove(this); + } + + #region Public members + + public static List activeCustomTags = new List(); + + /// + /// String that defines the start of the tag. + /// + public virtual string TagStartSymbol { get { return tagStartSymbol; } } + + /// + /// String that defines the end of the tag. + /// + public virtual string TagEndSymbol { get { return tagEndSymbol; } } + + /// + /// String to replace the start tag with. + /// + public virtual string ReplaceTagStartWith { get { return replaceTagStartWith; } } + + /// + /// String to replace the end tag with. + /// + public virtual string ReplaceTagEndWith { get { return replaceTagEndWith; } } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/CustomTag.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Components/CustomTag.cs.meta new file mode 100644 index 0000000..6ca7e39 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/CustomTag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 335e04fbdd5260043abb299a991dcbe8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/DialogInput.cs b/Fungus Basics/Assets/Fungus/Scripts/Components/DialogInput.cs new file mode 100644 index 0000000..4c26438 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/DialogInput.cs @@ -0,0 +1,207 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.EventSystems; + +namespace Fungus +{ + /// + /// Supported modes for clicking through a Say Dialog. + /// + public enum ClickMode + { + /// Clicking disabled. + Disabled, + /// Click anywhere on screen to advance. + ClickAnywhere, + /// Click anywhere on Say Dialog to advance. + ClickOnDialog, + /// Click on continue button to advance. + ClickOnButton + } + + /// + /// Input handler for say dialogs. + /// + public class DialogInput : MonoBehaviour + { + [Tooltip("Click to advance story")] + [SerializeField] protected ClickMode clickMode; + + [Tooltip("Delay between consecutive clicks. Useful to prevent accidentally clicking through story.")] + [SerializeField] protected float nextClickDelay = 0f; + + [Tooltip("Allow holding Cancel to fast forward text")] + [SerializeField] protected bool cancelEnabled = true; + + [Tooltip("Ignore input if a Menu dialog is currently active")] + [SerializeField] protected bool ignoreMenuClicks = true; + + protected bool dialogClickedFlag; + + protected bool nextLineInputFlag; + + protected float ignoreClickTimer; + + protected StandaloneInputModule currentStandaloneInputModule; + + protected Writer writer; + + protected virtual void Awake() + { + writer = GetComponent(); + + CheckEventSystem(); + } + + // There must be an Event System in the scene for Say and Menu input to work. + // This method will automatically instantiate one if none exists. + protected virtual void CheckEventSystem() + { + EventSystem eventSystem = GameObject.FindObjectOfType(); + if (eventSystem == null) + { + // Auto spawn an Event System from the prefab + GameObject prefab = Resources.Load("Prefabs/EventSystem"); + if (prefab != null) + { + GameObject go = Instantiate(prefab) as GameObject; + go.name = "EventSystem"; + } + } + } + + protected virtual void Update() + { + if (EventSystem.current == null) + { + return; + } + + if (currentStandaloneInputModule == null) + { + currentStandaloneInputModule = EventSystem.current.GetComponent(); + } + + if (writer != null) + { + if (Input.GetButtonDown(currentStandaloneInputModule.submitButton) || + (cancelEnabled && Input.GetButton(currentStandaloneInputModule.cancelButton))) + { + SetNextLineFlag(); + } + } + + switch (clickMode) + { + case ClickMode.Disabled: + break; + case ClickMode.ClickAnywhere: + if (Input.GetMouseButtonDown(0)) + { + SetClickAnywhereClickedFlag(); + } + break; + case ClickMode.ClickOnDialog: + if (dialogClickedFlag) + { + SetNextLineFlag(); + dialogClickedFlag = false; + } + break; + } + + if (ignoreClickTimer > 0f) + { + ignoreClickTimer = Mathf.Max (ignoreClickTimer - Time.deltaTime, 0f); + } + + if (ignoreMenuClicks) + { + // Ignore input events if a Menu is being displayed + if (MenuDialog.ActiveMenuDialog != null && + MenuDialog.ActiveMenuDialog.IsActive() && + MenuDialog.ActiveMenuDialog.DisplayedOptionsCount > 0) + { + dialogClickedFlag = false; + nextLineInputFlag = false; + } + } + + // Tell any listeners to move to the next line + if (nextLineInputFlag) + { + var inputListeners = gameObject.GetComponentsInChildren(); + for (int i = 0; i < inputListeners.Length; i++) + { + var inputListener = inputListeners[i]; + inputListener.OnNextLineEvent(); + } + nextLineInputFlag = false; + } + } + + #region Public members + + /// + /// Trigger next line input event from script. + /// + public virtual void SetNextLineFlag() + { + if(writer.IsWaitingForInput || writer.IsWriting) + { + nextLineInputFlag = true; + } + } + /// + /// Set the ClickAnywhere click flag. + /// + public virtual void SetClickAnywhereClickedFlag() + { + if (ignoreClickTimer > 0f) + { + return; + } + ignoreClickTimer = nextClickDelay; + + // Only applies if ClickedAnywhere is selected + if (clickMode == ClickMode.ClickAnywhere) + { + SetNextLineFlag(); + } + } + /// + /// Set the dialog clicked flag (usually from an Event Trigger component in the dialog UI). + /// + public virtual void SetDialogClickedFlag() + { + // Ignore repeat clicks for a short time to prevent accidentally clicking through the character dialogue + if (ignoreClickTimer > 0f) + { + return; + } + ignoreClickTimer = nextClickDelay; + + // Only applies in Click On Dialog mode + if (clickMode == ClickMode.ClickOnDialog) + { + dialogClickedFlag = true; + } + } + + /// + /// Sets the button clicked flag. + /// + public virtual void SetButtonClickedFlag() + { + // Only applies if clicking is not disabled + if (clickMode != ClickMode.Disabled) + { + SetNextLineFlag(); + } + } + + #endregion + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/DialogInput.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Components/DialogInput.cs.meta new file mode 100644 index 0000000..be1ed20 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/DialogInput.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 43b85556abd314f3f870c18c013fdcef +timeCreated: 1439996546 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/Draggable2D.cs b/Fungus Basics/Assets/Fungus/Scripts/Components/Draggable2D.cs new file mode 100644 index 0000000..b375073 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/Draggable2D.cs @@ -0,0 +1,312 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.EventSystems; +using UnityEngine.Serialization; +using System.Collections.Generic; + +namespace Fungus +{ + /// + /// Detects drag and drop interactions on a Game Object, and sends events to all Flowchart event handlers in the scene. + /// The Game Object must have Collider2D & RigidBody components attached. + /// The Collider2D must have the Is Trigger property set to true. + /// The RigidBody would typically have the Is Kinematic property set to true, unless you want the object to move around using physics. + /// Use in conjunction with the Drag Started, Drag Completed, Drag Cancelled, Drag Entered & Drag Exited event handlers. + /// + public class Draggable2D : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler, IPointerEnterHandler, IPointerExitHandler + { + [Tooltip("Is object dragging enabled")] + [SerializeField] protected bool dragEnabled = true; + + [Tooltip("Move object back to its starting position when drag is cancelled")] + [FormerlySerializedAs("returnToStartPos")] + [SerializeField] protected bool returnOnCancelled = true; + + [Tooltip("Move object back to its starting position when drag is completed")] + [SerializeField] protected bool returnOnCompleted = true; + + [Tooltip("Time object takes to return to its starting position")] + [SerializeField] protected float returnDuration = 1f; + + [Tooltip("Mouse texture to use when hovering mouse over object")] + [SerializeField] protected Texture2D hoverCursor; + + [Tooltip("Use the UI Event System to check for drag events. Clicks that hit an overlapping UI object will be ignored. Camera must have a PhysicsRaycaster component, or a Physics2DRaycaster for 2D colliders.")] + [SerializeField] protected bool useEventSystem; + + [SerializeField] protected bool beingDragged; + + public virtual bool BeingDragged + { + get { return beingDragged; } + set { beingDragged = value; } + } + + protected Vector3 startingPosition; + protected bool updatePosition = false; + protected Vector3 newPosition; + protected Vector3 delta = Vector3.zero; + + #region DragCompleted handlers + protected List dragCompletedHandlers = new List(); + + public void RegisterHandler(DragCompleted handler) + { + dragCompletedHandlers.Add(handler); + } + + public void UnregisterHandler(DragCompleted handler) + { + if(dragCompletedHandlers.Contains(handler)) + { + dragCompletedHandlers.Remove(handler); + } + } + #endregion + + protected virtual void LateUpdate() + { + // iTween will sometimes override the object position even if it should only be affecting the scale, rotation, etc. + // To make sure this doesn't happen, we force the position change to happen in LateUpdate. + if (updatePosition) + { + transform.position = newPosition; + updatePosition = false; + } + } + + protected virtual void OnTriggerEnter2D(Collider2D other) + { + if (!dragEnabled) + { + return; + } + + var eventDispatcher = FungusManager.Instance.EventDispatcher; + + eventDispatcher.Raise(new DragEntered.DragEnteredEvent(this, other)); + } + + protected virtual void OnTriggerExit2D(Collider2D other) + { + if (!dragEnabled) + { + return; + } + + var eventDispatcher = FungusManager.Instance.EventDispatcher; + + eventDispatcher.Raise(new DragExited.DragExitedEvent(this, other)); + } + + protected virtual void DoBeginDrag() + { + beingDragged = true; + + // Offset the object so that the drag is anchored to the exact point where the user clicked it + float x = Input.mousePosition.x; + float y = Input.mousePosition.y; + delta = Camera.main.ScreenToWorldPoint(new Vector3(x, y, 10f)) - transform.position; + delta.z = 0f; + + startingPosition = transform.position; + + var eventDispatcher = FungusManager.Instance.EventDispatcher; + + eventDispatcher.Raise(new DragStarted.DragStartedEvent(this)); + } + + protected virtual void DoDrag() + { + if (!dragEnabled) + { + return; + } + + float x = Input.mousePosition.x; + float y = Input.mousePosition.y; + float z = transform.position.z; + + newPosition = Camera.main.ScreenToWorldPoint(new Vector3(x, y, 10f)) - delta; + newPosition.z = z; + updatePosition = true; + } + + protected virtual void DoEndDrag() + { + if (!dragEnabled) + { + return; + } + + var eventDispatcher = FungusManager.Instance.EventDispatcher; + bool dragCompleted = false; + + for (int i = 0; i < dragCompletedHandlers.Count; i++) + { + var handler = dragCompletedHandlers[i]; + if (handler != null && handler.DraggableObjects.Contains(this)) + { + if (handler.IsOverTarget()) + { + dragCompleted = true; + + eventDispatcher.Raise(new DragCompleted.DragCompletedEvent(this)); + } + } + } + + if (!dragCompleted) + { + eventDispatcher.Raise(new DragCancelled.DragCancelledEvent(this)); + + if (returnOnCancelled) + { + LeanTween.move(gameObject, startingPosition, returnDuration).setEase(LeanTweenType.easeOutExpo); + } + } + else if(returnOnCompleted) + { + LeanTween.move(gameObject, startingPosition, returnDuration).setEase(LeanTweenType.easeOutExpo); + } + + beingDragged = false; + } + + protected virtual void DoPointerEnter() + { + ChangeCursor(hoverCursor); + } + + protected virtual void DoPointerExit() + { + SetMouseCursor.ResetMouseCursor(); + } + + protected virtual void ChangeCursor(Texture2D cursorTexture) + { + if (!dragEnabled) + { + return; + } + + Cursor.SetCursor(cursorTexture, Vector2.zero, CursorMode.Auto); + } + + #region Legacy OnMouseX methods + + protected virtual void OnMouseDown() + { + if (!useEventSystem) + { + DoBeginDrag(); + } + } + + protected virtual void OnMouseDrag() + { + if (!useEventSystem) + { + DoDrag(); + } + } + + protected virtual void OnMouseUp() + { + if (!useEventSystem) + { + DoEndDrag(); + } + } + + protected virtual void OnMouseEnter() + { + if (!useEventSystem) + { + DoPointerEnter(); + } + } + + protected virtual void OnMouseExit() + { + if (!useEventSystem) + { + DoPointerExit(); + } + } + + #endregion + + #region Public members + + /// + /// Is object drag and drop enabled. + /// + /// true if drag enabled; otherwise, false. + public virtual bool DragEnabled { get { return dragEnabled; } set { dragEnabled = value; } } + + #endregion + + #region IBeginDragHandler implementation + + public void OnBeginDrag(PointerEventData eventData) + { + if (useEventSystem) + { + DoBeginDrag(); + } + } + + #endregion + + #region IDragHandler implementation + + public void OnDrag(PointerEventData eventData) + { + if (useEventSystem) + { + DoDrag(); + } + } + + #endregion + + #region IEndDragHandler implementation + + public void OnEndDrag(PointerEventData eventData) + { + if (useEventSystem) + { + DoEndDrag(); + } + } + + #endregion + + #region IPointerEnterHandler implementation + + public void OnPointerEnter(PointerEventData eventData) + { + if (useEventSystem) + { + DoPointerEnter(); + } + } + + #endregion + + #region IPointerExitHandler implementation + + public void OnPointerExit(PointerEventData eventData) + { + if (useEventSystem) + { + DoPointerExit(); + } + } + + #endregion + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/Draggable2D.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Components/Draggable2D.cs.meta new file mode 100644 index 0000000..88948ac --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/Draggable2D.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 18a0e492e94664ec0ac44d252c40e3a7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/EventHandler.cs b/Fungus Basics/Assets/Fungus/Scripts/Components/EventHandler.cs new file mode 100644 index 0000000..06653ec --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/EventHandler.cs @@ -0,0 +1,95 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.Serialization; +using System; + +namespace Fungus +{ + /// + /// Attribute class for Fungus event handlers. + /// + public class EventHandlerInfoAttribute : Attribute + { + public EventHandlerInfoAttribute(string category, string eventHandlerName, string helpText) + { + this.Category = category; + this.EventHandlerName = eventHandlerName; + this.HelpText = helpText; + } + + public string Category { get; set; } + public string EventHandlerName { get; set; } + public string HelpText { get; set; } + } + + /// + /// A Block may have an associated Event Handler which starts executing commands when + /// a specific event occurs. + /// To create a custom Event Handler, simply subclass EventHandler and call the ExecuteBlock() method + /// when the event occurs. + /// Add an EventHandlerInfo attibute and your new EventHandler class will automatically appear in the + /// 'Execute On Event' dropdown menu when a block is selected. + /// + [RequireComponent(typeof(Block))] + [RequireComponent(typeof(Flowchart))] + [AddComponentMenu("")] + public class EventHandler : MonoBehaviour + { + [HideInInspector] + [FormerlySerializedAs("parentSequence")] + [SerializeField] protected Block parentBlock; + + [Tooltip("If true, the flowchart window will not auto select the Block when the Event Handler fires. Affects Editor only.")] + [SerializeField] protected bool suppressBlockAutoSelect = false; + + #region Public members + + /// + /// The parent Block which owns this Event Handler. + /// + public virtual Block ParentBlock { get { return parentBlock; } set { parentBlock = value; } } + + /// + /// The Event Handler should call this method when the event is detected to start executing the Block. + /// + public virtual bool ExecuteBlock() + { + if (ParentBlock == null) + { + return false; + } + + if (ParentBlock._EventHandler != this) + { + return false; + } + + var flowchart = ParentBlock.GetFlowchart(); + + //if somehow the flowchart is invalid or has been disabled we don't want to continue + if(flowchart == null || !flowchart.isActiveAndEnabled) + { + return false; + } + + if (suppressBlockAutoSelect) + { + ParentBlock.SuppressNextAutoSelection = true; + } + + return flowchart.ExecuteBlock(ParentBlock); + } + + /// + /// Returns custom summary text for the event handler. + /// + public virtual string GetSummary() + { + return ""; + } + + #endregion + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/EventHandler.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Components/EventHandler.cs.meta new file mode 100644 index 0000000..0314674 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/EventHandler.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 33263015c61344280b425bd04afb7ff3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/Flowchart.cs b/Fungus Basics/Assets/Fungus/Scripts/Components/Flowchart.cs new file mode 100644 index 0000000..3743293 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/Flowchart.cs @@ -0,0 +1,1416 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.EventSystems; +using System; +using System.Text; +using System.Linq; +using System.Collections.Generic; +using System.Text.RegularExpressions; + +namespace Fungus +{ + /// + /// Visual scripting controller for the Flowchart programming language. + /// Flowchart objects may be edited visually using the Flowchart editor window. + /// + [ExecuteInEditMode] + public class Flowchart : MonoBehaviour, ISubstitutionHandler + { + public const string SubstituteVariableRegexString = "{\\$.*?}"; + + [HideInInspector] + [SerializeField] protected int version = 0; // Default to 0 to always trigger an update for older versions of Fungus. + + [HideInInspector] + [SerializeField] protected Vector2 scrollPos; + + [HideInInspector] + [SerializeField] protected Vector2 variablesScrollPos; + + [HideInInspector] + [SerializeField] protected bool variablesExpanded = true; + + [HideInInspector] + [SerializeField] protected float blockViewHeight = 400; + + [HideInInspector] + [SerializeField] protected float zoom = 1f; + + [HideInInspector] + [SerializeField] protected Rect scrollViewRect; + + [HideInInspector] + [SerializeField] protected List selectedBlocks = new List(); + + [HideInInspector] + [SerializeField] protected List selectedCommands = new List(); + + [HideInInspector] + [SerializeField] protected List variables = new List(); + + [TextArea(3, 5)] + [Tooltip("Description text displayed in the Flowchart editor window")] + [SerializeField] protected string description = ""; + + [Range(0f, 5f)] + [Tooltip("Adds a pause after each execution step to make it easier to visualise program flow. Editor only, has no effect in platform builds.")] + [SerializeField] protected float stepPause = 0f; + + [Tooltip("Use command color when displaying the command list in the Fungus Editor window")] + [SerializeField] protected bool colorCommands = true; + + [Tooltip("Hides the Flowchart block and command components in the inspector. Deselect to inspect the block and command components that make up the Flowchart.")] + [SerializeField] protected bool hideComponents = true; + + [Tooltip("Saves the selected block and commands when saving the scene. Helps avoid version control conflicts if you've only changed the active selection.")] + [SerializeField] protected bool saveSelection = true; + + [Tooltip("Unique identifier for this flowchart in localized string keys. If no id is specified then the name of the Flowchart object will be used.")] + [SerializeField] protected string localizationId = ""; + + [Tooltip("Display line numbers in the command list in the Block inspector.")] + [SerializeField] protected bool showLineNumbers = false; + + [Tooltip("List of commands to hide in the Add Command menu. Use this to restrict the set of commands available when editing a Flowchart.")] + [SerializeField] protected List hideCommands = new List(); + + [Tooltip("Lua Environment to be used by default for all Execute Lua commands in this Flowchart")] + [SerializeField] protected LuaEnvironment luaEnvironment; + + [Tooltip("The ExecuteLua command adds a global Lua variable with this name bound to the flowchart prior to executing.")] + [SerializeField] protected string luaBindingName = "flowchart"; + + protected static List cachedFlowcharts = new List(); + + protected static bool eventSystemPresent; + + protected StringSubstituter stringSubstituer; + +#if UNITY_EDITOR + public bool SelectedCommandsStale { get; set; } +#endif + + #if UNITY_5_4_OR_NEWER + #else + protected virtual void OnLevelWasLoaded(int level) + { + LevelWasLoaded(); + } + #endif + + protected virtual void LevelWasLoaded() + { + // Reset the flag for checking for an event system as there may not be one in the newly loaded scene. + eventSystemPresent = false; + } + + protected virtual void Start() + { + CheckEventSystem(); + } + + // There must be an Event System in the scene for Say and Menu input to work. + // This method will automatically instantiate one if none exists. + protected virtual void CheckEventSystem() + { + if (eventSystemPresent) + { + return; + } + + EventSystem eventSystem = GameObject.FindObjectOfType(); + if (eventSystem == null) + { + // Auto spawn an Event System from the prefab + GameObject prefab = Resources.Load("Prefabs/EventSystem"); + if (prefab != null) + { + GameObject go = Instantiate(prefab) as GameObject; + go.name = "EventSystem"; + } + } + + eventSystemPresent = true; + } + + private void SceneManager_activeSceneChanged(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.Scene arg1) + { + LevelWasLoaded(); + } + + protected virtual void OnEnable() + { + if (!cachedFlowcharts.Contains(this)) + { + cachedFlowcharts.Add(this); + //TODO these pairs could be replaced by something static that manages all active flowcharts + #if UNITY_5_4_OR_NEWER + UnityEngine.SceneManagement.SceneManager.activeSceneChanged += SceneManager_activeSceneChanged; + #endif + } + + CheckItemIds(); + CleanupComponents(); + UpdateVersion(); + + StringSubstituter.RegisterHandler(this); + } + + protected virtual void OnDisable() + { + cachedFlowcharts.Remove(this); + + #if UNITY_5_4_OR_NEWER + UnityEngine.SceneManagement.SceneManager.activeSceneChanged -= SceneManager_activeSceneChanged; + #endif + + StringSubstituter.UnregisterHandler(this); + } + + protected virtual void UpdateVersion() + { + if (version == FungusConstants.CurrentVersion) + { + // No need to update + return; + } + + // Tell all components that implement IUpdateable to update to the new version + var components = GetComponents(); + for (int i = 0; i < components.Length; i++) + { + var component = components[i]; + IUpdateable u = component as IUpdateable; + if (u != null) + { + u.UpdateToVersion(version, FungusConstants.CurrentVersion); + } + } + + version = FungusConstants.CurrentVersion; + } + + protected virtual void CheckItemIds() + { + // Make sure item ids are unique and monotonically increasing. + // This should always be the case, but some legacy Flowcharts may have issues. + List usedIds = new List(); + var blocks = GetComponents(); + for (int i = 0; i < blocks.Length; i++) + { + var block = blocks[i]; + if (block.ItemId == -1 || usedIds.Contains(block.ItemId)) + { + block.ItemId = NextItemId(); + } + usedIds.Add(block.ItemId); + } + + var commands = GetComponents(); + for (int i = 0; i < commands.Length; i++) + { + var command = commands[i]; + if (command.ItemId == -1 || usedIds.Contains(command.ItemId)) + { + command.ItemId = NextItemId(); + } + usedIds.Add(command.ItemId); + } + } + + protected virtual void CleanupComponents() + { + // Delete any unreferenced components which shouldn't exist any more + // Unreferenced components don't have any effect on the flowchart behavior, but + // they waste memory so should be cleared out periodically. + + // Remove any null entries in the variables list + // It shouldn't happen but it seemed to occur for a user on the forum + variables.RemoveAll(item => item == null); + + if (selectedBlocks == null) selectedBlocks = new List(); + if (selectedCommands == null) selectedCommands = new List(); + + selectedBlocks.RemoveAll(item => item == null); + selectedCommands.RemoveAll(item => item == null); + + var allVariables = GetComponents(); + for (int i = 0; i < allVariables.Length; i++) + { + var variable = allVariables[i]; + if (!variables.Contains(variable)) + { + DestroyImmediate(variable); + } + } + + var blocks = GetComponents(); + var commands = GetComponents(); + for (int i = 0; i < commands.Length; i++) + { + var command = commands[i]; + bool found = false; + for (int j = 0; j < blocks.Length; j++) + { + var block = blocks[j]; + if (block.CommandList.Contains(command)) + { + found = true; + break; + } + } + if (!found) + { + DestroyImmediate(command); + } + } + + var eventHandlers = GetComponents(); + for (int i = 0; i < eventHandlers.Length; i++) + { + var eventHandler = eventHandlers[i]; + bool found = false; + for (int j = 0; j < blocks.Length; j++) + { + var block = blocks[j]; + if (block._EventHandler == eventHandler) + { + found = true; + break; + } + } + if (!found) + { + DestroyImmediate(eventHandler); + } + } + } + + protected virtual Block CreateBlockComponent(GameObject parent) + { + Block block = parent.AddComponent(); + return block; + } + + #region Public members + + /// + /// Cached list of flowchart objects in the scene for fast lookup. + /// + public static List CachedFlowcharts { get { return cachedFlowcharts; } } + + /// + /// Sends a message to all Flowchart objects in the current scene. + /// Any block with a matching MessageReceived event handler will start executing. + /// + public static void BroadcastFungusMessage(string messageName) + { + var eventHandlers = UnityEngine.Object.FindObjectsOfType(); + for (int i = 0; i < eventHandlers.Length; i++) + { + var eventHandler = eventHandlers[i]; + eventHandler.OnSendFungusMessage(messageName); + } + } + + /// + /// Scroll position of Flowchart editor window. + /// + public virtual Vector2 ScrollPos { get { return scrollPos; } set { scrollPos = value; } } + + /// + /// Scroll position of Flowchart variables window. + /// + public virtual Vector2 VariablesScrollPos { get { return variablesScrollPos; } set { variablesScrollPos = value; } } + + /// + /// Show the variables pane. + /// + public virtual bool VariablesExpanded { get { return variablesExpanded; } set { variablesExpanded = value; } } + + /// + /// Height of command block view in inspector. + /// + public virtual float BlockViewHeight { get { return blockViewHeight; } set { blockViewHeight = value; } } + + /// + /// Zoom level of Flowchart editor window. + /// + public virtual float Zoom { get { return zoom; } set { zoom = value; } } + + /// + /// Scrollable area for Flowchart editor window. + /// + public virtual Rect ScrollViewRect { get { return scrollViewRect; } set { scrollViewRect = value; } } + + /// + /// Current actively selected block in the Flowchart editor. + /// + public virtual Block SelectedBlock + { + get + { + if (selectedBlocks == null || selectedBlocks.Count == 0) + return null; + + return selectedBlocks[0]; + } + set + { + ClearSelectedBlocks(); + AddSelectedBlock(value); + } + } + + public virtual List SelectedBlocks { get { return selectedBlocks; } set { selectedBlocks = value; } } + + /// + /// Currently selected command in the Flowchart editor. + /// + public virtual List SelectedCommands { get { return selectedCommands; } } + + /// + /// The list of variables that can be accessed by the Flowchart. + /// + public virtual List Variables { get { return variables; } } + + public virtual int VariableCount { get { return variables.Count; } } + + /// + /// Description text displayed in the Flowchart editor window + /// + public virtual string Description { get { return description; } } + + /// + /// Slow down execution in the editor to make it easier to visualise program flow. + /// + public virtual float StepPause { get { return stepPause; } } + + /// + /// Use command color when displaying the command list in the inspector. + /// + public virtual bool ColorCommands { get { return colorCommands; } } + + /// + /// Saves the selected block and commands when saving the scene. Helps avoid version control conflicts if you've only changed the active selection. + /// + public virtual bool SaveSelection { get { return saveSelection; } } + + /// + /// Unique identifier for identifying this flowchart in localized string keys. + /// + public virtual string LocalizationId { get { return localizationId; } } + + /// + /// Display line numbers in the command list in the Block inspector. + /// + public virtual bool ShowLineNumbers { get { return showLineNumbers; } } + + /// + /// Lua Environment to be used by default for all Execute Lua commands in this Flowchart. + /// + public virtual LuaEnvironment LuaEnv { get { return luaEnvironment; } } + + /// + /// The ExecuteLua command adds a global Lua variable with this name bound to the flowchart prior to executing. + /// + public virtual string LuaBindingName { get { return luaBindingName; } } + + /// + /// Position in the center of all blocks in the flowchart. + /// + public virtual Vector2 CenterPosition { set; get; } + + /// + /// Variable to track flowchart's version so components can update to new versions. + /// + public int Version { set { version = value; } } + + /// + /// Returns true if the Flowchart gameobject is active. + /// + public bool IsActive() + { + return gameObject.activeInHierarchy; + } + + /// + /// Returns the Flowchart gameobject name. + /// + public string GetName() + { + return gameObject.name; + } + + /// + /// Returns the next id to assign to a new flowchart item. + /// Item ids increase monotically so they are guaranteed to + /// be unique within a Flowchart. + /// + public int NextItemId() + { + int maxId = -1; + var blocks = GetComponents(); + for (int i = 0; i < blocks.Length; i++) + { + var block = blocks[i]; + maxId = Math.Max(maxId, block.ItemId); + } + + var commands = GetComponents(); + for (int i = 0; i < commands.Length; i++) + { + var command = commands[i]; + maxId = Math.Max(maxId, command.ItemId); + } + return maxId + 1; + } + + /// + /// Create a new block node which you can then add commands to. + /// + public virtual Block CreateBlock(Vector2 position) + { + Block b = CreateBlockComponent(gameObject); + b._NodeRect = new Rect(position.x, position.y, 0, 0); + b.BlockName = GetUniqueBlockKey(b.BlockName, b); + b.ItemId = NextItemId(); + + return b; + } + + /// + /// Returns the named Block in the flowchart, or null if not found. + /// + public virtual Block FindBlock(string blockName) + { + var blocks = GetComponents(); + for (int i = 0; i < blocks.Length; i++) + { + var block = blocks[i]; + if (block.BlockName == blockName) + { + return block; + } + } + + return null; + } + + /// + /// Checks availability of the block in the Flowchart. + /// You can use this method in a UI event. e.g. to test availability block, before handle it. + public virtual bool HasBlock(string blockName) + { + var block = FindBlock(blockName); + return block != null; + } + + /// + /// Executes the block if it is available in the Flowchart. + /// You can use this method in a UI event. e.g. to try executing block without confidence in its existence. + public virtual bool ExecuteIfHasBlock(string blockName) + { + if (HasBlock(blockName)) + { + ExecuteBlock(blockName); + return true; + } + else + { + return false; + } + } + + /// + /// Execute a child block in the Flowchart. + /// You can use this method in a UI event. e.g. to handle a button click. + public virtual void ExecuteBlock(string blockName) + { + var block = FindBlock(blockName); + + if (block == null) + { + Debug.LogError("Block " + blockName + " does not exist"); + return; + } + + if (!ExecuteBlock(block)) + { + Debug.LogWarning("Block " + blockName + " failed to execute"); + } + } + + /// + /// Stops an executing Block in the Flowchart. + /// + public virtual void StopBlock(string blockName) + { + var block = FindBlock(blockName); + + if (block == null) + { + Debug.LogError("Block " + blockName + " does not exist"); + return; + } + + if (block.IsExecuting()) + { + block.Stop(); + } + } + + /// + /// Execute a child block in the flowchart. + /// The block must be in an idle state to be executed. + /// This version provides extra options to control how the block is executed. + /// Returns true if the Block started execution. + /// + public virtual bool ExecuteBlock(Block block, int commandIndex = 0, Action onComplete = null) + { + if (block == null) + { + Debug.LogError("Block must not be null"); + return false; + } + + if (((Block)block).gameObject != gameObject) + { + Debug.LogError("Block must belong to the same gameobject as this Flowchart"); + return false; + } + + // Can't restart a running block, have to wait until it's idle again + if (block.IsExecuting()) + { + Debug.LogWarning(block.BlockName + " cannot be called/executed, it is already running."); + return false; + } + + // Start executing the Block as a new coroutine + StartCoroutine(block.Execute(commandIndex, onComplete)); + + return true; + } + + /// + /// Stop all executing Blocks in this Flowchart. + /// + public virtual void StopAllBlocks() + { + var blocks = GetComponents(); + for (int i = 0; i < blocks.Length; i++) + { + var block = blocks[i]; + if (block.IsExecuting()) + { + block.Stop(); + } + } + } + + /// + /// Sends a message to this Flowchart only. + /// Any block with a matching MessageReceived event handler will start executing. + /// + public virtual void SendFungusMessage(string messageName) + { + var eventHandlers = GetComponents(); + for (int i = 0; i < eventHandlers.Length; i++) + { + var eventHandler = eventHandlers[i]; + eventHandler.OnSendFungusMessage(messageName); + } + } + + /// + /// Returns a new variable key that is guaranteed not to clash with any existing variable in the list. + /// + public virtual string GetUniqueVariableKey(string originalKey, Variable ignoreVariable = null) + { + int suffix = 0; + string baseKey = originalKey; + + // Only letters and digits allowed + char[] arr = baseKey.Where(c => (char.IsLetterOrDigit(c) || c == '_')).ToArray(); + baseKey = new string(arr); + + // No leading digits allowed + baseKey = baseKey.TrimStart('0','1','2','3','4','5','6','7','8','9'); + + // No empty keys allowed + if (baseKey.Length == 0) + { + baseKey = "Var"; + } + + string key = baseKey; + while (true) + { + bool collision = false; + for (int i = 0; i < variables.Count; i++) + { + var variable = variables[i]; + if (variable == null || variable == ignoreVariable || variable.Key == null) + { + continue; + } + if (variable.Key.Equals(key, StringComparison.CurrentCultureIgnoreCase)) + { + collision = true; + suffix++; + key = baseKey + suffix; + } + } + + if (!collision) + { + return key; + } + } + } + + /// + /// Returns a new Block key that is guaranteed not to clash with any existing Block in the Flowchart. + /// + public virtual string GetUniqueBlockKey(string originalKey, Block ignoreBlock = null) + { + int suffix = 0; + string baseKey = originalKey.Trim(); + + // No empty keys allowed + if (baseKey.Length == 0) + { + baseKey = FungusConstants.DefaultBlockName; + } + + var blocks = GetComponents(); + + string key = baseKey; + while (true) + { + bool collision = false; + for (int i = 0; i < blocks.Length; i++) + { + var block = blocks[i]; + if (block == ignoreBlock || block.BlockName == null) + { + continue; + } + if (block.BlockName.Equals(key, StringComparison.CurrentCultureIgnoreCase)) + { + collision = true; + suffix++; + key = baseKey + suffix; + } + } + + if (!collision) + { + return key; + } + } + } + + /// + /// Returns a new Label key that is guaranteed not to clash with any existing Label in the Block. + /// + public virtual string GetUniqueLabelKey(string originalKey, Label ignoreLabel) + { + int suffix = 0; + string baseKey = originalKey.Trim(); + + // No empty keys allowed + if (baseKey.Length == 0) + { + baseKey = "New Label"; + } + + var block = ignoreLabel.ParentBlock; + + string key = baseKey; + while (true) + { + bool collision = false; + var commandList = block.CommandList; + for (int i = 0; i < commandList.Count; i++) + { + var command = commandList[i]; + Label label = command as Label; + if (label == null || label == ignoreLabel) + { + continue; + } + if (label.Key.Equals(key, StringComparison.CurrentCultureIgnoreCase)) + { + collision = true; + suffix++; + key = baseKey + suffix; + } + } + + if (!collision) + { + return key; + } + } + } + + /// + /// Returns the variable with the specified key, or null if the key is not found. + /// You will need to cast the returned variable to the correct sub-type. + /// You can then access the variable's value using the Value property. e.g. + /// BooleanVariable boolVar = flowchart.GetVariable("MyBool") as BooleanVariable; + /// boolVar.Value = false; + /// + public Variable GetVariable(string key) + { + for (int i = 0; i < variables.Count; i++) + { + var variable = variables[i]; + if (variable != null && variable.Key == key) + { + return variable; + } + } + + return null; + } + + /// + /// Returns the variable with the specified key, or null if the key is not found. + /// You can then access the variable's value using the Value property. e.g. + /// BooleanVariable boolVar = flowchart.GetVariable("MyBool"); + /// boolVar.Value = false; + /// + public T GetVariable(string key) where T : Variable + { + for (int i = 0; i < variables.Count; i++) + { + var variable = variables[i]; + if (variable != null && variable.Key == key) + { + return variable as T; + } + } + + Debug.LogWarning("Variable " + key + " not found."); + return null; + } + + /// + /// Returns a list of variables matching the specified type. + /// + public virtual List GetVariables() where T: Variable + { + var varsFound = new List(); + + for (int i = 0; i < Variables.Count; i++) + { + var currentVar = Variables[i]; + if (currentVar is T) + varsFound.Add(currentVar as T); + } + + return varsFound; + } + + /// + /// Register a new variable with the Flowchart at runtime. + /// The variable should be added as a component on the Flowchart game object. + /// + public void SetVariable(string key, T newvariable) where T : Variable + { + for (int i = 0; i < variables.Count; i++) + { + var v = variables[i]; + if (v != null && v.Key == key) + { + T variable = v as T; + if (variable != null) + { + variable = newvariable; + return; + } + } + } + + Debug.LogWarning("Variable " + key + " not found."); + } + + /// + /// Checks if a given variable exists in the flowchart. + /// + public virtual bool HasVariable(string key) + { + for (int i = 0; i < variables.Count; i++) + { + var v = variables[i]; + if (v != null && v.Key == key) + { + return true; + } + } + return false; + } + + /// + /// Returns the list of variable names in the Flowchart. + /// + public virtual string[] GetVariableNames() + { + var vList = new string[variables.Count]; + + for (int i = 0; i < variables.Count; i++) + { + var v = variables[i]; + if (v != null) + { + vList[i] = v.Key; + } + } + return vList; + } + + /// + /// Gets a list of all variables with public scope in this Flowchart. + /// + public virtual List GetPublicVariables() + { + var publicVariables = new List(); + for (int i = 0; i < variables.Count; i++) + { + var v = variables[i]; + if (v != null && v.Scope == VariableScope.Public) + { + publicVariables.Add(v); + } + } + + return publicVariables; + } + + /// + /// Gets the value of a boolean variable. + /// Returns false if the variable key does not exist. + /// + public virtual bool GetBooleanVariable(string key) + { + var variable = GetVariable(key); + if(variable != null) + { + return GetVariable(key).Value; + } + else + { + return false; + } + } + + /// + /// Sets the value of a boolean variable. + /// The variable must already be added to the list of variables for this Flowchart. + /// + public virtual void SetBooleanVariable(string key, bool value) + { + var variable = GetVariable(key); + if(variable != null) + { + variable.Value = value; + } + } + + /// + /// Gets the value of an integer variable. + /// Returns 0 if the variable key does not exist. + /// + public virtual int GetIntegerVariable(string key) + { + var variable = GetVariable(key); + if (variable != null) + { + return GetVariable(key).Value; + } + else + { + return 0; + } + } + + /// + /// Sets the value of an integer variable. + /// The variable must already be added to the list of variables for this Flowchart. + /// + public virtual void SetIntegerVariable(string key, int value) + { + var variable = GetVariable(key); + if (variable != null) + { + variable.Value = value; + } + } + + /// + /// Gets the value of a float variable. + /// Returns 0 if the variable key does not exist. + /// + public virtual float GetFloatVariable(string key) + { + var variable = GetVariable(key); + if (variable != null) + { + return GetVariable(key).Value; + } + else + { + return 0f; + } + } + + /// + /// Sets the value of a float variable. + /// The variable must already be added to the list of variables for this Flowchart. + /// + public virtual void SetFloatVariable(string key, float value) + { + var variable = GetVariable(key); + if (variable != null) + { + variable.Value = value; + } + } + + /// + /// Gets the value of a string variable. + /// Returns the empty string if the variable key does not exist. + /// + public virtual string GetStringVariable(string key) + { + var variable = GetVariable(key); + if (variable != null) + { + return GetVariable(key).Value; + } + else + { + return ""; + } + } + + /// + /// Sets the value of a string variable. + /// The variable must already be added to the list of variables for this Flowchart. + /// + public virtual void SetStringVariable(string key, string value) + { + var variable = GetVariable(key); + if (variable != null) + { + variable.Value = value; + } + } + + /// + /// Gets the value of a GameObject variable. + /// Returns null if the variable key does not exist. + /// + public virtual GameObject GetGameObjectVariable(string key) + { + var variable = GetVariable(key); + + if (variable != null) + { + return GetVariable(key).Value; + } + else + { + return null; + } + } + + /// + /// Sets the value of a GameObject variable. + /// The variable must already be added to the list of variables for this Flowchart. + /// + public virtual void SetGameObjectVariable(string key, GameObject value) + { + var variable = GetVariable(key); + if (variable != null) + { + variable.Value = value; + } + } + + /// + /// Gets the value of a Transform variable. + /// Returns null if the variable key does not exist. + /// + public virtual Transform GetTransformVariable(string key) + { + var variable = GetVariable(key); + + if (variable != null) + { + return GetVariable(key).Value; + } + else + { + return null; + } + } + + /// + /// Sets the value of a Transform variable. + /// The variable must already be added to the list of variables for this Flowchart. + /// + public virtual void SetTransformVariable(string key, Transform value) + { + var variable = GetVariable(key); + if (variable != null) + { + variable.Value = value; + } + } + + /// + /// Set the block objects to be hidden or visible depending on the hideComponents property. + /// + public virtual void UpdateHideFlags() + { + if (hideComponents) + { + var blocks = GetComponents(); + for (int i = 0; i < blocks.Length; i++) + { + var block = blocks[i]; + block.hideFlags = HideFlags.HideInInspector; + if (block.gameObject != gameObject) + { + block.hideFlags = HideFlags.HideInHierarchy; + } + } + + var commands = GetComponents(); + for (int i = 0; i < commands.Length; i++) + { + var command = commands[i]; + command.hideFlags = HideFlags.HideInInspector; + } + + var eventHandlers = GetComponents(); + for (int i = 0; i < eventHandlers.Length; i++) + { + var eventHandler = eventHandlers[i]; + eventHandler.hideFlags = HideFlags.HideInInspector; + } + } + else + { + var monoBehaviours = GetComponents(); + for (int i = 0; i < monoBehaviours.Length; i++) + { + var monoBehaviour = monoBehaviours[i]; + if (monoBehaviour == null) + { + continue; + } + monoBehaviour.hideFlags = HideFlags.None; + monoBehaviour.gameObject.hideFlags = HideFlags.None; + } + } + } + + /// + /// Clears the list of selected commands. + /// + public virtual void ClearSelectedCommands() + { + selectedCommands.Clear(); +#if UNITY_EDITOR + SelectedCommandsStale = true; +#endif + } + + /// + /// Adds a command to the list of selected commands. + /// + public virtual void AddSelectedCommand(Command command) + { + if (!selectedCommands.Contains(command)) + { + selectedCommands.Add(command); +#if UNITY_EDITOR + SelectedCommandsStale = true; +#endif + } + } + + /// + /// Clears the list of selected blocks. + /// + public virtual void ClearSelectedBlocks() + { + if(selectedBlocks == null) + { + selectedBlocks = new List(); + } + + for (int i = 0; i < selectedBlocks.Count; i++) + { + var item = selectedBlocks[i]; + + if(item != null) + { + item.IsSelected = false; + } + } + selectedBlocks.Clear(); + } + + /// + /// Adds a block to the list of selected blocks. + /// + public virtual void AddSelectedBlock(Block block) + { + if (!selectedBlocks.Contains(block)) + { + block.IsSelected = true; + selectedBlocks.Add(block); + } + } + + public virtual bool DeselectBlock(Block block) + { + if (selectedBlocks.Contains(block)) + { + DeselectBlockNoCheck(block); + return true; + } + return false; + } + + public virtual void DeselectBlockNoCheck(Block b) + { + b.IsSelected = false; + selectedBlocks.Remove(b); + } + + public void UpdateSelectedCache() + { + selectedBlocks.Clear(); + var res = gameObject.GetComponents(); + selectedBlocks = res.Where(x => x.IsSelected).ToList(); + } + + public void ReverseUpdateSelectedCache() + { + for (int i = 0; i < selectedBlocks.Count; i++) + { + if(selectedBlocks[i] != null) + { + selectedBlocks[i].IsSelected = true; + } + } + } + + /// + /// Reset the commands and variables in the Flowchart. + /// + public virtual void Reset(bool resetCommands, bool resetVariables) + { + if (resetCommands) + { + var commands = GetComponents(); + for (int i = 0; i < commands.Length; i++) + { + var command = commands[i]; + command.OnReset(); + } + } + + if (resetVariables) + { + for (int i = 0; i < variables.Count; i++) + { + var variable = variables[i]; + variable.OnReset(); + } + } + } + + /// + /// Override this in a Flowchart subclass to filter which commands are shown in the Add Command list. + /// + public virtual bool IsCommandSupported(CommandInfoAttribute commandInfo) + { + for (int i = 0; i < hideCommands.Count; i++) + { + // Match on category or command name (case insensitive) + var key = hideCommands[i]; + if (String.Compare(commandInfo.Category, key, StringComparison.OrdinalIgnoreCase) == 0 || String.Compare(commandInfo.CommandName, key, StringComparison.OrdinalIgnoreCase) == 0) + { + return false; + } + } + + return true; + } + + /// + /// Returns true if there are any executing blocks in this Flowchart. + /// + public virtual bool HasExecutingBlocks() + { + var blocks = GetComponents(); + for (int i = 0; i < blocks.Length; i++) + { + var block = blocks[i]; + if (block.IsExecuting()) + { + return true; + } + } + return false; + } + + /// + /// Returns a list of all executing blocks in this Flowchart. + /// + public virtual List GetExecutingBlocks() + { + var executingBlocks = new List(); + var blocks = GetComponents(); + for (int i = 0; i < blocks.Length; i++) + { + var block = blocks[i]; + if (block.IsExecuting()) + { + executingBlocks.Add(block); + } + } + + return executingBlocks; + } + + /// + /// Substitute variables in the input text with the format {$VarName} + /// This will first match with private variables in this Flowchart, and then + /// with public variables in all Flowcharts in the scene (and any component + /// in the scene that implements StringSubstituter.ISubstitutionHandler). + /// + public virtual string SubstituteVariables(string input) + { + if (stringSubstituer == null) + { + stringSubstituer = new StringSubstituter(); + } + + // Use the string builder from StringSubstituter for efficiency. + StringBuilder sb = stringSubstituer._StringBuilder; + sb.Length = 0; + sb.Append(input); + + // Instantiate the regular expression object. + Regex r = new Regex(SubstituteVariableRegexString); + + bool changed = false; + + // Match the regular expression pattern against a text string. + var results = r.Matches(input); + for (int i = 0; i < results.Count; i++) + { + Match match = results[i]; + string key = match.Value.Substring(2, match.Value.Length - 3); + // Look for any matching private variables in this Flowchart first + for (int j = 0; j < variables.Count; j++) + { + var variable = variables[j]; + if (variable == null) + continue; + if (variable.Scope == VariableScope.Private && variable.Key == key) + { + string value = variable.ToString(); + sb.Replace(match.Value, value); + changed = true; + } + } + } + + // Now do all other substitutions in the scene + changed |= stringSubstituer.SubstituteStrings(sb); + + if (changed) + { + return sb.ToString(); + } + else + { + return input; + } + } + + public virtual void DetermineSubstituteVariables(string str, List vars) + { + Regex r = new Regex(Flowchart.SubstituteVariableRegexString); + + // Match the regular expression pattern against a text string. + var results = r.Matches(str); + for (int i = 0; i < results.Count; i++) + { + var match = results[i]; + var v = GetVariable(match.Value.Substring(2, match.Value.Length - 3)); + if (v != null) + { + vars.Add(v); + } + } + } + + #endregion + + #region IStringSubstituter implementation + + /// + /// Implementation of StringSubstituter.ISubstitutionHandler which matches any public variable in the Flowchart. + /// To perform full variable substitution with all substitution handlers in the scene, you should + /// use the SubstituteVariables() method instead. + /// + [MoonSharp.Interpreter.MoonSharpHidden] + public virtual bool SubstituteStrings(StringBuilder input) + { + // Instantiate the regular expression object. + Regex r = new Regex(SubstituteVariableRegexString); + + bool modified = false; + + // Match the regular expression pattern against a text string. + var results = r.Matches(input.ToString()); + for (int i = 0; i < results.Count; i++) + { + Match match = results[i]; + string key = match.Value.Substring(2, match.Value.Length - 3); + // Look for any matching public variables in this Flowchart + for (int j = 0; j < variables.Count; j++) + { + var variable = variables[j]; + if (variable == null) + { + continue; + } + if (variable.Scope == VariableScope.Public && variable.Key == key) + { + string value = variable.ToString(); + input.Replace(match.Value, value); + modified = true; + } + } + } + + return modified; + } + + #endregion + } +} diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/Flowchart.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Components/Flowchart.cs.meta new file mode 100644 index 0000000..c6e53bd --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/Flowchart.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7a334fe2ffb574b3583ff3b18b4792d3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/FungusManager.cs b/Fungus Basics/Assets/Fungus/Scripts/Components/FungusManager.cs new file mode 100644 index 0000000..477ef9b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/FungusManager.cs @@ -0,0 +1,121 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using System.Collections; + +namespace Fungus +{ + /// + /// Fungus manager singleton. Manages access to all Fungus singletons in a consistent manner. + /// + [RequireComponent(typeof(CameraManager))] + [RequireComponent(typeof(MusicManager))] + [RequireComponent(typeof(EventDispatcher))] + [RequireComponent(typeof(GlobalVariables))] +#if UNITY_5_3_OR_NEWER + [RequireComponent(typeof(SaveManager))] + [RequireComponent(typeof(NarrativeLog))] + #endif + public sealed class FungusManager : MonoBehaviour + { + volatile static FungusManager instance; // The keyword "volatile" is friendly to the multi-thread. + static bool applicationIsQuitting = false; + readonly static object _lock = new object(); // The keyword "readonly" is friendly to the multi-thread. + + void Awake() + { + CameraManager = GetComponent(); + MusicManager = GetComponent(); + EventDispatcher = GetComponent(); + GlobalVariables = GetComponent(); +#if UNITY_5_3_OR_NEWER + SaveManager = GetComponent(); + NarrativeLog = GetComponent(); + #endif + } + + /// + /// When Unity quits, it destroys objects in a random order. + /// In principle, a Singleton is only destroyed when application quits. + /// If any script calls Instance after it have been destroyed, + /// it will create a buggy ghost object that will stay on the Editor scene + /// even after stopping playing the Application. Really bad! + /// So, this was made to be sure we're not creating that buggy ghost object. + /// + void OnDestroy () + { + applicationIsQuitting = true; + } + + #region Public methods + + /// + /// Gets the camera manager singleton instance. + /// + public CameraManager CameraManager { get; private set; } + + /// + /// Gets the music manager singleton instance. + /// + public MusicManager MusicManager { get; private set; } + + /// + /// Gets the event dispatcher singleton instance. + /// + public EventDispatcher EventDispatcher { get; private set; } + + /// + /// Gets the global variable singleton instance. + /// + public GlobalVariables GlobalVariables { get; private set; } + +#if UNITY_5_3_OR_NEWER + /// + /// Gets the save manager singleton instance. + /// + public SaveManager SaveManager { get; private set; } + + /// + /// Gets the history manager singleton instance. + /// + public NarrativeLog NarrativeLog { get; private set; } + + #endif + + /// + /// Gets the FungusManager singleton instance. + /// + public static FungusManager Instance + { + get + { + if (applicationIsQuitting) + { + Debug.LogWarning("FungusManager.Instance() was called while application is quitting. Returning null instead."); + return null; + } + + // Use "double checked locking" algorithm to implement the singleton for this "FungusManager" class, which can improve performance. + if (instance == null) + { + lock (_lock) + { + if (instance == null) + { + var go = new GameObject(); + go.name = "FungusManager"; + DontDestroyOnLoad(go); + instance = go.AddComponent(); + } + + } + } + + return instance; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/FungusManager.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Components/FungusManager.cs.meta new file mode 100644 index 0000000..d643e8a --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/FungusManager.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fa59a268bb22b4646bd9a89fa66582b1 +timeCreated: 1475164406 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/FungusState.cs b/Fungus Basics/Assets/Fungus/Scripts/Components/FungusState.cs new file mode 100644 index 0000000..4d2a351 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/FungusState.cs @@ -0,0 +1,26 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// Used by the Flowchart window to serialize the currently active Flowchart object + /// so that the same Flowchart can be displayed while editing & playing. + /// + [AddComponentMenu("")] + public class FungusState : MonoBehaviour + { + [SerializeField] protected Flowchart selectedFlowchart; + + #region Public members + + /// + /// The currently selected Flowchart. + /// + public virtual Flowchart SelectedFlowchart { get { return selectedFlowchart; } set { selectedFlowchart = value; } } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/FungusState.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Components/FungusState.cs.meta new file mode 100644 index 0000000..73f9adb --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/FungusState.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 61dddfdc5e0e44ca298d8f46f7f5a915 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/Localization.cs b/Fungus Basics/Assets/Fungus/Scripts/Components/Localization.cs new file mode 100644 index 0000000..f8c296b --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/Localization.cs @@ -0,0 +1,587 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif +using System.Collections.Generic; +using System.Text.RegularExpressions; +using System.Text; +using Ideafixxxer.CsvParser; + +namespace Fungus +{ + /// + /// Multi-language localization support. + /// + public class Localization : MonoBehaviour, ISubstitutionHandler + { + /// + /// Temp storage for a single item of standard text and its localizations. + /// + protected class TextItem + { + public string description = ""; + public string standardText = ""; + public Dictionary localizedStrings = new Dictionary(); + } + + [Tooltip("Language to use at startup, usually defined by a two letter language code (e.g DE = German)")] + [SerializeField] protected string activeLanguage = ""; + + [Tooltip("CSV file containing localization data which can be easily edited in a spreadsheet tool")] + [SerializeField] protected TextAsset localizationFile; + + protected Dictionary localizeableObjects = new Dictionary(); + + protected string notificationText = ""; + + protected bool initialized; + + protected static Dictionary localizedStrings = new Dictionary(); + + #if UNITY_5_4_OR_NEWER + #else + public virtual void OnLevelWasLoaded(int level) + { + LevelWasLoaded(); + } + #endif + + protected virtual void LevelWasLoaded() + { + // Check if a language has been selected using the Set Language command in a previous scene. + if (SetLanguage.mostRecentLanguage != "") + { + // This language will be used when Start() is called + activeLanguage = SetLanguage.mostRecentLanguage; + } + } + + private void SceneManager_activeSceneChanged(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.Scene arg1) + { + LevelWasLoaded(); + } + + protected virtual void OnEnable() + { + StringSubstituter.RegisterHandler(this); + #if UNITY_5_4_OR_NEWER + UnityEngine.SceneManagement.SceneManager.activeSceneChanged += SceneManager_activeSceneChanged; + #endif + } + + protected virtual void OnDisable() + { + StringSubstituter.UnregisterHandler(this); + #if UNITY_5_4_OR_NEWER + UnityEngine.SceneManagement.SceneManager.activeSceneChanged -= SceneManager_activeSceneChanged; + #endif + } + + protected virtual void Start() + { + Init(); + } + + /// + /// String subsitution can happen during the Start of another component, so we + /// may need to call Init() from other methods. + /// + protected virtual void Init() + { + if (initialized) + { + return; + } + + CacheLocalizeableObjects(); + + if (localizationFile != null && + localizationFile.text.Length > 0) + { + SetActiveLanguage(activeLanguage); + } + + initialized = true; + } + + // Build a cache of all the localizeable objects in the scene + protected virtual void CacheLocalizeableObjects() + { + UnityEngine.Object[] objects = Resources.FindObjectsOfTypeAll(typeof(Component)); + for (int i = 0; i < objects.Length; i++) + { + var o = objects[i]; + ILocalizable localizable = o as ILocalizable; + if (localizable != null) + { + localizeableObjects[localizable.GetStringId()] = localizable; + } + } + } + + /// + /// Builds a dictionary of localizable text items in the scene. + /// + protected Dictionary FindTextItems() + { + Dictionary textItems = new Dictionary(); + + // Add localizable commands in same order as command list to make it + // easier to localise / edit standard text. + var flowcharts = GameObject.FindObjectsOfType(); + for (int i = 0; i < flowcharts.Length; i++) + { + var flowchart = flowcharts[i]; + var blocks = flowchart.GetComponents(); + + for (int j = 0; j < blocks.Length; j++) + { + var block = blocks[j]; + var commandList = block.CommandList; + for (int k = 0; k < commandList.Count; k++) + { + var command = commandList[k]; + ILocalizable localizable = command as ILocalizable; + if (localizable != null) + { + TextItem textItem = new TextItem(); + textItem.standardText = localizable.GetStandardText(); + textItem.description = localizable.GetDescription(); + textItems[localizable.GetStringId()] = textItem; + } + } + } + } + + // Add everything else that's localizable (including inactive objects) + UnityEngine.Object[] objects = Resources.FindObjectsOfTypeAll(typeof(Component)); + for (int i = 0; i < objects.Length; i++) + { + var o = objects[i]; + ILocalizable localizable = o as ILocalizable; + if (localizable != null) + { + string stringId = localizable.GetStringId(); + if (textItems.ContainsKey(stringId)) + { + // Already added + continue; + } + TextItem textItem = new TextItem(); + textItem.standardText = localizable.GetStandardText(); + textItem.description = localizable.GetDescription(); + textItems[stringId] = textItem; + } + } + + return textItems; + } + + /// + /// Adds localized strings from CSV file data to a dictionary of text items in the scene. + /// + protected virtual void AddCSVDataItems(Dictionary textItems, string csvData) + { + CsvParser csvParser = new CsvParser(); + string[][] csvTable = csvParser.Parse(csvData); + + if (csvTable.Length <= 1) + { + // No data rows in file + return; + } + + // Parse header row + string[] columnNames = csvTable[0]; + + for (int i = 1; i < csvTable.Length; ++i) + { + string[] fields = csvTable[i]; + if (fields.Length < 3) + { + // No standard text or localized string fields present + continue; + } + + string stringId = fields[0]; + + if (!textItems.ContainsKey(stringId)) + { + if (stringId.StartsWith("CHARACTER.") || + stringId.StartsWith("SAY.") || + stringId.StartsWith("MENU.") || + stringId.StartsWith("WRITE.") || + stringId.StartsWith("SETTEXT.")) + { + // If it's a 'built-in' type this probably means that item has been deleted from its flowchart, + // so there's no need to add a text item for it. + continue; + } + + // Key not found. Assume it's a custom string that we want to retain, so add a text item for it. + TextItem newTextItem = new TextItem(); + newTextItem.description = CSVSupport.Unescape(fields[1]); + newTextItem.standardText = CSVSupport.Unescape(fields[2]); + textItems[stringId] = newTextItem; + } + + TextItem textItem = textItems[stringId]; + + for (int j = 3; j < fields.Length; ++j) + { + if (j >= columnNames.Length) + { + continue; + } + string languageCode = columnNames[j]; + string languageEntry = CSVSupport.Unescape(fields[j]); + + if (languageEntry.Length > 0) + { + textItem.localizedStrings[languageCode] = languageEntry; + } + } + } + } + + #region Public members + + /// + /// Looks up the specified string in the localized strings table. + /// For this to work, a localization file and active language must have been set previously. + /// Return null if the string is not found. + /// + public static string GetLocalizedString(string stringId) + { + if (localizedStrings == null) + { + return null; + } + + if (localizedStrings.ContainsKey(stringId)) + { + return localizedStrings[stringId]; + } + + return null; + } + + /// + /// Language to use at startup, usually defined by a two letter language code (e.g DE = German). + /// + public virtual string ActiveLanguage { get { return activeLanguage; } } + + /// + /// CSV file containing localization data which can be easily edited in a spreadsheet tool. + /// + public virtual TextAsset LocalizationFile { get { return localizationFile; } set { localizationFile = value; } } + + /// + /// Stores any notification message from export / import methods. + /// + public virtual string NotificationText { get { return notificationText; } set { notificationText = value; } } + + /// + /// Clears the cache of localizeable objects. + /// + public virtual void ClearLocalizeableCache() + { + localizeableObjects.Clear(); + } + + /// + /// Convert all text items and localized strings to an easy to edit CSV format. + /// + public virtual string GetCSVData() + { + // Collect all the text items present in the scene + Dictionary textItems = FindTextItems(); + + // Update text items with localization data from CSV file + if (localizationFile != null && + localizationFile.text.Length > 0) + { + AddCSVDataItems(textItems, localizationFile.text); + } + + // Build CSV header row and a list of the language codes currently in use + string csvHeader = "Key,Description,Standard"; + var languageCodes = new List(); + var values = textItems.Values; + foreach (var textItem in values) + { + foreach (string languageCode in textItem.localizedStrings.Keys) + { + if (!languageCodes.Contains(languageCode)) + { + languageCodes.Add(languageCode); + csvHeader += "," + languageCode; + } + } + } + + // Build the CSV file using collected text items + int rowCount = 0; + string csvData = csvHeader + "\n"; + var keys = textItems.Keys; + foreach (var stringId in keys) + { + TextItem textItem = textItems[stringId]; + + string row = CSVSupport.Escape(stringId); + row += "," + CSVSupport.Escape(textItem.description); + row += "," + CSVSupport.Escape(textItem.standardText); + + for (int i = 0; i < languageCodes.Count; i++) + { + var languageCode = languageCodes[i]; + if (textItem.localizedStrings.ContainsKey(languageCode)) + { + row += "," + CSVSupport.Escape(textItem.localizedStrings[languageCode]); + } + else + { + row += ","; + // Empty field + } + } + + csvData += row + "\n"; + rowCount++; + } + + notificationText = "Exported " + rowCount + " localization text items."; + + return csvData; + } + + /// + /// Scan a localization CSV file and copies the strings for the specified language code + /// into the text properties of the appropriate scene objects. + /// + public virtual void SetActiveLanguage(string languageCode, bool forceUpdateSceneText = false) + { + if (!Application.isPlaying) + { + // This function should only ever be called when the game is playing (not in editor). + return; + } + + if (localizationFile == null) + { + // No localization file set + return; + } + + localizedStrings.Clear(); + + CsvParser csvParser = new CsvParser(); + string[][] csvTable = csvParser.Parse(localizationFile.text); + + if (csvTable.Length <= 1) + { + // No data rows in file + return; + } + + // Parse header row + string[] columnNames = csvTable[0]; + + if (columnNames.Length < 3) + { + // No languages defined in CSV file + return; + } + + // First assume standard text column and then look for a matching language column + int languageIndex = 2; + for (int i = 3; i < columnNames.Length; ++i) + { + if (columnNames[i] == languageCode) + { + languageIndex = i; + break; + } + } + + if (languageIndex == 2) + { + // Using standard text column + // Add all strings to the localized strings dict, but don't replace standard text in the scene. + // This allows string substitution to work for both standard and localized text strings. + for (int i = 1; i < csvTable.Length; ++i) + { + string[] fields = csvTable[i]; + if (fields.Length < 3) + { + continue; + } + + localizedStrings[fields[0]] = fields[languageIndex]; + } + + // Early out unless we've been told to force the scene text to update. + // This happens when the Set Language command is used to reset back to the standard language. + if (!forceUpdateSceneText) + { + return; + } + } + + // Using a localized language text column + // 1. Add all localized text to the localized strings dict + // 2. Update all scene text properties with localized versions + for (int i = 1; i < csvTable.Length; ++i) + { + string[] fields = csvTable[i]; + + if (fields.Length < languageIndex + 1) + { + continue; + } + + string stringId = fields[0]; + string languageEntry = CSVSupport.Unescape(fields[languageIndex]); + + if (languageEntry.Length > 0) + { + localizedStrings[stringId] = languageEntry; + PopulateTextProperty(stringId, languageEntry); + } + } + } + + /// + /// Populates the text property of a single scene object with a new text value. + /// + public virtual bool PopulateTextProperty(string stringId, string newText) + { + // Ensure that all localizeable objects have been cached + if (localizeableObjects.Count == 0) + { + CacheLocalizeableObjects(); + } + + ILocalizable localizable = null; + localizeableObjects.TryGetValue(stringId, out localizable); + if (localizable != null) + { + localizable.SetStandardText(newText); + return true; + } + + return false; + } + + /// + /// Returns all standard text for localizeable text in the scene using an + /// easy to edit custom text format. + /// + public virtual string GetStandardText() + { + // Collect all the text items present in the scene + Dictionary textItems = FindTextItems(); + + string textData = ""; + int rowCount = 0; + var keys = textItems.Keys; + foreach (var stringId in keys) + { + TextItem languageItem = textItems[stringId]; + + textData += "#" + stringId + "\n"; + textData += languageItem.standardText.Trim() + "\n\n"; + rowCount++; + } + + notificationText = "Exported " + rowCount + " standard text items."; + + return textData; + } + + /// + /// Sets standard text on scene objects by parsing a text data file. + /// + public virtual void SetStandardText(string textData) + { + var lines = textData.Split('\n'); + + int updatedCount = 0; + + string stringId = ""; + string buffer = ""; + for (int i = 0; i < lines.Length; i++) + { + // Check for string id line + var line = lines[i]; + if (line.StartsWith("#")) + { + if (stringId.Length > 0) + { + // Write buffered text to the appropriate text property + if (PopulateTextProperty(stringId, buffer.Trim())) + { + updatedCount++; + } + } + // Set the string id for the follow text lines + stringId = line.Substring(1, line.Length - 1); + buffer = ""; + } + else + { + buffer += line + "\n"; + } + } + + // Handle last buffered entry + if (stringId.Length > 0) + { + if (PopulateTextProperty(stringId, buffer.Trim())) + { + updatedCount++; + } + } + + notificationText = "Updated " + updatedCount + " standard text items."; + } + + #endregion + + #region StringSubstituter.ISubstitutionHandler imlpementation + + public virtual bool SubstituteStrings(StringBuilder input) + { + // This method could be called from the Start method of another component, so we + // may need to initilize the localization system. + Init(); + + // Instantiate the regular expression object. + Regex r = new Regex(Flowchart.SubstituteVariableRegexString); + + bool modified = false; + + // Match the regular expression pattern against a text string. + var results = r.Matches(input.ToString()); + for (int i = 0; i < results.Count; i++) + { + Match match = results[i]; + string key = match.Value.Substring(2, match.Value.Length - 3); + // Next look for matching localized string + string localizedString = Localization.GetLocalizedString(key); + if (localizedString != null) + { + input.Replace(match.Value, localizedString); + modified = true; + } + } + + return modified; + } + + #endregion + } +} \ No newline at end of file diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/Localization.cs.meta b/Fungus Basics/Assets/Fungus/Scripts/Components/Localization.cs.meta new file mode 100644 index 0000000..f3417a1 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/Localization.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e5724422a635e425bae0af9ffe2615d6 +timeCreated: 1427886378 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fungus Basics/Assets/Fungus/Scripts/Components/MenuDialog.cs b/Fungus Basics/Assets/Fungus/Scripts/Components/MenuDialog.cs new file mode 100644 index 0000000..f2f2be5 --- /dev/null +++ b/Fungus Basics/Assets/Fungus/Scripts/Components/MenuDialog.cs @@ -0,0 +1,431 @@ +// This code is part of the Fungus library (https://github.com/snozbot/fungus) +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.UI; +using System.Collections; +using UnityEngine.EventSystems; +using System.Linq; +using MoonSharp.Interpreter; + +namespace Fungus +{ + /// + /// Presents multiple choice buttons to the players. + /// + public class MenuDialog : MonoBehaviour + { + [Tooltip("Automatically select the first interactable button when the menu is shown.")] + [SerializeField] protected bool autoSelectFirstButton = false; + + protected Button[] cachedButtons; + + protected Slider cachedSlider; + private int nextOptionIndex; + + #region Public members + + /// + /// Currently active Menu Dialog used to display Menu options + /// + public static MenuDialog ActiveMenuDialog { get; set; } + + /// + /// A cached list of button objects in the menu dialog. + /// + /// The cached buttons. + public virtual Button[] CachedButtons { get { return cachedButtons; } } + + /// + /// A cached slider object used for the timer in the menu dialog. + /// + /// The cached slider. + public virtual Slider CachedSlider { get { return cachedSlider; } } + + /// + /// Sets the active state of the Menu Dialog gameobject. + /// + public virtual void SetActive(bool state) + { + gameObject.SetActive(state); + } + + + + /// + /// Returns a menu dialog by searching for one in the scene or creating one if none exists. + /// + public static MenuDialog GetMenuDialog() + { + if (ActiveMenuDialog == null) + { + // Use first Menu Dialog found in the scene (if any) + var md = GameObject.FindObjectOfType(); + if (md != null) + { + ActiveMenuDialog = md; + } + + if (ActiveMenuDialog == null) + { + // Auto spawn a menu dialog object from the prefab + GameObject prefab = Resources.Load("Prefabs/MenuDialog"); + if (prefab != null) + { + GameObject go = Instantiate(prefab) as GameObject; + go.SetActive(false); + go.name = "MenuDialog"; + ActiveMenuDialog = go.GetComponent(); + } + } + } + + return ActiveMenuDialog; + } + + protected virtual void Awake() + { + Button[] optionButtons = GetComponentsInChildren