public static void onDestroyGravCube(Gravity cube) { //Called from the GravCube class when destroyed to refresh the list FlipCube fc = FindObjectOfType <FlipCube>(); if (fc != null) { //Only refresh if this still exist fc.refreshGravCubes(cube); } }
public void OnDestroy() { //When destroyed, remove it from the list in FlipCube FlipCube.onDestroyGravCube(this); }