您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
39 行
891 B
39 行
891 B
using System;
|
|
using UnityEngine;
|
|
|
|
namespace GameplayIngredients.Actions
|
|
{
|
|
[AddComponentMenu(ComponentMenu.actionsPath + "SwitcherAction (Obsolete)")]
|
|
[Obsolete]
|
|
public class SwitcherAction : MonoBehaviour
|
|
{
|
|
public GameObject[] Objects;
|
|
public GameObject Default;
|
|
|
|
private void Start()
|
|
{
|
|
if (Default != null)
|
|
SwitchTo(Default);
|
|
}
|
|
|
|
public void SwitchTo(GameObject obj)
|
|
{
|
|
foreach (GameObject o in Objects)
|
|
{
|
|
if (o == null) continue;
|
|
if (o == obj)
|
|
{
|
|
if (!o.activeSelf)
|
|
o.SetActive(true);
|
|
|
|
}
|
|
else
|
|
{
|
|
if (o.activeSelf)
|
|
o.SetActive(false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|