using Axibug.Runtime; using Bright.Serialization; using System.IO; using Game.Config; using System.Collections.Generic; using System.Linq; using UnityEngine; using static Axibug.Utility; using UnityEditor; using Axibug.Resources; namespace Game { public class MainPlayerComponent : GameComponent { public Transform CamPos; public MainRole Player; //Rigidbody mRigidbody; public bool bLoadFinish { get; private set; } = false; public bool InGame = false; private void OnEnable() { CamPos = transform.Find("CamPos"); InGame = false; } public void ReSetMainPlayer() { Player = null; } void Start() { } void Update() { Update_MoveForInput(); } public void LoadPlayer() { bLoadFinish = false; Player = GamePlayEntry.RoleMgr.CreateMainRole(); //ΙγΟρ»ϊ SetMainCamera(); bLoadFinish = true; } public void SetMainCamera() { Camera.main.transform.parent = CamPos; Camera.main.transform.localPosition = Vector3.zero; Camera.main.transform.localEulerAngles = Vector3.zero; } public void Update_MoveForInput() { if (!Player) return; Player.InputV2 = GamePlayEntry.Input.InputV2; } } }