Files
pgs/Assets/ProCamera2D/3rd Party Plugins Support/PlayMakerActions/PC2DShakeConstantStop.cs

27 lines
758 B
C#
Raw Normal View History

2026-02-21 16:58:22 -08:00
#if PLAYMAKER
using Com.LuisPedroFonseca.ProCamera2D;
using HutongGames.PlayMaker;
using TooltipAttribute = HutongGames.PlayMaker.TooltipAttribute;
using UnityEngine;
[Tooltip("Stops the current constant shake on the camera")]
public class PC2DShakeConstantStop : FsmStateActionProCamera2DBase
{
[RequiredField]
[Tooltip("The camera with the ProCamera2D component, most probably the MainCamera")]
public FsmGameObject MainCamera;
public override void OnEnter()
{
var shake = MainCamera.Value.GetComponent<ProCamera2DShake>();
if (shake == null)
Debug.LogError("The ProCamera2D component needs to have the Shake plugin enabled.");
if (ProCamera2D.Instance != null && shake != null)
shake.StopConstantShaking();
Finish();
}
}
#endif