68 lines
1.6 KiB
C#
68 lines
1.6 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// 안빱났
|
|
/// </summary>
|
|
public class Ambulance : SkillCar
|
|
{
|
|
/// <summary>
|
|
/// 璘쒸둘
|
|
/// </summary>
|
|
public Transform leftPoliceWhistle;
|
|
|
|
/// <summary>
|
|
/// 塘쒸둘
|
|
/// </summary>
|
|
public Transform rightPoliceWhistle;
|
|
|
|
/// <summary>
|
|
/// 쒸둘葵넋
|
|
/// </summary>
|
|
private Coroutine policeWhistleCoroutine;
|
|
|
|
private void OnDisable()
|
|
{
|
|
StopPoliceWhistle();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 쒸둘
|
|
/// </summary>
|
|
public void PoliceWhistle()
|
|
{
|
|
policeWhistleCoroutine= StartCoroutine(IE_PoliceWhistle());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 쒸둘葵넋
|
|
/// </summary>
|
|
private IEnumerator IE_PoliceWhistle()
|
|
{
|
|
while (true)
|
|
{
|
|
leftPoliceWhistle.gameObject.SetActive(true);
|
|
rightPoliceWhistle.gameObject.SetActive(false);
|
|
yield return new WaitForSeconds(0.1f);
|
|
rightPoliceWhistle.gameObject.SetActive(true);
|
|
leftPoliceWhistle.gameObject.SetActive(false);
|
|
yield return new WaitForSeconds(0.1f);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 董界
|
|
/// </summary>
|
|
public void StopPoliceWhistle()
|
|
{
|
|
if(policeWhistleCoroutine!=null)
|
|
{
|
|
leftPoliceWhistle.gameObject.SetActive(false);
|
|
rightPoliceWhistle.gameObject.SetActive(false);
|
|
StopCoroutine(policeWhistleCoroutine);
|
|
policeWhistleCoroutine = null;
|
|
}
|
|
}
|
|
}
|