// Use this for initialization void Awake() { buttonList = new List <GameObject>(); soundEffects = GameObject.Find("Sounds").GetComponent <SoundEffectsHelper>(); interfaceScript = GetComponent <MainInterfaceScript>(); //Fill all the interactive objects with the rigth data for (int i = 0; i < questionsData.Count; ++i) { if (GameObject.Find("Views/InteractiveObjects/" + questionsData[i].activatingObject) != null) { GameObject interactiveObject = GameObject.Find("Views/InteractiveObjects/" + questionsData[i].activatingObject); interactiveObject.GetComponent <ActiveObject>().questions.Add(questionsData[i]); } } currentQuestions = new List <Question>(); //Fill an array with all the interactive objects GameObject interactiveObjects = GameObject.Find("Views/InteractiveObjects"); for (int i = 0; i < interactiveObjects.transform.childCount; ++i) { Transform child = interactiveObjects.transform.GetChild(i); if (child != null) { objectList.Add(child.gameObject); child.GetComponent <ActiveObject>().enabled = false; } } objectList[0].GetComponent <ActiveObject>().enabled = true; }
void Start() { // create a list of webcam devices that is available WebCamDevice[] devices = WebCamTexture.devices; soundEffects = GetComponent <SoundEffectsHelper>(); if (devices.Length > 0) { // initialized the webcam texture by the specific device number _webcamTexture = new WebCamTexture(devices[deviceNumber].name, imWidth, imHeight); // assign webcam texture to the meshrenderer for display WebCamTextureRenderer.material.mainTexture = _webcamTexture; // Play the video source _webcamTexture.Play(); // initialize video / image with given size videoSourceImage = new Mat(imHeight, imWidth, MatType.CV_8UC3); videoSourceImageData = new Vec3b[imHeight * imWidth]; cannyImage = new Mat(imHeight, imWidth, MatType.CV_8UC1); cannyImageData = new byte[imHeight * imWidth]; // create processed video texture as Texture2D object processedTexture = new Texture2D(imWidth, imHeight, TextureFormat.RGBA32, true, true); // assign the processedTexture to the meshrenderer for display ProcessedTextureRenderer.material.mainTexture = processedTexture; } // create opencv window to display the original video //Cv2.NamedWindow("Haar Detection"); }
void Awake() { if (Instance == null) { Instance = this; } }
void Awake() { if (Instance != null) { Debug.LogError("Multiple instances of SoundEffectsHelper!"); } Instance = this; }
void Awake() { if (Instance != null) { Debug.LogError("Несколько экземпляров SoundEffectsHelper!"); } Instance = this; }
void Awake() { // Register the singleton if (Instance != null) { Debug.LogError ("Multiple instances of SoundEffectsHelper!"); } Instance = this; }
void Awake() { // регистрируем синглтон if (Instance != null) { Debug.LogError("Несколько экземпляров SoundEffectsHelper!"); } Instance = this; }
void Awake() { // Register the singleton if (Instance != null) { Debug.LogError("Instancias múltiples."); } Instance = this; }
void Awake() { // Register singleton if (Instance != null) { Debug.LogError("Multiple instances of SFXHelper!"); } Instance = this; }
void Awake() { // Register the singleton if (Instance != null) { Debug.LogError("Multiple instances of SoundEffectsHelper!"); } Instance = this; }
void Awake() { if (Instance != null) { Debug.LogError("More than one instance of SpecialEffectsHlper!"); } Instance = this; }
private void Awake() { // Register singletone if (Instance != null) { Debug.LogError("More than one exemple of SoundEffectsHelper."); } Instance = this; }
void Awake() { //singleton if (Instance != null) { Debug.LogError("Multiple instance of SoundEffectsHelper"); } Instance = this; }
public void Awake() { // register singleton if (Instance != null) { Debug.LogError("More than one sound effects helper being created!"); } Instance = this; }
void Awake() { // Register the singleton if (Instance != null) { Debug.LogError("Multiple instances of SoundEffectsHelper!"); } Instance = this; AudioSource.PlayClipAtPoint(backgroundSound, transform.position); }
void Awake() { if (instance != null) { return; } else { instance = this; } }
void Awake() { if (Instance != null) { Debug.LogError("Multiple instances of SoundEffectsHelper!"); } //audioData = GetComponent<AudioSource>(); //audioData.Play(0); Instance = this; }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
void Awake() { // Register the singleton if (Instance != null) { Debug.LogError("Multiple instances of SoundEffectsHelper!"); } this.HasMusic = PlayerPrefs.GetString("HasMusic").Equals("On"); this.HasSound = PlayerPrefs.GetString("HasSound").Equals("On"); Instance = this; }
// Use this for initialization void Start() { scripts = GameObject.Find("Scripts"); menu = GameObject.Find("MainInterface/Menu"); planchette = GameObject.Find("MainInterface/Menu/OuijaBoard/Planchette"); hangMan = GameObject.Find("MainInterface/Menu/OuijaBoard/HangMan").GetComponent <HangManScript>(); if (GameObject.Find("Sounds").GetComponent <SoundEffectsHelper>() != null) { soundEffects = GameObject.Find("Sounds").GetComponent <SoundEffectsHelper>(); } toPositionMenu = new Vector3(0, 0, 0); spiritThinkingCooldown = spiritThinkingTime; soundEffects.MakeStartSound(Camera.main.transform.position); soundEffects.MakeAmbianceMusic(); }
private void updateSoundState() { //play/pause music SoundEffectsHelper soundScript = FindObjectOfType(typeof(SoundEffectsHelper)) as SoundEffectsHelper; if (soundScript != null) { if (soundEnabled) { soundScript.soundEnabled = true; } else { soundScript.soundEnabled = false; } } }
void Awake() { // Register the singleton if (Instance != null) { Debug.LogError("Multiple instances of SoundEffectsHelper!"); } Instance = this; _audio = GetComponent <AudioSource>(); if (_audio == null) { // if AudioSource is missing //Debug.LogWarning("AudioSource component missing from this gameobject. Adding one."); // let's just add the AudioSource component dynamically _audio = gameObject.AddComponent <AudioSource>(); } }
void Awake() { // Register the singleton if (Instance != null && Instance != this) { Debug.Log("reinstanciete SoundEffectHalper"); Destroy(this.gameObject); return; } else { Instance = this; } //maintain all in scenes DontDestroyOnLoad(gameObject); }
// Use this for initialization void Start() { soundEffects = GameObject.Find("Sounds").GetComponent <SoundEffectsHelper>(); GameObject[] views = new GameObject[4]; views[0] = GameObject.Find("FirstView"); views[1] = GameObject.Find("SecondView"); views[2] = GameObject.Find("ThirdView"); views[3] = GameObject.Find("FourthView"); for (int i = 0; i < 4; ++i) { SpriteRenderer sprite = views[i].GetComponent <SpriteRenderer>(); Vector3 view = new Vector3(views[i].transform.position.x + (sprite.bounds.size.x / 2), views[i].transform.position.y + (sprite.bounds.size.y / 2), -10.0f); viewPositions[i] = view; } Camera.main.transform.position = viewPositions[1]; }
// Use this for initialization void Start() { soundsEffects = GameObject.Find("Sounds").GetComponent <SoundEffectsHelper>(); }
// Use this for initialization void Start() { questionData = GameObject.Find("MainInterface").GetComponent <QuestionDataScript>(); soundEffects = GameObject.Find("Sounds").GetComponent <SoundEffectsHelper>(); }
public void PlaySound(Vector3 position, float volumeOverride) { SoundEffectsHelper.PlaySound(clip, position, volumeOverride); }
public void PlaySound(Vector3 position) { SoundEffectsHelper.PlaySound(clip, position, volume); }
public void PlaySound(float volumeOverride) { SoundEffectsHelper.PlaySound(clip, volumeOverride); }
public void PlaySound() { SoundEffectsHelper.PlaySound(clip, volume); }
void Awake() { Instance = this; }