Archived
Private
Public Access
1
0
This repository has been archived on 2026-02-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2022-11-12 13:10:03 +01:00

28 lines
909 B
C#

using UnityEngine;
namespace Terrain {
public abstract class Obstical {
public readonly Vector2 Position;
public readonly Chunk Chunk;
public readonly GameObject GameObject;
protected readonly World World;
protected Obstical(Vector2 position, Chunk chunk) {
Position = position;
Chunk = chunk;
World = chunk.World;
GameObject = new GameObject();
GameObject.SetActive(false);
GameObject.transform.SetParent(Chunk.GetObject().transform);
GameObject.transform.position = position;
GameObject.name = $"Object [{position.x}:{position.y}]";
}
public abstract void CreateMeshData();
public void SetActive(bool value) { GameObject.SetActive(value); }
public override string ToString() => GameObject.name;
}
}