Browse Source

Add option to disable menu

master
lealeelu 8 years ago
parent
commit
8b06f173d2
  1. 1113
      Assets/Fungus/Resources/Prefabs/SaveMenu.prefab
  2. 32
      Assets/Fungus/Scripts/Components/NarrativeLogMenu.cs
  3. 5760
      Assets/FungusExamples/Conversation/Say History.unity

1113
Assets/Fungus/Resources/Prefabs/SaveMenu.prefab

File diff suppressed because it is too large Load Diff

32
Assets/Fungus/Scripts/Components/NarrativeLogMenu.cs

@ -14,8 +14,11 @@ namespace Fungus
/// </summary> /// </summary>
public class NarrativeLogMenu : MonoBehaviour public class NarrativeLogMenu : MonoBehaviour
{ {
[Tooltip("The button that shows conversation history.")] [Tooltip("Show the Narrative Log Menu")]
[SerializeField] protected Button narrativeLogButton; [SerializeField] protected bool showLog = true;
[Tooltip("Show previous lines instead of previous and current")]
[SerializeField] protected bool previousLines = true;
[Tooltip("A scrollable text field used for displaying conversation history.")] [Tooltip("A scrollable text field used for displaying conversation history.")]
[SerializeField] protected ScrollRect narrativeLogView; [SerializeField] protected ScrollRect narrativeLogView;
@ -33,18 +36,27 @@ namespace Fungus
protected virtual void Awake() protected virtual void Awake()
{ {
// Only one instance of NarrativeLogMenu may exist if (showLog)
if (instance != null)
{ {
Destroy(gameObject); // Only one instance of NarrativeLogMenu may exist
return; if (instance != null)
} {
Destroy(gameObject);
return;
}
instance = this; instance = this;
GameObject.DontDestroyOnLoad(this); GameObject.DontDestroyOnLoad(this);
clickAudioSource = GetComponent<AudioSource>(); clickAudioSource = GetComponent<AudioSource>();
}
else
{
GameObject logView = GameObject.Find("NarrativeLogView");
logView.SetActive(false);
this.enabled = false;
}
} }
protected virtual void Start() protected virtual void Start()

5760
Assets/FungusExamples/Conversation/Say History.unity

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save