Inheritance: MonoBehaviour
Exemple #1
0
    void Awake()
    {
        instance = this;

        if (Microphone.devices.Length > 0)
        {
            microphoneInput       = Microphone.Start(Microphone.devices[0], true, 999, 44100);
            microphoneInitialized = true;
        }
    }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        micInput     = GetComponent <MicInput>();
        audioPlayer  = GetComponent <AudioSource>();
        instructions = Resources.LoadAll <AudioClip>("Sounds");
        string currentTarget = null;

        stage  = -1;
        stages = new currentStageFunction[] { stage0, stage1, stage2, stage3,
                                              stage4, stage5, stage6, stage7 };
        nextStage();
    }
Exemple #3
0
        void Awake ()
        {
            // Create a layer mask for the Shootable layer.
            shootableMask = LayerMask.GetMask ("Shootable");

            // Set up the references.
            gunParticles = GetComponent<ParticleSystem> ();
            gunLine = GetComponent <LineRenderer> ();
            gunAudio = GetComponent<AudioSource> ();
            gunLight = GetComponent<Light> ();
			micInput = GetComponentInParent<MicInput> ();
			//micInput = 
			//faceLight = GetComponentInChildren<Light> ();
        }
Exemple #4
0
        void Awake()
        {
            // Create a layer mask for the Shootable layer.
            shootableMask = LayerMask.GetMask ("Shootable");

            // Set up the references.
            gunParticles = GetComponent<ParticleSystem> ();
            gunLine = GetComponent <LineRenderer> ();
            gunAudio = GetComponent<AudioSource> ();
            gunLight = GetComponent<Light> ();
            micInput = GetComponentInParent<MicInput> ();
            //micInput =
            //faceLight = GetComponentInChildren<Light> ();
        }
Exemple #5
0
        void AwakeMultiplayer()
        {
            m_MultiplayerController = GetComponent <MultiplayerController>();
            m_MicInput = GetComponent <MicInput>();
            if (m_MicInput != null)
            {
                var descriptor = new NetworkedTypeDescriptor(
                    typeof(float),
                    (value) => BitConverter.GetBytes((float)value),
                    (bytes) => BitConverter.ToSingle(bytes, 0));

                NetworkUser.RegisterDescriptorKey("micInput", descriptor);
                m_MicInput.OnMicLevelChanged += SendMicInput;
            }
        }
Exemple #6
0
 // Start is called before the first frame update
 void Start()
 {
     micPos = mic.GetComponent <MicInput>();
 }
Exemple #7
0
 // Start mic when scene starts.
 private void OnEnable( )
 {
     InitMic( );
     isInitialized = true;
     Instance      = this;
 }
Exemple #8
0
 // start mic when scene starts
 void OnEnable()
 {
     InitMic();
     _isInitialized = true;
     Inctance       = this;
 }
 // Use this for initialization
 void Start()
 {
     playerT = GetComponent <Transform>();
     mi      = GetComponent <MicInput>();
 }
Exemple #10
0
 void Awake()
 {
     instance = this;
 }
Exemple #11
0
 void OnEnable()
 {
     InitMic();
     Instance = this;
 }