mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-16 08:25:20 +01:00
33 lines
625 B
C#
33 lines
625 B
C#
using UnityEngine;
|
|
|
|
namespace CinemaDirector
|
|
{
|
|
[CutsceneItem("Physics", "Sleep", new CutsceneItemGenre[] { CutsceneItemGenre.ActorItem })]
|
|
public class RigidbodySleepEvent : CinemaActorEvent
|
|
{
|
|
public override void Trigger(GameObject actor)
|
|
{
|
|
if (actor != null)
|
|
{
|
|
Rigidbody component = actor.GetComponent<Rigidbody>();
|
|
if (component != null)
|
|
{
|
|
component.Sleep();
|
|
}
|
|
}
|
|
}
|
|
|
|
public override void Reverse(GameObject actor)
|
|
{
|
|
if (actor != null)
|
|
{
|
|
Rigidbody component = actor.GetComponent<Rigidbody>();
|
|
if (component != null)
|
|
{
|
|
component.WakeUp();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|