Esempio n. 1
0
        void Start()
        {
            if (Camera.main == null)
            {
                throw new InvalidOperationException("Camera.main missing");
            }
            _transform       = GetComponent <Transform>();
            _camTransform    = Camera.main.GetComponent <Transform>();
            _capsuleCollider = GetComponent <CapsuleCollider>();
            if (_capsuleCollider == null)
            {
                throw new InvalidOperationException("Player:CapsuleCollider missing");
            }
            _rigidbody = GetComponent <Rigidbody>();
            if (_rigidbody == null)
            {
                throw new InvalidOperationException("Player:Rigidbody missing");
            }
            // Setup the camera
            var game   = BaseSettings.Game;
            var camera = Camera.main;

            camera.renderingPath = game.RenderPath;
            camera.farClipPlane  = game.CameraFarClip;
            _crosshair           = FindObjectOfType <UICrosshair>();
        }
Esempio n. 2
0
        private void Start()
        {
            _transform       = GetComponent <Transform>();
            _camTransform    = Camera.main.GetComponent <Transform>();
            _capsuleCollider = GetComponent <CapsuleCollider>();
            _rigidbody       = GetComponent <Rigidbody>();

            // Setup the render path
            Camera.main.renderingPath = TESUnity.instance.renderPath;

            _crosshair = FindObjectOfType <UICrosshair>();
        }