2024-08-31 15:35:12 +08:00
|
|
|
|
using AppGame;
|
|
|
|
|
using AppGame.Sync;
|
|
|
|
|
using Cinemachine;
|
|
|
|
|
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 VDBoss : ViewData<EDBossData>
|
|
|
|
|
{
|
|
|
|
|
public GameObject VWorld => App.Resource.VWorld;
|
|
|
|
|
public GameObject Boss => App.Resource.Boss;
|
|
|
|
|
|
|
|
|
|
public VDBoss(SViewSystem root) : base(root)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void ViewUpdate(EDBossData data, GameObject view)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
view.name = $"Boss_{data.Id}";
|
|
|
|
|
if (data.Value.Position != null)
|
|
|
|
|
{
|
|
|
|
|
view.transform.DOMove(data.Value.Position.ToVector3(), 0.5f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override GameObject NewView(EDBossData data)
|
|
|
|
|
{
|
|
|
|
|
return Object.Instantiate(Boss, VWorld.transform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override EDBossData[] GetData()
|
|
|
|
|
{
|
|
|
|
|
return GetService<EDBossDataSystem>().Datas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void ViewRemove(GameObject view)
|
|
|
|
|
{
|
2024-09-13 04:06:25 +08:00
|
|
|
|
view.transform.DOKill();
|
2024-08-31 15:35:12 +08:00
|
|
|
|
Object.Destroy(view);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|