using UnityEngine;
using ORKFramework;
using ORKFramework.Menu;
using ORKFramework.Reflection;
using ORKFramework.Behaviours;
using System.Collections.Generic;
namespace ORKFramework.Events.Steps
{
[ORKEditorHelp("Gameflow Settings", "Gameflow Settings", "")]
[ORKEventStep(typeof(BaseEvent))]
[ORKNodeInfo("Animmal/Game")]
public class GameflowSettingsStep : BaseEventStep
{
public enum GAMEFLOWPRESETS { DialogueStart, DialogueEnd }
[ORKEditorLayout("CustomSettings", false, endCheckGroup = true, autoInit = true)]
public GAMEFLOWPRESETS Presets = GAMEFLOWPRESETS.DialogueStart;
[ORKEditorHelp("Use Custom Settings", "If enabled, custom settings will be used instead of preset", "")]
public bool CustomSettings = false;
[ORKEditorLayout("CustomSettings", true, endCheckGroup = true, autoInit = true)]
[ORKEditorHelp("Use Player Block", "If enabled, player block options will be applied", "")]
[ORKEditorInfo(separator = true)]
public bool UsePlayerBlock = false;
[ORKEditorLayout("UsePlayerBlock", true, endCheckGroup = true, autoInit = true)]
[ORKEditorHelp("Block/Unblock", "If enabled, the player control will be blocked.\n" +
"If disabled, the player control will be unblocked.", "")]
public bool PlayerBlock = false;
[ORKEditorLayout("CustomSettings", true, endCheckGroup = true, autoInit = true)]
[ORKEditorHelp("Use Camera Block", "If enabled, camera block options will be applied", "")]
[ORKEditorInfo(separator = true)]
public bool UseCameraBlock = false;
[ORKEditorLayout("UseCameraBlock", true, endCheckGroup = true, autoInit = true)]
[ORKEditorHelp("Block/Unblock", "If enabled, the camera control will be blocked.\n" +
"If disabled, the camera control will be unblocked.", "")]
public bool CameraBlock = false;
[ORKEditorLayout("CustomSettings", true, endCheckGroup = true, autoInit = true)]
[ORKEditorHelp("Use Fade", "If enabled, fade options will be applied", "")]
[ORKEditorInfo(separator = true)]
public bool UseFade = false;
[ORKEditorLayout("UseFade", true, endCheckGroup = true, autoInit = true)]
[ORKEditorHelp("Wait", "Wait until fading has finished before the next step is executed.", "")]
public bool wait = false;
[ORKEditorLayout("UseFade", true, endCheckGroup = true, autoInit = true)]
[ORKEditorInfo(separator = true)]
public FadeColorSettings FadeColor = new FadeColorSettings();
public GameflowSettingsStep()
{
}
public override void Execute(BaseEvent baseEvent)
{
if (CustomSettings == false)
{
FadeColorSettings _FadeColor = new FadeColorSettings();
switch (Presets)
{
case GAMEFLOWPRESETS.DialogueStart:
baseEvent.DoCameraBlock(1);
baseEvent.DoPlayerBlock(1);
_FadeColor.alpha = true;
_FadeColor.startColor = new Color(0, 0, 0, 0);
_FadeColor.endColor = new Color(0, 0, 0, 1);
ORK.GUI.ScreenFader.FadeScreen(_FadeColor);
wait = true;
break;
case GAMEFLOWPRESETS.DialogueEnd:
baseEvent.DoCameraBlock(0);
baseEvent.DoPlayerBlock(0);
_FadeColor.alpha = true;
_FadeColor.startColor = new Color(0, 0, 0, 1);
_FadeColor.endColor = new Color(0, 0, 0, 0);
ORK.GUI.ScreenFader.FadeScreen(_FadeColor);
wait = true;
break;
default:
break;
}
}
else
{
if (UseCameraBlock)
baseEvent.DoCameraBlock(this.CameraBlock ? 1 : -1);
if (UsePlayerBlock)
baseEvent.DoPlayerBlock(this.PlayerBlock ? 1 : -1);
if (UseFade)
ORK.GUI.ScreenFader.FadeScreen(this.FadeColor);
}
if (this.wait)
{
baseEvent.StartTime(this.FadeColor.time, this.next);
}
else
{
baseEvent.StepFinished(this.next);
}
}
/*
============================================================================
Node name functions
============================================================================
*/
public override string GetNodeDetails()
{
return "Gameflow Settings";
}
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!