Example #1
0
 void OnCollisionEnter(Collision other)
 {
     if (other.gameObject.tag == "Transmitter")
     {
         block = other.transform.GetComponent <LightUpBlock>();
         if (block.blockActivatable())
         {
             gc.AddScore();
         }
         block.Activate();
     }
 }
Example #2
0
    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;
            }
        }
    }
Example #3
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        if (GUILayout.Button("Activate!"))
        {
            LightUpBlock lightUpBlock = (LightUpBlock)target;

            if (lightUpBlock != null)
            {
                lightUpBlock.Activate();
            }
        }
    }
Example #4
0
 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;
     }
 }