void Awake() { playerFaint = gameObject.GetComponent<PlayerFaint>(); playerHealth = gameObject.GetComponent<PlayerHealth>(); modelChanger = gameObject.GetComponent<PlayerModelChanger>(); }
void Start() { playerModel = GetComponent<PlayerModelChanger>(); playerInfo = gameObject.GetComponent<BasePlayerInfo>(); if(isLocalPlayer) { colliderMaterial = GetComponent<Collider>().material; playerRigidbody = GetComponent<Rigidbody>(); playerGravityBody = GetComponent<PlayerGravityBody>(); playerCameraTransform = GetComponentInChildren<Camera>().transform; moveSpeed = playerInfo.speed; jumpPower = playerInfo.jumpHeight; doubleJumpEnabled = playerInfo.doubleJumpEnabled; cameraFpsPosition = new Vector3(0.05f, 0.45f, 0.4f); cameraThirdPersonPosition = new Vector3(0, 2f, -4.5f); targetDirection = playerCameraTransform.localRotation.eulerAngles; targetCharacterDirection = transform.localRotation.eulerAngles; } else { playerModel.EnableModel(true); } }