예제 #1
0
 void UpdateAllWindowObjects()
 {
     GetAllImages();
     GetAllButtons();
     GetAllTexts();
     myData.BackgroundColor = Background_Handler.GetCurrColor();
 }
예제 #2
0
    /// <summary>
    /// Populates the window by creating all the UIElements from the UIWindowData
    /// </summary>
    void PopulateWindow(int index)
    {
        UIWindow.WindowData data = canvasWindow[index].LoadWindow(canvasWindowID[index]);
        CC_Manager._instance.LoadWindow(data, index);
        //UIWindow.WindowData data = canvasWindowData[index];

        for (int i = 0; i < data.images.Count; i++)
        {
            GameObject image = Instantiate(imagePrefab) as GameObject;
            image.GetComponent <ImageData>().Initialize(data.images[i], index);
            CC_Manager._instance.allUIElements.Add(image);
            image.GetComponent <CC_Selectable>().myCanvas = index;
        }

        for (int i = 0; i < data.buttons.Count; i++)
        {
            GameObject button     = Instantiate(buttonPrefab) as GameObject;
            ButtonData buttonData = button.GetComponent <ButtonData>();
            buttonData.Initialize(data.buttons[i], index);
            CC_Manager._instance.allUIElements.Add(button);
        }

        for (int i = 0; i < data.texts.Count; i++)
        {
            GameObject text = Instantiate(textPrefab) as GameObject;
            text.GetComponent <TextData>().Initialize(data.texts[i], index);
            CC_Manager._instance.allUIElements.Add(text);
            text.GetComponent <CC_Selectable>().myCanvas = index;
        }

        Background_Handler.SetCurrColor(data.BackgroundColor, cameras[index]);
    }
예제 #3
0
 void Awake()
 {
     if (_instance != null)
     {
         Destroy(_instance);
         Debug.LogWarning("Trying to create multiple instances of Background_Handler");
     }
     _instance = this;
 }
 void Awake()
 {
     if (_instance != null) {
         Destroy(_instance);
         Debug.LogWarning("Trying to create multiple instances of Background_Handler");
     }
     _instance = this;
 }