fungus

Open full view…

Enabling Clickable2D bools

Shane Whelan
Thu, 12 Mar 2015 21:06:11 GMT

I added this under Sprite commands to prevent certain objects from being clicked accidentally while a dialog UI was running: using UnityEngine; using System; using System.Collections; using Fungus; namespace Fungus { [CommandInfo("Sprite", "Enable Clickable2D", "Enables or disables a Clickable2D component, without completely deactivating it, to control the player's access to it.")] public class ClickableSpriteEnabler : Command { [Tooltip("The object to be enabled")] public Clickable2D clickable2DObject; [Tooltip("Enable or disable the Clickable2D sprite")] public bool enabled = true; public override void OnEnter() { clickable2DObject.clickEnabled = enabled; } public override string GetSummary() { if (clickable2DObject == null) { return "No Clickable2D object selected"; } else { string status =""; switch (enabled) { case true: status = " | [ON] "; break; case false: status = " | [OFF] "; break; } string summary = " " + clickable2DObject.name + status; return summary; } } } }

chrisgregan
Thu, 12 Mar 2015 22:28:58 GMT

Thanks for that Shane! I've actually added something sorta similar in the latest Fungus code, will be in the next release. My one works by disabling the Collider2D, but maybe your idea of toggling a flag on the Clickable2D component is a better way to do it.

Shane Whelan
Thu, 12 Mar 2015 23:29:46 GMT

I love the structure of Fungus. I've made a couple of simple things like this now and I'm finding it really easy to extend it, because you have to encompass a single idea in that command format. Has anyone made an inventory package with a UI yet, by any chance? I'm leaning more towards Point & Click adventure types than the RPG setup that Fungus has by default. I'd love to make a SCUMM style control panel UI, with Give, Talk to, Use, etc. If it already exists among the community, I don't want to reinvent the wheel, though.

Shane Whelan
Thu, 12 Mar 2015 23:34:01 GMT

The summary feature on the command bar is a lovely bit of design. It all comes back to fast editing. I've always said that design is 20% adding new things to a blank page and 80% shuffling them around the place.

chrisgregan
Thu, 12 Mar 2015 23:43:16 GMT

Remember the text export / import stuff I was showing you at GDC? I've changed it to use the Fountain script writing format. I think you're going to like it… http://fountain.io

Shane Whelan
Fri, 13 Mar 2015 00:56:47 GMT

Cool. The Students have started using it now

chrisgregan
Fri, 13 Mar 2015 22:29:31 GMT

yay! make sure they send on whatever they make, just post it in the forum!