Beispiel #1
0
 /// <summary>
 /// Initializes the transforms used by the game.
 /// </summary>
 private void InitializeTransform()
 {
     fViewCamera = new SimpleCameraController(this.Game, this.Manager, GraphicsDevice.Viewport);
     fViewCamera.Camera.Rotation = Quaternion.CreateFromYawPitchRoll(0, 0.0f, 0);
     fViewCamera.Camera.Position = new Vector3(0.0f, 0.0f, 0.0f);
     fViewCamera.Camera.Update();
 }
Beispiel #2
0
    void Start()
    {
        form    = Form.Human;
        maxHp   = 100;
        minHp   = 0;
        _health = maxHp * 0.8f;

        hpBarFill           = transform.Find("SpatialHP").transform.Find("Fill").GetComponent <Image>();
        hpBarFrame          = transform.Find("SpatialHP").transform.Find("Frame").GetComponent <Image>();
        bloodSplatterEffect = GameObject.Find("BloodSplatter").GetComponent <Image>();

        bloodEffect               = false;
        bloodEffectColor          = bloodSplatterEffect.color;
        bloodEffectColor.a        = 0;
        bloodSplatterEffect.color = bloodEffectColor;

        controller = GetComponent <PlayerController>();

        // Cheat section
        {
            controller = GetComponent <PlayerController>();
            controller.OnSpaceBarPressed += OnSpaceBarPressed;
            subCam                = GameObject.Find("CM vcam1");
            camController         = GameObject.Find("Main Camera").GetComponent <SimpleCameraController>();
            camController.enabled = false;
            ybot            = GameObject.Find("Alpha_Surface").GetComponent <SkinnedMeshRenderer>();
            humanForm       = ybot.material;
            capsuleCollider = GetComponent <CapsuleCollider>();
            _rigidbody      = GetComponent <Rigidbody>();
        }

        hunterDuration = 20;
    }
 /// <summary>
 /// Initializes the transforms used by the game.
 /// </summary>
 private void InitializeTransform()
 {
     fCamera = new SimpleCameraController(this.Game, this.Manager, GraphicsDevice.Viewport);
     fCamera.Camera.SetProjectionMatrix(MathHelper.ToRadians(35.0f), 1, 100000);
     fCamera.Camera.Rotation = Quaternion.CreateFromYawPitchRoll(0, 0.0f, 0);
     fCamera.Camera.Position = new Vector3(0.0f, 0.0f, 5000.0f);
     fCamera.Camera.Update();
 }
Beispiel #4
0
        public void SetActive(bool active)
        {
            leftHand.enabled  = active;
            rightHand.enabled = active;

            if (!_controller)
            {
                _controller = GetComponent <SimpleCameraController>();
            }

            _controller.enabled = active;
        }
 void Start()
 {
     SCCScript      = GameObject.FindWithTag("MainCamera").GetComponent <SimpleCameraController>();
     gameCtrl       = GameObject.FindWithTag("GameController").GetComponent <GameController>();
     Time.timeScale = 1;
     rb             = GetComponent <Rigidbody>();
     rend           = GetComponent <Renderer>();
     m_Collider     = GetComponent <Collider>();
     //calculate pivot distance
     cubesPivotDistance = cubeSize * cubesInRow / 2;
     //use this value to create pivot vector)
     cubesPivot    = new Vector3(cubesPivotDistance, cubesPivotDistance, cubesPivotDistance);
     startingSpeed = speed;
 }
Beispiel #6
0
        /// <summary>
        /// Initializes the transforms used by the game.
        /// </summary>
        private void InitializeTransform()
        {
            fViewCamera = new SimpleCameraController(this.Game, this.Manager, GraphicsDevice.Viewport);
            fViewCamera.Camera.Rotation = Quaternion.CreateFromYawPitchRoll(0, 0.0f, 0);
            fViewCamera.Camera.Position = new Vector3(0.0f, 0.0f, 0.0f);
            fViewCamera.Camera.Update();

            fShipCamera = new SimpleCameraController(this.Game, this.Manager, GraphicsDevice.Viewport);
            fShipCamera.Camera.Rotation = Quaternion.CreateFromYawPitchRoll(0, 0.0f, 0);
            fShipCamera.Camera.Position = new Vector3(0.0f, 0.0f, 0.0f);
            fShipCamera.Camera.Update();
            fShipCamera.ForwardDirection   = Vector3.Up;
            fShipCamera.UseInverseMovement = false;
            fShipCamera.Disable();// No input!
        }
Beispiel #7
0
 void Start()
 {
     Time.timeScale    = 1;
     player            = GameObject.FindWithTag("Player");
     playerCtrl        = player.GetComponent <PlayerController>();
     soundCtrl         = GameObject.FindWithTag("Audio").GetComponent <SoundController>();
     mCamera           = GameObject.FindWithTag("MainCamera");
     cameraCtrl        = mCamera.GetComponent <SimpleCameraController>();
     saveManagerScript = GameObject.FindWithTag("saveManager").GetComponent <SaveManager>();
     distance          = (-(lastFloor.transform.position.z)) - (-(player.transform.position.z));
     playerStartingPos = player.transform.position;
     canClickStart     = true;
     tapToStartPanel.SetActive(true);
     scoreDisplay.text = "0";
 }
Beispiel #8
0
    public void SpawnMonsters(SimpleCameraController player)
    {
        List <Transform> freeSpawnPoints = new List <Transform>();

        content.monsters = new List <Monster>();
        freeSpawnPoints.AddRange(monsterSpawnPoints);

        foreach (MonsterBlueprint monster in content.monsterBlueprints)
        {
            var randomSpawn = freeSpawnPoints[UnityEngine.Random.Range(0, freeSpawnPoints.Count)];
            freeSpawnPoints.Remove(randomSpawn);
            var m = Instantiate(monster.monsterPrefab, randomSpawn);
            content.monsters.Add(m);
            m.player = player.transform;
        }
    }
 public void OnStartAction()
 {
     Debug.Log("Start action");
     if (interactionObject.character != null)
     {
         character = interactionObject.character;
     }
     screenControlsRef.SetMessageData(controlsItem);
     screenControlsRef.ShowMessage();
     if (rightLimiter)
     {
         character.ImmobilizeRight();
     }
     else
     {
         character.ImmobilizeLeft();
     }
 }
    void Start()
    {
        fluidOverlay = GameObject.Find("Canvas").transform.Find("FluidOverlay").GetComponent <UnityEngine.UI.RawImage>();

        World.createNoiseObjects(Constants.WORLD_SEED);
        ChunkData.createMeshDataLists();
        cameraControl = GameObject.Find("Main Camera").GetComponent <SimpleCameraController>();

        //setWorldHeightMapAsTexture(312, 160);
        //setHeightMapAsTexture(312, 160);
        //return;

        prevPlayerChunkPos    = getPlayerChunkPos();
        playerChunkPosition   = prevPlayerChunkPos;
        prevPlayerChunkPos.y += Constants.CHUNK_SIZE;

        chunkLoaderThread.start();
    }
Beispiel #11
0
        /// <summary>
        /// Initializes the transforms used by the game.
        /// </summary>
        private void InitializeTransform()
        {
            fCamera = new SimpleCameraController(this, fEngine.InputManager, GraphicsDevice.Viewport);

            fCamera.Camera.Rotation = Quaternion.CreateFromYawPitchRoll(0, -2.6f, 0);
            fCamera.Camera.Position = new Vector3(0.0f, -3000.0f, -5000.0f);
            fCamera.Camera.Update();

            //fViewMatrix = Matrix.CreateLookAt(
            //   new Vector3(0.0f, 0.0f, 1.0f),
            //   Vector3.Zero,
            //   Vector3.Up
            //   );

            //fProjectionMatrix = Matrix.CreateOrthographicOffCenter(
            //    0,
            //    (float)GraphicsDevice.Viewport.Width,
            //    (float)GraphicsDevice.Viewport.Height,
            //    0,
            //    1.0f, 1000.0f);
        }
Beispiel #12
0
 private void Awake()
 {
     _controller = GetComponent <SimpleCameraController>();
 }
Beispiel #13
0
 void Start()
 {
     groundCameraScript = GetComponent <SimpleCameraController>();
     cpointer           = GetComponent <CustomPointer>();
     airCameraScript    = GetComponent <CameraFlightFollow>();
 }
Beispiel #14
0
 private void Awake()
 {
     positions        = GameObject.FindGameObjectsWithTag(findTag);
     cameraController = GetComponent <SimpleCameraController>();
 }
 public void Setup()
 {
     camController = CreateCamController();
 }
Beispiel #16
0
 // Start is called before the first frame update
 void Start()
 {
     cameraController = GetComponent <SimpleCameraController>();
     camera           = GetComponent <Camera>();
 }
Beispiel #17
0
 public void StartAction(SimpleCameraController characterRef)
 {
     character = characterRef;
     StartAction();
 }