FututeWand初步
This commit is contained in:
@@ -2,6 +2,8 @@ using System.Collections.Generic;
|
||||
using Opsive.BehaviorDesigner.Runtime;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
using UniRx;
|
||||
using Cielonos.MainGame.Buffs.Character;
|
||||
|
||||
namespace Cielonos.MainGame.Characters
|
||||
{
|
||||
@@ -13,6 +15,37 @@ namespace Cielonos.MainGame.Characters
|
||||
public NavMeshAgent navMeshAgent;
|
||||
public Dictionary<string, Subtree> subBehaviorTrees;
|
||||
|
||||
private System.IDisposable timeScaleDisposable;
|
||||
private bool isTimePaused = false;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
owner.selfTimeSm.timeScaleObservable.Subscribe(OnTimeScaleChanged).AddTo(owner);
|
||||
}
|
||||
|
||||
private void OnTimeScaleChanged(float timeScale)
|
||||
{
|
||||
if (mainBehaviorTree == null) return;
|
||||
|
||||
if (timeScale == 0f)
|
||||
{
|
||||
if (!isTimePaused)
|
||||
{
|
||||
isTimePaused = true;
|
||||
mainBehaviorTree.StopBehavior(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isTimePaused)
|
||||
{
|
||||
isTimePaused = false;
|
||||
mainBehaviorTree.StartBehavior();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class AutomataEvent
|
||||
{
|
||||
public float Timestamp;
|
||||
|
||||
Reference in New Issue
Block a user