Exemplo n.º 1
0
    /// <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;
    }
Exemplo n.º 2
0
 /// <summary>
 /// The set view distance.
 /// </summary>
 /// <param name="camera">
 /// The camera.
 /// </param>
 public void SetInterestAreaViewDistance(InterestArea camera)
 {
     this.SetInterestAreaViewDistance(camera.ViewDistanceEnter, camera.ViewDistanceExit);
 }
Exemplo n.º 3
0
 public bool TryGetCamera(byte cameraId, out InterestArea camera)
 {
     return(this.cameras.TryGetValue(cameraId, out camera));
 }
Exemplo n.º 4
0
 public void AddCamera(InterestArea camera)
 {
     this.cameras.Add(camera.Id, camera);
 }
Exemplo n.º 5
0
 /// <summary>
 /// The set view distance.
 /// </summary>
 /// <param name="camera">
 /// The camera.
 /// </param>
 public void SetInterestAreaViewDistance(InterestArea camera)
 {
     this.SetInterestAreaViewDistance(camera.ViewDistanceEnter, camera.ViewDistanceExit);
 }
Exemplo n.º 6
0
 /// <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);
 }
Exemplo n.º 7
0
 /// <summary>
 ///   The add camera.
 /// </summary>
 /// <param name = "camera">
 ///   The camera.
 /// </param>
 public void AddCamera(InterestArea camera)
 {
     this.cameras.Add(camera.Id, camera);
 }