BITFALL/Assets/WSM Game Studio/Train Controller_v3/Shared/Scripts/DirectionIndicator.cs

39 lines
902 B
C#
Raw Normal View History

2024-03-22 20:16:32 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace WSMGameStudio.RailroadSystem
{
public class DirectionIndicator : MonoBehaviour
{
public Animator animator;
public void TurnRight()
{
if (animator != null)
{
animator.SetBool("TurnRight", true);
animator.SetBool("TurnLeft", false);
}
}
public void TurnLeft()
{
if (animator != null)
{
animator.SetBool("TurnRight", false);
animator.SetBool("TurnLeft", true);
}
}
public void ReturnToDefaultPosition()
{
if (animator != null)
{
animator.SetBool("TurnRight", false);
animator.SetBool("TurnLeft", false);
}
}
}
}