Class CenterController
Interprets properties of the parent cube. Default is disabled. This script is only enabled when it received set parent input.
Namespace: XRC.Students.SU2023.IN03.Chen
Assembly: cs.temp.dll.dll
Syntax
public class CenterController : MonoBehaviour, ICenter, ICreateCube
Methods
AddCube(GameObject)
Add the child cube to the parent it connects to
Declaration
public void AddCube(GameObject childCube)
Parameters
Type | Name | Description |
---|---|---|
GameObject | childCube | The child cube. |
Awake()
Get the gameObject this script is attached to Create an empty list to store the child cubes of this cube.
Declaration
public void Awake()
Clear()
Empty the child list of this parent cube
Declaration
public void Clear()
Detach(GameObject)
Detach this child cube from its parent cube and remove this child from the child list
Declaration
public void Detach(GameObject child)
Parameters
Type | Name | Description |
---|---|---|
GameObject | child | The child cube to be detached from parent. |
DetachChildHelper(GameObject)
Detach this child cube from its parent cube
Declaration
public void DetachChildHelper(GameObject child)
Parameters
Type | Name | Description |
---|---|---|
GameObject | child | The child cube to be detached from parent. |
OrderChildren()
Spread the children cubes evenly around the center cube.
Declaration
public void OrderChildren()
Update()
Update the line between parent cube and its children cubes.
Declaration
public void Update()