55 lines
1.7 KiB
C#
55 lines
1.7 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_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);
|
|
}
|
|
|
|
}
|
|
} |