1
This commit is contained in:
@@ -3,7 +3,9 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using MeshCombineStudio;
|
||||
using NGS.AdvancedCullingSystem.Dynamic;
|
||||
using UnityEditor.Build;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
@@ -12,15 +14,21 @@ namespace BITKit.OpenWorld
|
||||
public class OpenWorldCombiner : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private MeshCombiner meshCombiner;
|
||||
|
||||
[SerializeField] private UnityEvent onCombiningReady;
|
||||
|
||||
[SerializeField]
|
||||
private bool allowCullingSource = true;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
meshCombiner.onCombiningReady +=x=> onCombiningReady.Invoke();
|
||||
meshCombiner.onCombiningReady += AddCullingSource;
|
||||
}
|
||||
|
||||
private void AddCullingSource(MeshCombiner meshcombiner)
|
||||
{
|
||||
if (enabled)
|
||||
if (allowCullingSource)
|
||||
AddCullingSource();
|
||||
}
|
||||
|
||||
|
@@ -12,20 +12,35 @@ namespace BITKit
|
||||
public string questName;
|
||||
public string qeustDescription;
|
||||
public BBParameter<QuestSystem.Info> output;
|
||||
|
||||
private bool isInitiated;
|
||||
private void Disposed()
|
||||
{
|
||||
if (output.isNoneOrNull) return;
|
||||
if(output.value.State is QuestSystem.State.InProcess)
|
||||
{
|
||||
BIT4Log.Log<CreateQuest>($"任务{output.value.Name}已取消");
|
||||
QuestSystem.Cancel(output.value);
|
||||
}
|
||||
}
|
||||
protected override void OnExecute()
|
||||
{
|
||||
var quest = QuestSystem.Create(questName, qeustDescription);
|
||||
if (output.isDefined)
|
||||
output.SetValue(quest);
|
||||
EndAction();
|
||||
}
|
||||
protected override void OnStop(bool interrupted)
|
||||
{
|
||||
base.OnStop(interrupted);
|
||||
if (!interrupted) return;
|
||||
if (QuestSystem.quests.TryGetValue(output.value, out var info) &&
|
||||
info.State == QuestSystem.State.InProcess)
|
||||
QuestSystem.Cancel(output.value);
|
||||
}
|
||||
|
||||
if(isInitiated)return;
|
||||
agent.As<MonoBehaviour>().destroyCancellationToken.Register(Disposed);
|
||||
isInitiated = true;
|
||||
; }
|
||||
// protected override void OnStop(bool interrupted)
|
||||
// {
|
||||
// base.OnStop(interrupted);
|
||||
// if (!interrupted) return;
|
||||
// if (QuestSystem.quests.TryGetValue(output.value, out var info) &&
|
||||
// info.State == QuestSystem.State.InProcess)
|
||||
// QuestSystem.Cancel(output.value);
|
||||
// }
|
||||
}
|
||||
}
|
@@ -34,7 +34,6 @@ namespace BITKit
|
||||
{
|
||||
blackboard.SetVariableValue("HP", hp);
|
||||
}
|
||||
|
||||
public void OnEntryOverride(bool @override)
|
||||
{
|
||||
_allow.SetDisableElements(this,@override);
|
||||
|
@@ -15,7 +15,7 @@ namespace BITKit.NodeCanvas
|
||||
public BBParameter<Transform> target;
|
||||
protected override void OnExecute()
|
||||
{
|
||||
target.SetValue(sensor.value.CurrentTarget);
|
||||
//target.SetValue(sensor.value.CurrentTarget);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user