示例#1
0
    // Use this for initialization

    void Start()
    {
        timescripts            = Times.GetComponent <DN_Time>();
        timescripts.StartTimer = false;
        Time.timeScale         = 0;
        RandomScenarioNumber   = Random.Range(0, 6);
        if (Keyboard)
        {
            DN_PlayerMovement.SoloKeyBoard = true;
            DN_Mech.SoloKeyBoard           = true;
        }
        if (DN_MainMenuMannager.Scenarios)
        {
            Scenarios.SetActive(true);
            Intro.SetActive(false);
        }
    }
    public void CheckColor()
    {
        if (InputColor == Mycolors[CCCheck])
        {
            CCCheck++;

            if (CCCheck >= Mycolors.Count)
            {
                if (Mycolors.Count < 8)
                {
                    Colorplates = new List <GameObject>();
                    if (Colorplates.Count <= 0)
                    {
                        NM_ColorPlate[] nm_colorplate = FindObjectsOfType <NM_ColorPlate>();
                        foreach (NM_ColorPlate element in nm_colorplate)
                        {
                            element.thisiscolornow();
                            Colorplates.Add(element.gameObject);
                            element.thisiscolornow();

                            //element.gameObject.SetActive(false);
                        }
                    }
                    Mycolors.Add(Color.white);
                    Mycolors.Add(Color.white);
                    Mycolors.Add(Color.white);
                    Mycolors.Add(Color.white);
                    startnum++;
                    CCCheck = 0;
                    StartCoroutine(RepeatColors());
                }

                else
                {
                    for (int i = 0; i < escape.Length; i++)
                    {
                        escape[i].SetActive(true);
                    }
                }
            }
        }
        else
        {
            CCCheck = 0;
            DN_Time dn_time = FindObjectOfType <DN_Time>();
            dn_time.Timer = dn_time.Timer - 20;
            Colorplates   = new List <GameObject>();
            if (Colorplates.Count <= 0)
            {
                NM_ColorPlate[] nm_colorplate = FindObjectsOfType <NM_ColorPlate>();
                foreach (NM_ColorPlate element in nm_colorplate)
                {
                    Colorplates.Add(element.gameObject);


                    //element.gameObject.SetActive(false);
                }

                StartCoroutine(resetcolors());
            }
        }
    }