Esempio n. 1
0
 private void Awake()
 {
     if (m_cameraControl == null)
     {
         m_cameraControl = FindObjectOfType <FreeLookCamera>();
     }
 }
Esempio n. 2
0
	// Use this for initialization
	void Start () {
		Messenger.AddListener<GameObject, bool>("onPickupCubeKey", onPickupCubeKey);
		Messenger.AddListener<GameObject, bool>("onCubeKeyDoorUse", onCubeKeyDoorUse);
		Messenger.AddListener<GameObject, bool>("onRequestOpenCubeDoor", onRequestOpenCubeDoor);
		
		foreach(GameObject obj in availableCubesToPlace){
			m_PlacedCubePositions.Add(obj.transform.localPosition);
			m_CubePlaceUsed.Add(false);
		}
		r_Interactable = GetComponent<Interactable>();
		r_FreeLookCamera = Camera.main.transform.parent.transform.parent.gameObject.GetComponent<FreeLookCamera>();

		nrCubes = availableCubesToPlace.Count;
	}
 public void Heading(Vector3 head, Transform transform, FreeLookCamera cam)
 {
     if (!cam.lockOn)
     {
         if (head != Vector3.zero)
         {
             transform.rotation = Quaternion.LookRotation(head);
         }
     }
     else if (cam.lockOn)
     {
         cam.lookAt.y       = 0;
         transform.rotation = Quaternion.LookRotation(cam.lookAt);
     }
 }
Esempio n. 4
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            InitializeEffect();
            myModel     = Content.Load <Model>("Models/stairs1");
            myModel1    = Content.Load <Model>("Models/stairs");
            texture     = Content.Load <Texture2D>("Textures/wall");
            aspectRatio = (float)graphics.GraphicsDevice.Viewport.Width /
                          (float)graphics.GraphicsDevice.Viewport.Height;

            ResourceProvider.Instance.Initialize(GraphicsDevice, Content);
            c = new CubeGraphic {
                Texture = texture, DrawFaces = CubeFaces.Back, Position = Vector3.Zero, Scale = new Vector3(1)
            };

            f                  = new FreeLookCamera();
            f.Position         = new Vector3(0, 0, 5);
            f.ForwardDirection = -Vector3.UnitZ;
        }
Esempio n. 5
0
 void Start()
 {
     player         = FindObjectOfType <PlayerCharacter>();
     freeLookCamera = FindObjectOfType <FreeLookCamera>();
     hud            = FindObjectOfType <PlayerHUD>();
 }