您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
31 行
1.0 KiB
31 行
1.0 KiB
using GameplayIngredients;
|
|
using GameplayIngredients.Actions;
|
|
using UnityEngine;
|
|
|
|
public class FPSManagerToggleAction : ActionBase
|
|
{
|
|
public ToggleGameObjectAction.GameObjectToggle.GameObjectToggleState Toggle;
|
|
|
|
public override void Execute(GameObject instigator = null)
|
|
{
|
|
if(Manager.Has<FPSManager>())
|
|
{
|
|
var manager = Manager.Get<FPSManager>();
|
|
|
|
switch (Toggle)
|
|
{
|
|
case ToggleGameObjectAction.GameObjectToggle.GameObjectToggleState.Disable:
|
|
manager.FPSRoot.SetActive(false);
|
|
break;
|
|
case ToggleGameObjectAction.GameObjectToggle.GameObjectToggleState.Enable:
|
|
manager.FPSRoot.SetActive(true);
|
|
break;
|
|
case ToggleGameObjectAction.GameObjectToggle.GameObjectToggleState.Toggle:
|
|
manager.FPSRoot.SetActive(!manager.FPSRoot.activeInHierarchy);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|