Roman bb94ad63ff 1.我添加了fungus包,用来做对话
2.我已经完成了水缸和镜子的交互对话
3.已经找到了该包的输入代码和退出代码,可以自定义厉害的对话了
2021-07-05 22:45:35 +08:00

76 lines
2.8 KiB
C#
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// This code is part of the Fungus library (https://github.com/snozbot/fungus)
// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE)
using UnityEngine;
namespace Fungus
{
/// <summary>
/// Draws a fullscreen texture over the scene to give a fade effect. Setting Target Alpha to 1 will obscure the screen, alpha 0 will reveal the screen.
/// If no Fade Texture is provided then a default flat color texture is used.
/// </summary>
[CommandInfo("Camera",
"Fade Screen",
"Draws a fullscreen texture over the scene to give a fade effect. Setting Target Alpha to 1 will obscure the screen, alpha 0 will reveal the screen. " +
"If no Fade Texture is provided then a default flat color texture is used.")]
[AddComponentMenu("")]
public class FadeScreen : Command
{
[Tooltip("Time for fade effect to complete")]
[SerializeField] protected float duration = 1f;
[Tooltip("Current target alpha transparency value. The fade gradually adjusts the alpha to approach this target value.")]
[SerializeField] protected float targetAlpha = 1f;
[Tooltip("Wait until the fade has finished before executing next command")]
[SerializeField] protected bool waitUntilFinished = true;
[Tooltip("Color to render fullscreen fade texture with when screen is obscured.")]
[SerializeField] protected Color fadeColor = Color.black;
[Tooltip("Optional texture to use when rendering the fullscreen fade effect.")]
[SerializeField] protected Texture2D fadeTexture;
[SerializeField] protected LeanTweenType fadeTweenType = LeanTweenType.easeInOutQuad;
#region Public members
public override void OnEnter()
{
var cameraManager = FungusManager.Instance.CameraManager;
if (fadeTexture)
{
cameraManager.ScreenFadeTexture = fadeTexture;
}
else
{
cameraManager.ScreenFadeTexture = CameraManager.CreateColorTexture(fadeColor, 32, 32);
}
cameraManager.Fade(targetAlpha, duration, delegate {
if (waitUntilFinished)
{
Continue();
}
}, fadeTweenType);
if (!waitUntilFinished)
{
Continue();
}
}
public override string GetSummary()
{
return "Fade to " + targetAlpha + " over " + duration + " seconds";
}
public override Color GetButtonColor()
{
return new Color32(216, 228, 170, 255);
}
#endregion
}
}