コード例 #1
0
        void Start()
        {
            playerInfo = gameObject.GetComponent<BasePlayerInfo>();
            playerHealth = gameObject.GetComponent<PlayerHealth>();
            playerCamera = gameObject.GetComponent<PlayerCamera>();

            splashCollider = Resources.Load<GameObject>("Prefabs/Physics/SplashDamageCollider");

            rapidFireCooldown = Settings.RapidFireCooldownSpeed;

            playerCameraTransform = gameObject.GetComponentInChildren<Camera>().transform;
            if(isLocalPlayer) {
                playerGravityBody = gameObject.GetComponent<PlayerGravityBody>();
                playerHUD = gameObject.GetComponent<PlayerHUD> ();
            }

            localPlayerInfoPacket = new PlayerInfoPacket(playerInfo.playerName, playerInfo.playerTeam, netId);
        }
コード例 #2
0
        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);
            }
        }