Files
BlueArchiveMiniGame/Assets/ThirdParty/DestroyIt/Demos (safe to delete)/Scripts/Behaviors/RocketLoading.cs

22 lines
782 B
C#
Raw Normal View History

2025-09-17 18:56:28 +08:00
using UnityEngine;
namespace DestroyIt
{
public class RocketLoading : MonoBehaviour
{
public bool isLoaded = true; // start off with the rocket loaded into the launcher
private void OnEnable()
{
if (isLoaded) // if the rocket is already loaded, position the game object so it is in the launcher.
transform.localPosition = new Vector3(transform.localPosition.x, transform.localPosition.y, 0.74f);
else // if rocket is not currently loaded, play the rocket loading animation
{
Animation anim = gameObject.GetComponent<Animation>();
if (anim != null)
anim.Play("Rocket Loading");
isLoaded = true;
}
}
}
}