Inheritance: MonoBehaviour
コード例 #1
0
 // Use this for initialization
 void Start()
 {
     guiText = gameObject.GetComponent<GUIText>();
     textBackground = GameObject.Find("ScoreBackground").GetComponent<GUITexture>();
     mic = GameObject.Find ("Beat Detector").GetComponent<MicrophoneInput>();
     player = GameObject.Find ("Player").GetComponent<Movement>();
 }
コード例 #2
0
 void Start() {
     if (objectToSpawn == null)
         Debug.LogError("You need to set a prefab to Object To Spawn -parameter in the editor!");
     if (audioInputObject == null)
         audioInputObject = GameObject.Find("AudioInputObject");
     micIn = (MicrophoneInput) audioInputObject.GetComponent("MicrophoneInput");
 }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     animator = GetComponent<Animator>();
     if (audioInputObject == null)
         audioInputObject = GameObject.Find("MicMonitor");
     micIn = (MicrophoneInput)audioInputObject.GetComponent("MicrophoneInput");
 }
コード例 #4
0
    void Awake()
    {
        // singleton
        if(instance == null) instance = this; else if(instance != this) Destroy(gameObject);

        audioSource = GetComponent<AudioSource>();
    }
コード例 #5
0
 void Start()
 {
     audioInputObject = GameObject.Find("AudioInput");
     micIn = (MicrophoneInput) audioInputObject.GetComponent("MicrophoneInput");
     audioSource = gameObject.GetComponent<AudioSource>();
     audioSource.clip = audioClip;
 }
コード例 #6
0
ファイル: NoteFinder.cs プロジェクト: 9/Shrednought
 // Use this for initialization
 void Start()
 {
     gui_text = this.GetComponent<GUIText>();
     if (audioInputObject == null)
         audioInputObject = GameObject.Find("MicMonitor");
     micIn = (MicrophoneInput)audioInputObject.GetComponent("MicrophoneInput");
 }
コード例 #7
0
ファイル: SpawnByLoudness.cs プロジェクト: gmfnasg/BattleLine
    MicrophoneInput micIn; //宣告指定自己寫的腳本的變數名稱  但還沒不能用來抓取數值

    #endregion Fields

    #region Methods

    void Start()
    {
        if (objectToSpawn == null)
            Debug.LogError("You need to set a prefab to Object To Spawn -parameter in the editor!");
        if (audioInputObject == null)
            audioInputObject = GameObject.Find("AudioInputObject");

        print(" error  "+audioInputObject.name);
        micIn = (MicrophoneInput) audioInputObject.GetComponent("MicrophoneInput"); //指定取得指定物件的指定腳本MicrophoneInput裡的變數,該腳本的變數不用宣告為靜態(static)變數
    }
コード例 #8
0
 void Start()
 {
     syllableText = GetComponent <Text>();
     mInput       = GameObject.FindObjectOfType <MicrophoneInput>();
 }
コード例 #9
0
 // Use this for initialization
 void Start()
 {
     microphoneInput = GetComponent <MicrophoneInput>();
     StartCoroutine(RunTestCoroutine());
 }
コード例 #10
0
    // Use this for initialization
    void Start()
    {
        // Primitives
        objectsParent = GameObject.Find("ObjectsParent");
        primitives = new GameObject[primitiveNum];
        for( int i = 0; i < primitiveNum; i++) {
            primitives[i] = Instantiate( primitive, new Vector3(), Quaternion.identity) as GameObject;
            primitives[i].layer = 0;
            primitives[i].transform.parent = objectsParent.transform;
        }

        // NGUI
        posXSlider = GameObject.Find( "posX" ).gameObject.GetComponent<UISlider>();
        posXLabel = GameObject.Find( "posX" ).gameObject.transform.FindChild( "Thumb" ).gameObject.transform.FindChild( "Value" ).gameObject.GetComponent<UILabel>();
        posYSlider = GameObject.Find( "posY" ).gameObject.GetComponent<UISlider>();
        posYLabel = GameObject.Find( "posY" ).gameObject.transform.FindChild( "Thumb" ).gameObject.transform.FindChild( "Value" ).gameObject.GetComponent<UILabel>();
        posZSlider = GameObject.Find( "posZ" ).gameObject.GetComponent<UISlider>();
        posZLabel = GameObject.Find( "posZ" ).gameObject.transform.FindChild( "Thumb" ).gameObject.transform.FindChild( "Value" ).gameObject.GetComponent<UILabel>();

        rotateXSlider = GameObject.Find("rotateX").gameObject.GetComponent<UISlider>();
        rotateXLabel = GameObject.Find("rotateX").gameObject.transform.FindChild("Thumb").gameObject.transform.FindChild("Value").gameObject.GetComponent<UILabel>();
        rotateYSlider = GameObject.Find("rotateY").gameObject.GetComponent<UISlider>();
        rotateYLabel = GameObject.Find("rotateY").gameObject.transform.FindChild("Thumb").gameObject.transform.FindChild("Value").gameObject.GetComponent<UILabel>();
        rotateZSlider = GameObject.Find("rotateZ").gameObject.GetComponent<UISlider>();
        rotateZLabel = GameObject.Find("rotateZ").gameObject.transform.FindChild("Thumb").gameObject.transform.FindChild("Value").gameObject.GetComponent<UILabel>();

        scaleXSlider = GameObject.Find("scaleX").gameObject.GetComponent<UISlider>();
        scaleXLabel = GameObject.Find("scaleX").gameObject.transform.FindChild("Thumb").gameObject.transform.FindChild("Value").gameObject.GetComponent<UILabel>();
        scaleYSlider = GameObject.Find("scaleY").gameObject.GetComponent<UISlider>();
        scaleYLabel = GameObject.Find("scaleY").gameObject.transform.FindChild("Thumb").gameObject.transform.FindChild("Value").gameObject.GetComponent<UILabel>();
        scaleZSlider = GameObject.Find("scaleZ").gameObject.GetComponent<UISlider>();
        scaleZLabel = GameObject.Find("scaleZ").gameObject.transform.FindChild("Thumb").gameObject.transform.FindChild("Value").gameObject.GetComponent<UILabel>();

        GameObject _toggleGlobalRotate = GameObject.Find("bGlobalRotate").gameObject;
        toggleGlobalRotate = _toggleGlobalRotate.GetComponent<UIToggle>();

        threshSlider = GameObject.Find("thresh").gameObject.GetComponent<UISlider>();

        colorRSlider = GameObject.Find("colorR").gameObject.GetComponent<UISlider>();
        colorRLabel = GameObject.Find("colorR").gameObject.transform.FindChild("Thumb").gameObject.transform.FindChild("Value").gameObject.GetComponent<UILabel>();
        colorGSlider = GameObject.Find("colorG").gameObject.GetComponent<UISlider>();
        colorGLabel = GameObject.Find("colorG").gameObject.transform.FindChild("Thumb").gameObject.transform.FindChild("Value").gameObject.GetComponent<UILabel>();
        colorBSlider = GameObject.Find("colorB").gameObject.GetComponent<UISlider>();
        colorBLabel = GameObject.Find("colorB").gameObject.transform.FindChild("Thumb").gameObject.transform.FindChild("Value").gameObject.GetComponent<UILabel>();
        colorASlider = GameObject.Find("colorA").gameObject.GetComponent<UISlider>();
        colorALabel = GameObject.Find("colorA").gameObject.transform.FindChild("Thumb").gameObject.transform.FindChild("Value").gameObject.GetComponent<UILabel>();

        //GameObject _toggleFill = GameObject.Find("bFill").gameObject;
        //toggleFill = _toggleFill.GetComponent<UIToggle>();
        //GameObject _toggleReverse = GameObject.Find("bReverseTog").gameObject;
        //toggleReverse = _toggleReverse.GetComponent<UIToggle>();
        GameObject _toggleRandom = GameObject.Find("bRandom").gameObject;
        toggleRandom = _toggleRandom.GetComponent<UIToggle>();

        mic = GameObject.Find("AudioInput").gameObject.GetComponent<MicrophoneInput>();
    }
コード例 #11
0
ファイル: SpawnByLoudness.cs プロジェクト: Treezzy/Garbage
	// Use this for initialization
	void Start () {
		if (audioInputObject == null)
			audioInputObject = GameObject.Find("MicMonitor");
		micIn = (MicrophoneInput) audioInputObject.GetComponent<MicrophoneInput>();
	}
 void Awake()
 {
     MicrophoneInput.InitMain();
 }
コード例 #13
0
 private void Reset()
 {
     _microphone = GetComponent <MicrophoneInput>();
 }
コード例 #14
0
ファイル: Movement.cs プロジェクト: dwarfcrank/AChangeOfHeart
 // Use this for initialization
 void Start()
 {
     input = GameObject.Find("Beat Detector").GetComponent<MicrophoneInput>();
     totalBeatsLastFrame = input.totalBeats;
     last_input = Time.time;
 }
コード例 #15
0
 void Awake()
 {
     Instance = this;
 }
コード例 #16
0
ファイル: GameManager.cs プロジェクト: angelsiv/paper-plane
 // Start is called before the first frame update
 void Start()
 {
     panelOver.SetActive(false);
     mic = GetComponent <MicrophoneInput>();
 }