private void Start()
 {
     if (spawnManager == null)
     {
         spawnManager = GameObject.Find("BlockSpawnManager").GetComponent <BlockSpawnManager>();
     }
     clock = GameObject.Find("Timer").GetComponent <BPMTimer>();
 }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        if (BlockSpawnManager == null)
        {
            BlockSpawnManager = GameObject.Find("BlockSpawnManager").GetComponent <BlockSpawnManager>();
        }

        player = transform;

        // Find Cameras
        if (PlayerCamera == null)
        {
            PlayerCamera = GetComponentInChildren <Camera>();
        }

        if (SceneCamera == null)
        {
            SceneCamera = GameObject.Find("SceneCamera").GetComponent <Camera>();
        }

        firstPersonController = GetComponent <FirstPersonController>();
    }
    // Use this for initialization
    void Awake()
    {
        audioSource = GetComponent <AudioSource>();

        timer = GameObject.Find("Timer").GetComponent <BPMTimer>();
        osc   = GameObject.Find("OSC").GetComponent <OSC>();

        if (DrumVoiceSource == null)
        {
            DrumVoiceSource = GameObject.Find("DrumVoices");
        }
        rend = GetComponent <Renderer>();

        noise = DrumVoiceSource.GetComponentInChildren <NoiseGenerator>();

        voiceChannels = DrumVoiceSource.GetComponentsInChildren <DrumVoice>();

        if (voiceChannels != null)
        {
            voice = voiceChannels[channel];
        }

        message.address = "/block/" + OscID;
        message.values.Add("bang");

        UpdateSample(currentSample = (int)Random.Range(0, Samples.Count));

        if (PlaybackMode == Mode.Sample)
        {
            audioSource.loop        = false;
            audioSource.playOnAwake = false;
        }

        if (spawnManager == null)
        {
            spawnManager = GameObject.Find("BlockSpawnManager").GetComponent <BlockSpawnManager>();
        }
    }
Esempio n. 4
0
 void Awake()
 {
     instance = GetComponent <BlockSpawnManager>();
 }
 public void setSpawnManager(BlockSpawnManager manager)
 {
     blockSpawnManager = manager;
 }
Esempio n. 6
0
 protected override void LoadReferences()
 {
     blockSpawnManager =
         AssetDatabase.LoadAssetAtPath <BlockSpawnManager>(AssetDatabase.GUIDToAssetPath(EditorPrefs.GetString(PrefKey)));
 }