12 [Header(
"Collectable Spot:")]
13 [SerializeField]
private bool _editId;
17 public bool EditId {
get => _editId;
set => _editId = value; }
24 public int Id {
get => _id;
set => _id = value; }
34 private float _weight = 1;
38 public float Weight {
get => _weight;
set => _weight = Mathf.Max(value, 0); }
40 private void OnValidate()
98 base.AutoAssign(room);
107 var position =
new Vector2DInt(
Row,
Column);
An object tied to the cell index of a RoomComponent.
RoomComponent Room
The containing room.
int Column
The column index.
A class for creating groups of CollectableResource.
string Name
The group name.
Represents a collectable spot.
float Weight
The manual draw weight of the collectable spot.
bool CollectableExists()
True if the collectable spot exists.
CollectableGroup Group
The collectable group.
bool CanAcquire()
Returns true if the collectable can be acquired.
override void AutoAssign(RoomComponent room)
Auto assigns elements to the collectable spot.
bool IsAcquired()
True if the collectable spot is already acquired.
CollectableSpot GetMMCollectableSpot()
Returns new generation data for the collectable spot.
bool Acquire()
If the collectable spot exists and has not already been acquired, adds it to the current layout state...
int CollectableId()
The collectable ID. If the collectable spot does not exist in the layout, returns -1.
bool EditId
If true, the ID can be edited in the inspector.
int Id
The unique location ID, relative to the cell.
Contains methods for creating random ID's.
static int AutoAssignId(int id)
If the specified ID is greater than zero, returns the ID. Otherwise, returns a random positive intege...
A component for creating a room.
Room RoomLayout
The room data.
RoomState RoomState
The room state.