コード例 #1
0
    public void TestTransmission(int _buttonNum)
    {
        if (!m_TransmissionSolved)
        {
            if (_buttonNum == diseaseHolder.currDisease.myTransmission.myPair.button)
            {
                Debug.LogFormat("Correct Transmission vector: {0}", diseaseHolder.currDisease.myTransmission.transmissionType);
                m_TransmissionSolved = true;
                //press down all buttons
                //foreach(GameObject go in buttons)
                //{
                //    go.GetComponent<buttonPress>().DisableButt();
                //}

                for (int index = 0; index < buttons.Count - 2; ++index)
                {
                    buttons[index].GetComponent <buttonPress>().DisableButt();
                }
                buttons[_buttonNum - 1].GetComponent <MeshRenderer>().material.color = Color.yellow;
            }

            else
            {
                ++testCount;
                //do bad thing
                Debug.LogFormat("INCORRECT Transmission vector: {0}", diseaseHolder.currDisease.myTransmission.transmissionType);
                StartCoroutine(fx.Shake(200, 0.01f, 0.3f));
                buttons[_buttonNum - 1].GetComponent <buttonPress>().StartPress(0);
                ChangeWaterColor();
            }
        }
        CheckAnswer();
    }
コード例 #2
0
 private void OnMouseDown()
 {
     ChooseNewRotTarget();
     StartCoroutine(fx.Shake(70, 0.007f, 0.1f));
     GetComponent <AudioSource>().Play();
 }