private void Start()
 {
     image       = GetComponent <Image>();
     letterImage = transform.Find("Letter").GetComponent <Image>();
     StartCoroutine(FlashText());
     transform.DOMove(Vector3.zero, 3f);
     gameManager  = GameObject.Find("GameManager").GetComponent <BubbleGameController>();
     audioManager = GameObject.Find("AudioManager").GetComponent <AudioManager>();
 }
Beispiel #2
0
 private void Start()
 {
     gameManager  = BubbleGameController.instance;
     audioManager = GameObject.Find("AudioManager").GetComponent <AudioManager>();
     GetComponent <Image>().sprite = bubbles[Random.Range(0, bubbles.Length)];
     wordIndex         = Random.Range(0, words.Length);
     wordObject.sprite = gameManager.sprites[wordIndex];
     gameObject.GetComponent <AudioSource>().clip = (Resources.Load <AudioClip>("Sounds/" + wordObject.sprite.name));
     transform.localScale = new Vector3(1, 1, 1) * Random.Range(2f, 4f);
 }
    private void Awake()
    {
        #region Singleton

        if (instance != null)
        {
            Debug.LogWarning("More than one instance of " + this.name + " found!");
            return;
        }
        instance = this;

        #endregion

        sprites = LevelDataChanger.instance.LoadSprites();

        //_imagePath = LevelData.Singleton.bookName + LevelData.Singleton.numberOfLevel + LevelData.Singleton.wordGroupToUse;
        //Debug.Log(_imagePath);

        //if (_imagePath == "0")
        //{
        //    _imagePath = "KBA/u8/phonics";
        //    Debug.Log("Can't find the image path");
        //}

        //Object[] loadedSprites = Resources.LoadAll(_imagePath, typeof(Sprite));
        //sprites = new Sprite[loadedSprites.Length];
        for (int i = 0; i < sprites.Length; i++)
        {
            //sprites[i] = (Sprite)loadedSprites[i];
            if (sprites[i].name.Length < 2)
            {
                finalBubble.transform.Find("Letter").GetComponent <Image>().sprite = sprites[i];
                finalBubble.GetComponent <FlashyLetter>().letterNameSound.clip     = (Resources.Load <AudioClip>("Sounds/" + sprites[i].name));
                finalBubble.GetComponent <FlashyLetter>().phonicsSound.clip        = (Resources.Load <AudioClip>("Sounds/PhonicsSounds/soundch_" + sprites[i].name));
            }
        }
    }
Beispiel #4
0
 private void Start()
 {
     gameManager          = GameObject.Find("GameManager").GetComponent <BubbleGameController>();
     audioManager         = GameObject.Find("AudioManager").GetComponent <AudioManager>();
     transform.localScale = new Vector3(1, 1, 1) * Random.Range(1f, 3f);
 }