ClassicCityBuilderKit 1.9.0
|
structure made up of a collection of gameobjects each occupying exactly one point on the map
saves full position instead of just points like StructureCollection
if the members of the collection are ISaveData that data will also be stored
Classes | |
class | StructureCollectionFloatData |
class | StructureCollectionFloatVariantData |
class | Variant |
Public Member Functions | |
IEnumerable< Vector2Int > | GetChildPoints (IGridPositions positions) |
IEnumerable< Vector2Int > | GetPoints () |
retrieves all the points the structure occupies | |
bool | HasPoint (Vector2Int point) |
checks if the structure occupies a certain point | |
void | Add (Vector2Int point) |
void | Add (IEnumerable< Vector2Int > points) |
adds points to a structure, for example a tree to a tree structure collection this may not be possible for structures with fixed points like buildings typically called in a structures Start method | |
void | Add (Vector2Int point, Vector3 localPosition, Quaternion localRotation, Vector3 localScale) |
void | Remove (Vector2Int point) |
void | Remove (IEnumerable< Vector2Int > points) |
removes points from the structure, for some structures like buildings removing any point will remove the whole thing typically called in a structures OnDestroy method | |
GameObject | GetObject (Vector2Int point) |
void | Clear () |
string | GetName () |
retrieves the name of the structure for display in the UI | |
StructureCollectionFloatData | SaveData () |
void | LoadData (StructureCollectionFloatData data) |
Public Attributes | |
string | Name |
bool | IsDestructible = true |
bool | IsMovable = true |
bool | IsDecorator = false |
bool | IsWalkable = false |
StructureLevelMask | Level |
Variant[] | Variants |
Public Attributes inherited from CityBuilderCore.KeyedBehaviour | |
string | Key |
Properties | |
StructureReference | StructureReference [get, set] |
reference to the structure that keeps working even if the structure is replaced | |
Transform | Root [get] |
Properties inherited from CityBuilderCore.IKeyed | |
Properties inherited from CityBuilderCore.IStructure |
Events | |
Action< PointsChanged< IStructure > > | PointsChanged |
Events inherited from CityBuilderCore.IStructure | |
Action< PointsChanged< IStructure > > | PointsChanged |
has to be fired when a structures points changed so the manager can readjust paths only viable for structures that are stored in list form like underlying, collections and tiles other structures have to be reregistered | |
Additional Inherited Members | |
Static Public Member Functions inherited from CityBuilderCore.IStructure | |
static void | ReplacePoints (IStructure a, IStructure b, Vector2Int point) |
static void | ReplacePoints (IStructure a, IStructure b, IEnumerable< Vector2Int > points) |
|
inline |
adds points to a structure, for example a tree to a tree structure collection
this may not be possible for structures with fixed points like buildings
typically called in a structures Start method
points | the points that will be added to the structure |
Implements CityBuilderCore.IStructure.
string CityBuilderCore.StructureCollectionFloat.GetName | ( | ) |
retrieves the name of the structure for display in the UI
Implements CityBuilderCore.IStructure.
IEnumerable< Vector2Int > CityBuilderCore.StructureCollectionFloat.GetPoints | ( | ) |
retrieves all the points the structure occupies
Implements CityBuilderCore.IStructure.
bool CityBuilderCore.StructureCollectionFloat.HasPoint | ( | Vector2Int | point | ) |
checks if the structure occupies a certain point
point | a point on the map |
Implements CityBuilderCore.IStructure.
|
inline |
removes points from the structure, for some structures like buildings removing any point will remove the whole thing
typically called in a structures OnDestroy method
points | the points to remove |
Implements CityBuilderCore.IStructure.
|
getset |
reference to the structure that keeps working even if the structure is replaced
Implements CityBuilderCore.IStructure.