37 lines
802 B
C#
37 lines
802 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// 光圈脚本
|
|
/// </summary>
|
|
public class FragmentOutlineManager : MonoBehaviour
|
|
{
|
|
public GameObject dashOutline; // 虚线外模型
|
|
public Fragment[] frags;
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
if (other.CompareTag("Player"))
|
|
{
|
|
dashOutline.SetActive(true);
|
|
foreach (var frag in frags)
|
|
{
|
|
frag.PlayGlow(true);
|
|
}
|
|
}
|
|
}
|
|
|
|
private void OnTriggerExit(Collider other)
|
|
{
|
|
if (other.CompareTag("Player"))
|
|
{
|
|
dashOutline.SetActive(false);
|
|
foreach (var frag in frags)
|
|
{
|
|
frag.PlayGlow(false);
|
|
}
|
|
}
|
|
}
|
|
}
|