void OnCollisionEnter(Collision other) { if (other.gameObject.tag == "Transmitter") { block = other.transform.GetComponent <LightUpBlock>(); if (block.blockActivatable()) { gc.AddScore(); } block.Activate(); } }
public void SetToRandomVacantLocation(LightUpBlock lightUpBlock) { ListHelper.ShuffleList(ref m_lightCubeLocations); foreach (Transform lightCubeLocation in m_lightCubeLocations) { if (lightCubeLocation.childCount == 0) { lightUpBlock.transform.SetParent(lightCubeLocation); lightUpBlock.transform.localPosition = new Vector3(0f, 2f, 0f); break; } } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); if (GUILayout.Button("Activate!")) { LightUpBlock lightUpBlock = (LightUpBlock)target; if (lightUpBlock != null) { lightUpBlock.Activate(); } } }
void CheckLights() { lightcount = 0; foreach (LightUpBlock transmitter in m_transmitters) { m_lightUpBlock = transmitter; lightCounter.text = "" + lightcount.ToString("000"); if (m_lightUpBlock.blockActive()) { lightcount++; } } if (lightcount == 0) { gc.GameOver = true; } }