mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-26 18:26:23 +00:00
提交行为树
This commit is contained in:
@@ -4,6 +4,7 @@ using HotScripts.JNGame.Runtime.Sync.System.Logic;
|
||||
using JNGame.Runtime.Sync.System.Logic;
|
||||
using JNGame.Serialization;
|
||||
using JNGame.Sync.Entity;
|
||||
using JNGame.Sync.Frame.Service;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GASSamples.Scripts.Game.GAS
|
||||
@@ -15,8 +16,6 @@ namespace GASSamples.Scripts.Game.GAS
|
||||
|
||||
public IJNEntity Entity { get; protected set; }
|
||||
|
||||
private int CueClipIndex = 0;
|
||||
|
||||
public GAbilitySystemComponent(IJNEntity entity)
|
||||
{
|
||||
Entity = entity;
|
||||
@@ -53,10 +52,10 @@ namespace GASSamples.Scripts.Game.GAS
|
||||
Debug.Log("OnGERelease");
|
||||
}
|
||||
|
||||
public override int OnCueAdd(AbilitySpec abilitySpec, string cueAssetLocation, int durationTime)
|
||||
public override ulong OnCueAdd(AbilitySpec abilitySpec, string cueAssetLocation, int durationTime)
|
||||
{
|
||||
Debug.Log("OnCueAdd");
|
||||
int cueId = CueClipIndex++;
|
||||
ulong cueId = Entity.GetSystem<JNRandomSystem>().NextId();
|
||||
Serializer data = new Serializer();
|
||||
data.Write(cueAssetLocation);
|
||||
data.Write(durationTime);
|
||||
@@ -66,7 +65,7 @@ namespace GASSamples.Scripts.Game.GAS
|
||||
return cueId;
|
||||
}
|
||||
|
||||
public override void OnCueRemove(AbilitySpec abilitySpec, int cueClipIndex)
|
||||
public override void OnCueRemove(AbilitySpec abilitySpec, ulong cueClipIndex)
|
||||
{
|
||||
Serializer data = new Serializer();
|
||||
data.Write(cueClipIndex);
|
||||
|
@@ -16,7 +16,7 @@ namespace GASSamples.Scripts.Game.View
|
||||
private DDataSystem Resource => GetSystem<DDataSystem>();
|
||||
private DViewSystem View => GetSystem<DViewSystem>();
|
||||
|
||||
private ConcurrentDictionary<int, GameplayCueDurationalSpec> CueMap = new();
|
||||
private ConcurrentDictionary<ulong, GameplayCueDurationalSpec> CueMap = new();
|
||||
|
||||
public override void OnSyncStart()
|
||||
{
|
||||
@@ -33,7 +33,7 @@ namespace GASSamples.Scripts.Game.View
|
||||
var reader = new Deserializer(data);
|
||||
var cueAssetLocation = reader.ReadString();
|
||||
var durationTime = reader.ReadInt32();
|
||||
var cueId = reader.ReadInt32();
|
||||
var cueId = reader.ReadUInt64();
|
||||
var entityId = reader.ReadUInt64();
|
||||
|
||||
CueMap.TryAdd(cueId,Resource.CuesDurational[cueAssetLocation].ApplyFrom(View.ViewObject[entityId],durationTime));
|
||||
@@ -44,7 +44,7 @@ namespace GASSamples.Scripts.Game.View
|
||||
{
|
||||
|
||||
var reader = new Deserializer(data);
|
||||
var cueClipIndex = reader.ReadInt32();
|
||||
var cueClipIndex = reader.ReadUInt64();
|
||||
var entityId = reader.ReadInt32();
|
||||
CueMap.TryRemove(cueClipIndex,out var spec);
|
||||
|
||||
|
Reference in New Issue
Block a user