mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交新概念 Tile从服务器
This commit is contained in:
50
JNFrame2/Assets/Scripts/Game/View/Entity/VDBoss.cs
Normal file
50
JNFrame2/Assets/Scripts/Game/View/Entity/VDBoss.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
3
JNFrame2/Assets/Scripts/Game/View/Entity/VDBoss.cs.meta
Normal file
3
JNFrame2/Assets/Scripts/Game/View/Entity/VDBoss.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 211b4062ef0644d583693f4b36358c40
|
||||
timeCreated: 1724724729
|
@@ -1,7 +1,6 @@
|
||||
using AppGame;
|
||||
using DG.Tweening;
|
||||
using Game.JNGFrame.Logic.Entity;
|
||||
using Game.JNGFrame.Logic.System;
|
||||
using Game.JNGState.Logic.Data;
|
||||
using JNGame.Math;
|
||||
using JNGame.Sync.System;
|
||||
@@ -14,7 +13,7 @@ namespace Game.JNGFrame.View.Entity
|
||||
public class VDNodes : ViewData<EDNodeData>
|
||||
{
|
||||
public GameObject VWorld => App.Resource.VWorld;
|
||||
public GameObject Player1 => App.Resource.Player1;
|
||||
public GameObject Player => App.Resource.Player;
|
||||
public VDNodes(SViewSystem root) : base(root)
|
||||
{
|
||||
}
|
||||
@@ -32,7 +31,7 @@ namespace Game.JNGFrame.View.Entity
|
||||
|
||||
public override GameObject NewView(EDNodeData data)
|
||||
{
|
||||
return Object.Instantiate(Player1, VWorld.transform);
|
||||
return Object.Instantiate(Player, VWorld.transform);
|
||||
}
|
||||
|
||||
public override EDNodeData[] GetData()
|
||||
|
@@ -2,13 +2,9 @@
|
||||
using AppGame.Sync;
|
||||
using Cinemachine;
|
||||
using DG.Tweening;
|
||||
using Game.JNGFrame.Logic.Entity;
|
||||
using Game.JNGFrame.Logic.System;
|
||||
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
|
||||
@@ -16,13 +12,9 @@ namespace Game.JNGFrame.View.Entity
|
||||
public class VDPlayers : ViewData<EDPlayerData>
|
||||
{
|
||||
public GameObject VWorld => App.Resource.VWorld;
|
||||
public GameObject Player1 => App.Resource.Player1;
|
||||
public GameObject Player => App.Resource.Player;
|
||||
public CinemachineFreeLook FreeLook => App.Resource.FreeLook;
|
||||
|
||||
public Vector3 pos = new Vector3(0, 0, 0);
|
||||
|
||||
public Vector3 target = new Vector3(0, 0, 0);
|
||||
|
||||
public VDPlayers(SViewSystem root) : base(root)
|
||||
{
|
||||
}
|
||||
@@ -36,13 +28,7 @@ namespace Game.JNGFrame.View.Entity
|
||||
{
|
||||
view.transform.DOKill();
|
||||
view.transform.DOMove(data.Value.Position.ToVector3(), 0.5f);
|
||||
// view.transform.position = data.Value.Position.ToVector3();
|
||||
// view.transform.DOKill();
|
||||
// view.transform.DOMove(pos = pos + new Vector3(0,0,10f / 15), 0.07f);
|
||||
}
|
||||
// view.transform.position += new Vector3(0, 0,3f * Time.deltaTime);
|
||||
// view.transform.position += new Vector3(0, 0,30f * Time.deltaTime);
|
||||
// view.transform.position = new Vector3(0, 10, view.transform.position.z);
|
||||
|
||||
//权限操作
|
||||
if (App.IsClient() && data.Value.Auth == App.ClientID)
|
||||
@@ -61,7 +47,7 @@ namespace Game.JNGFrame.View.Entity
|
||||
|
||||
public override GameObject NewView(EDPlayerData data)
|
||||
{
|
||||
var gameObject = Object.Instantiate(Player1, VWorld.transform);
|
||||
var gameObject = Object.Instantiate(Player, VWorld.transform);
|
||||
// gameObject.transform.DOMove(gameObject.transform.position + new Vector3(0,0,1000), 100);
|
||||
return gameObject;
|
||||
}
|
||||
|
Reference in New Issue
Block a user