You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.6 KiB
55 lines
1.6 KiB
7 years ago
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
|
||
6 years ago
|
namespace Fungus.Examples
|
||
|
{
|
||
|
public class FPDemoPriorityRouter : MonoBehaviour
|
||
7 years ago
|
{
|
||
6 years ago
|
public Behaviour[] componentEnabledOutsideFungusPriority;
|
||
|
public Behaviour[] componentEnabledInsideFungusPriority;
|
||
7 years ago
|
|
||
6 years ago
|
void OnEnable()
|
||
7 years ago
|
{
|
||
6 years ago
|
Fungus.FungusPrioritySignals.OnFungusPriorityStart += FungusPrioritySignals_OnFungusPriorityStart;
|
||
|
Fungus.FungusPrioritySignals.OnFungusPriorityEnd += FungusPrioritySignals_OnFungusPriorityEnd;
|
||
7 years ago
|
}
|
||
6 years ago
|
|
||
|
void OnDisable()
|
||
7 years ago
|
{
|
||
6 years ago
|
Fungus.FungusPrioritySignals.OnFungusPriorityStart -= FungusPrioritySignals_OnFungusPriorityStart;
|
||
|
Fungus.FungusPrioritySignals.OnFungusPriorityEnd -= FungusPrioritySignals_OnFungusPriorityEnd;
|
||
7 years ago
|
}
|
||
|
|
||
6 years ago
|
private void FungusPrioritySignals_OnFungusPriorityEnd()
|
||
7 years ago
|
{
|
||
6 years ago
|
foreach (var item in componentEnabledOutsideFungusPriority)
|
||
|
{
|
||
|
item.enabled = true;
|
||
|
}
|
||
|
foreach (var item in componentEnabledInsideFungusPriority)
|
||
|
{
|
||
|
item.enabled = false;
|
||
|
}
|
||
7 years ago
|
}
|
||
6 years ago
|
|
||
|
private void FungusPrioritySignals_OnFungusPriorityStart()
|
||
7 years ago
|
{
|
||
6 years ago
|
foreach (var item in componentEnabledOutsideFungusPriority)
|
||
|
{
|
||
|
item.enabled = false;
|
||
|
}
|
||
|
foreach (var item in componentEnabledInsideFungusPriority)
|
||
|
{
|
||
|
item.enabled = true;
|
||
|
}
|
||
7 years ago
|
}
|
||
|
|
||
6 years ago
|
// Update is called once per frame
|
||
|
void Update()
|
||
|
{
|
||
7 years ago
|
|
||
6 years ago
|
}
|
||
7 years ago
|
}
|
||
6 years ago
|
}
|