79 lines
2.4 KiB
C#
79 lines
2.4 KiB
C#
using System;
|
|
using System.Collections;
|
|
using UnityEngine;
|
|
using Yarn.Unity;
|
|
using System.Collections.Generic;
|
|
|
|
namespace AibisDream.FixSystem
|
|
{
|
|
public static class OpenYarnCommand
|
|
{
|
|
private static ShockSystem ShockSystem => FixSystemCenter.SystemDic.Get<ShockSystem>();
|
|
|
|
[YarnCommand("play_shock_flash")]
|
|
public static void PlayShockFlash()
|
|
{
|
|
ShockSystem.StartCoroutine(ShockSystem.PlayFlashEffect());
|
|
}
|
|
|
|
[YarnCommand("play_shock_flash_and_wait")]
|
|
public static IEnumerator PlayShockFlashAndWait()
|
|
{
|
|
yield return ShockSystem.PlayFlashEffect();
|
|
}
|
|
|
|
[YarnCommand("play_shock_flashback")]
|
|
public static IEnumerator PlayShockFlashback(string imagePath)
|
|
{
|
|
var spriteFlashSystem = ShockSystem.GetComponent<SpriteFlashSystem>();
|
|
if (spriteFlashSystem != null)
|
|
{
|
|
ShockSystem.StartCoroutine(ShockSystem.PlayFlashEffect());
|
|
yield return spriteFlashSystem.TriggerFlash(imagePath);
|
|
}
|
|
}
|
|
[YarnCommand("trigger_ending")]
|
|
public static IEnumerator TriggerEnding(string imagePath, float duration = 3f)
|
|
{
|
|
var spriteFlashSystem = ShockSystem.GetComponent<SpriteFlashSystem>();
|
|
yield return spriteFlashSystem.TriggerEnding(imagePath, duration);
|
|
}
|
|
|
|
[YarnCommand("start_shock")]
|
|
public static IEnumerator StartShock()
|
|
{
|
|
yield return ShockSystem.StartShock();
|
|
}
|
|
|
|
[YarnCommand("stop_shock")]
|
|
public static IEnumerator StopShock()
|
|
{
|
|
yield return ShockSystem.StopShock();
|
|
}
|
|
|
|
[YarnCommand("auto_charge_and_release")]
|
|
public static IEnumerator AutoChargeAndRelease(float duration = 1f)
|
|
{
|
|
yield return ShockSystem.AutoChargeAndRelease(duration);
|
|
}
|
|
|
|
// [YarnCommand("set_shock_abnormal")]
|
|
// public static void SetShockAbnormal(bool isAbnormal)
|
|
// {
|
|
// ShockSystem.SetAbnormalState(isAbnormal);
|
|
// }
|
|
|
|
[YarnCommand("start_shock_abnormal")]
|
|
public static void StartShockAbnormal()
|
|
{
|
|
ShockSystem.SetAbnormalState(true);
|
|
}
|
|
|
|
[YarnCommand("stop_shock_abnormal")]
|
|
public static void StopShockAbnormal()
|
|
{
|
|
ShockSystem.SetAbnormalState(false);
|
|
}
|
|
}
|
|
}
|