2023-01-05 00:28:20 +08:00
|
|
|
|
using Axibug;
|
|
|
|
|
using Axibug.Runtime;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
2023-01-05 18:32:58 +08:00
|
|
|
|
using UnityEngine.XR;
|
2023-01-05 00:28:20 +08:00
|
|
|
|
|
|
|
|
|
namespace Game
|
|
|
|
|
{
|
|
|
|
|
public abstract class RoleBase : MonoBehaviour
|
|
|
|
|
{
|
2023-01-05 18:32:58 +08:00
|
|
|
|
public E_NODE_TYPE RoleType => mBaseData.RoleType;
|
|
|
|
|
public long RoleID => mBaseData.innate.roleid;
|
|
|
|
|
public ICharMachineBase Anime => mAnime;
|
|
|
|
|
public Vector2 InputV2;
|
|
|
|
|
public bool mIsMove = false;
|
2023-01-05 00:28:20 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
/// </summary>
|
2023-01-05 18:32:58 +08:00
|
|
|
|
protected ICharMachineBase mAnime;
|
2023-01-05 00:28:20 +08:00
|
|
|
|
|
2023-01-05 18:32:58 +08:00
|
|
|
|
protected S_ROLE_DATA_BASE mBaseData;
|
|
|
|
|
|
|
|
|
|
bool LastIsMove = false;
|
|
|
|
|
|
|
|
|
|
public void Update()
|
|
|
|
|
{
|
|
|
|
|
bool ToMoveState = false;
|
|
|
|
|
if (InputV2 != Vector2.zero)
|
|
|
|
|
ToMoveState = true;
|
|
|
|
|
|
|
|
|
|
if (LastIsMove != ToMoveState)
|
|
|
|
|
{
|
|
|
|
|
AxibugLog.Debug("MeshChangeState =>" + ToMoveState);
|
|
|
|
|
MeshChangeState(ToMoveState);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LastIsMove = ToMoveState;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public abstract void MeshChangeState(bool ToMoveState);
|
2023-01-05 00:28:20 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <20><>ʼ<EFBFBD><CABC>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="data"></param>
|
|
|
|
|
public virtual void Init(S_ROLE_DATA_BASE data)
|
|
|
|
|
{
|
2023-01-05 18:32:58 +08:00
|
|
|
|
mBaseData = data;
|
|
|
|
|
if (RoleType == E_NODE_TYPE.N_MAINPLAYER)
|
2023-01-05 00:28:20 +08:00
|
|
|
|
{
|
2023-01-05 18:32:58 +08:00
|
|
|
|
mAnime = new CharacterMachine();
|
|
|
|
|
mAnime.InitMachine(transform.Find("Model"));
|
2023-01-05 00:28:20 +08:00
|
|
|
|
}
|
2023-01-05 18:32:58 +08:00
|
|
|
|
else if (RoleType == E_NODE_TYPE.N_MONSTER)
|
2023-01-05 00:28:20 +08:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2023-01-05 18:32:58 +08:00
|
|
|
|
else if (RoleType == E_NODE_TYPE.N_NPC)
|
2023-01-05 00:28:20 +08:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public abstract void Release();
|
|
|
|
|
}
|
|
|
|
|
}
|