2024-08-17 14:27:18 +08:00
|
|
|
|
using AppGame;
|
|
|
|
|
using DG.Tweening;
|
|
|
|
|
using Game.JNGFrame.Logic.Entity;
|
|
|
|
|
using Game.JNGState.Logic.Data;
|
|
|
|
|
using JNGame.Math;
|
|
|
|
|
using JNGame.Sync.System;
|
|
|
|
|
using JNGame.Sync.View;
|
|
|
|
|
using Service;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace Game.JNGFrame.View.Entity
|
|
|
|
|
{
|
|
|
|
|
public class VDNodes : ViewData<EDNodeData>
|
|
|
|
|
{
|
|
|
|
|
public GameObject VWorld => App.Resource.VWorld;
|
2024-08-31 15:35:12 +08:00
|
|
|
|
public GameObject Player => App.Resource.Player;
|
2024-08-17 14:27:18 +08:00
|
|
|
|
public VDNodes(SViewSystem root) : base(root)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void ViewUpdate(EDNodeData data, GameObject view)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
view.name = $"Node_{data.Id}";
|
|
|
|
|
if (data.Value.Position != null)
|
|
|
|
|
{
|
|
|
|
|
view.transform.DOMove(data.Value.Position.ToVector3(), 0.5f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override GameObject NewView(EDNodeData data)
|
|
|
|
|
{
|
2024-08-31 15:35:12 +08:00
|
|
|
|
return Object.Instantiate(Player, VWorld.transform);
|
2024-08-17 14:27:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override EDNodeData[] GetData()
|
|
|
|
|
{
|
|
|
|
|
return GetService<EDNodeDataSystem>().Datas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void ViewRemove(GameObject view)
|
|
|
|
|
{
|
|
|
|
|
Object.Destroy(view);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|