예제 #1
0
    void Start()
    {
        startTime = Time.time;
        Random.InitState(System.DateTime.Now.Millisecond);
        audioSource.volume = volumeScaler;


        foreach (var instrument in System.Enum.GetValues(typeof(InstrumentType)))
        {
            var request = ScriptableObject.CreateInstance <Request>();
            request.instrumentType = (InstrumentType)instrument;
            request.maxTimeLeft    = 10.0;
            request.timeLeft       = request.maxTimeLeft;
            freeRequests.Add(request);
        }

        spawner = GetComponent <AudienceSpawner>();
        while (members.Count < maxMemberCount)
        {
            AudienceMember newMember = spawner.TrySpawnMember();
            if (newMember != null)
            {
                members.Add(newMember);
                freeMembers.Add(newMember);
            }
        }

        gameOverDisplay.enabled = false;
        restart.enabled         = false;
        restart.gameObject.SetActive(false);
        for (int i = 0; i < restart.transform.childCount; i++)
        {
            restart.transform.GetChild(i).gameObject.SetActive(false);
        }
    }
예제 #2
0
 private void OnEnable()
 {
     if (_Instance == null)
     {
         _Instance = this;
     }
     else
     {
         Debug.LogError("ERROR: Instance Already Exists");
     }
 }