void Awake() { this.filter = this.GetComponent <MeshFilter>(); this.filter.mesh = new Mesh(); this.quadGen = null; this.offset = Vector2.zero; }
private void GetMask() { this.maskGenerator = new CircleMeshGenerator(this.filter.mesh, 0, this.radius); this.maskGenerator.GenerateMesh(this.transform.position, Vector2.zero, this.transform.right, this.resolution); }
public void SetDimensions(float width, float height, Vector2 offset) { this.quadGen = new QuadMeshGenerator(this.filter.mesh, 0, width, height); this.offset = offset; }
private void OnEnterLooking() { this.transform.rotation = Quaternion.identity; this.maskGenerator = new ConeMeshGenerator(this.filter.mesh, obstructionLayers, this.coneVisionWidth, this.coneVisionHeight); this.filter.mesh = this.maskGenerator.GenerateMesh(this.transform.position + (Vector3)(TileCoordinates.UnitsToTiles(1) * this.states.GetLookDirection()), TileCoordinates.UnitsToTiles(1) * this.states.GetLookDirection(), this.states.GetLookDirection(), this.visionResolution); }
private void OnEnterStanding() { this.maskGenerator = new CircleMeshGenerator(this.filter.mesh, obstructionLayers, this.circleVisionRadius); this.filter.mesh = this.maskGenerator.GenerateMesh(this.transform.position, Vector2.zero, this.transform.right, this.visionResolution); }