using Axibug; using Axibug.Runtime; using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.XR; namespace Game { public abstract class RoleBase : MonoBehaviour { public E_NODE_TYPE RoleType => mBaseData.RoleType; public long RoleID => mBaseData.innate.roleid; public ICharMachineBase Anime => mAnime; public Vector2 InputV2; public bool mIsMove = false; /// /// ¶¯»­¿ØÖÆÆ÷ /// protected ICharMachineBase mAnime; 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); /// /// ³õʼ»¯ /// /// public virtual void Init(S_ROLE_DATA_BASE data) { mBaseData = data; if (RoleType == E_NODE_TYPE.N_MAINPLAYER) { mAnime = new CharacterMachine(); mAnime.InitMachine(transform.Find("Model")); } else if (RoleType == E_NODE_TYPE.N_MONSTER) { } else if (RoleType == E_NODE_TYPE.N_NPC) { } } public abstract void Release(); } }