/// <summary> /// The initialize. /// </summary> /// <param name="game"> /// The game. /// </param> /// <param name="cameraId"> /// The camera Id. /// </param> /// <param name="position"> /// The position. /// </param> /// <param name="moveDirection"> /// The direction of movement /// </param> public void Initialize(Game game, byte cameraId, Vector3 position, Vector3 moveDirection) { this.interestArea = new InterestArea(cameraId, game, Player.GetPosition(position)); this.interestArea.ResetViewDistance(); this.direction = moveDirection; this.nextMoveTime = Time.time + 0.05f; this.interestArea.Create(); this.transform.position = position; float terrainHeight = Terrain.activeTerrain.SampleHeight(position); this.height = position.y - terrainHeight; }
/// <summary> /// The set view distance. /// </summary> /// <param name="camera"> /// The camera. /// </param> public void SetInterestAreaViewDistance(InterestArea camera) { this.SetInterestAreaViewDistance(camera.ViewDistanceEnter, camera.ViewDistanceExit); }
public bool TryGetCamera(byte cameraId, out InterestArea camera) { return(this.cameras.TryGetValue(cameraId, out camera)); }
public void AddCamera(InterestArea camera) { this.cameras.Add(camera.Id, camera); }
/// <summary> /// The set view distance. /// </summary> /// <param name="camera"> /// The camera. /// </param> public void SetInterestAreaViewDistance(InterestArea camera) { this.SetInterestAreaViewDistance(camera.ViewDistanceEnter, camera.ViewDistanceExit); }
/// <summary> /// The try get camera. /// </summary> /// <param name = "cameraId"> /// The camera id. /// </param> /// <param name = "camera"> /// The camera. /// </param> /// <returns> /// true if camera was found. /// </returns> public bool TryGetCamera(byte cameraId, out InterestArea camera) { return this.cameras.TryGetValue(cameraId, out camera); }
/// <summary> /// The add camera. /// </summary> /// <param name = "camera"> /// The camera. /// </param> public void AddCamera(InterestArea camera) { this.cameras.Add(camera.Id, camera); }