42 lines
808 B
C#
42 lines
808 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Pinwheel.Griffin;
|
|
using UnityEngine;
|
|
|
|
namespace BITKit.WorldChunk
|
|
{
|
|
public class PolarisTerrainChunk : WorldChunk
|
|
{
|
|
private GStylizedTerrain terrain;
|
|
private Vector2 _position;
|
|
|
|
private void Start()
|
|
{
|
|
terrain = GetComponent<GStylizedTerrain>();
|
|
var pos = terrain.transform.position;
|
|
_position = new Vector2(pos.x, pos.z);
|
|
Add(this);
|
|
destroyCancellationToken.Register(() => { Remove(this); });
|
|
}
|
|
|
|
public override Rect GetRect()
|
|
{
|
|
return new Rect(
|
|
_position,
|
|
new Vector2()
|
|
{
|
|
x = terrain.TerrainData.Geometry.Width,
|
|
y = terrain.TerrainData.Geometry.Length,
|
|
}
|
|
);
|
|
}
|
|
|
|
public override void SetActive(bool active)
|
|
{
|
|
terrain.gameObject.SetActive(active);
|
|
}
|
|
}
|
|
|
|
}
|