mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 19:34:47 +00:00
50 lines
1.2 KiB
C#
50 lines
1.2 KiB
C#
|
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)
|
|||
|
{
|
|||
|
Object.Destroy(view);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|