void Start() { textures = Resources.LoadAll <Texture2D>(""); randomImageObject = GameObject.FindObjectOfType <RandomImageDisplay>(); explosionScriptObject = GameObject.FindObjectOfType <ExplosionEffectScript>(); audio = GameObject.FindGameObjectsWithTag("ExplosionSound")[0].GetComponent <AudioSource>(); Debug.Log(audio); explosionSound = audio.clip; for (int i = 0; i < textures.Length; i++) { textureList.Add(textures[i]); } for (int i = 0; i < textures.Length; i++) { validIndices.Add(i); } for (int i = 0; i < textures.Length; i++) { indexCount.Add(i, 0); } for (int i = 0; i < textures.Length; i++) { indexImageDict.Add(i, textures[i]); } // defining the gold images AddAnswerToGoldDictionary(17, "ensure"); AddAnswerToGoldDictionary(19, "that"); AddAnswerToGoldDictionary(4, "just"); AddAnswerToGoldDictionary(10, "pictures"); }
// Use this for initialization void Start() { gc = FindObjectOfType <GameController>(); randomImageObject = FindObjectOfType <RandomImageDisplay>(); numberOfImagesLeft = gc.textureList.Count * gc.maxNumberOfInputsForAnImage; if (cam == null) { cam = Camera.main; } Vector3 upperCorner = new Vector3(Screen.width, Screen.height, 0.0f); Vector3 targetWidth = cam.ScreenToWorldPoint(upperCorner); float ballWidth = ball.GetComponent <Renderer>().bounds.extents.x; maxWidth = targetWidth.x - ballWidth - 2; StartCoroutine(Spawn()); }
// Use this for initialization void Start() { randomImageScriptObject = GetComponent <RandomImageDisplay>(); score = PlayerPrefs.GetInt("FinalScore"); scoreText.text = "This is your score: " + score; }
private void Start() { audio = this.gameObject.GetComponent <AudioSource>(); explosionSound = audio.clip; randomDisplayObject = GameObject.FindObjectOfType <RandomImageDisplay>(); }