Example #1
0
    void Start()
    {
        /*
         * Initial setting for this game object.
         * The settings are like index setting and explanation settings.
         * These meant so that this game object know which explanation belong to this game object.
         */
        SetExhibition();

        //Get reference to this script for comparison purpose.
        scriptButtonExhibition = gameObject.GetComponent <ScriptButtonExhibition>();

        //Find a Player game object and then take its RectTransform component.
        playerRectTransform = GameObject.Find("Player").GetComponent <RectTransform>();
        //Get image player reference.
        playerImage = GameObject.Find("Player").GetComponent <Image>();

        //This game object Image.
        image = gameObject.GetComponent <Image>();
        //This game object RectTransform.
        rectTransform = gameObject.GetComponent <RectTransform>();

        //Get reference to panel log game object.
        panelLog       = GameObject.Find("PanelLog");
        scriptPanelLog = panelLog.GetComponent <ScriptPanelLog>();

        //Assign value to panelNotification.
        panelNotification       = GameObject.Find("PanelNotification");
        scriptPanelNotification = panelNotification.GetComponent <ScriptPanelNotification>();

        //Assign image based on gameObject.name.
        image.sprite = Resources.Load <Sprite>("AssetsImage/MuseumCards/" + gameObject.name);
    }
 //Use this for initialization.
 void Start()
 {
     /*
      * These code below mostly to get reference to this game object component or
      *      this game object's child component.
      * Get this game object Image and RectTransform component.
      */
     image         = gameObject.GetComponent <Image>();
     rectTransform = gameObject.GetComponent <RectTransform>();
     //Fill in childPanelScrollTextLog and take its Image component.
     childPanelScrollTextLog      = gameObject.transform.Find("PanelScrollTextLog");
     childPanelScrollTextLogImage = childPanelScrollTextLog.gameObject.GetComponent <Image>();
     //Get the childTextClickToDismiss game object.
     childTextClickToDismiss = gameObject.transform.Find("TextClickToDismiss");
     //Get childTextClickToDismiss's text component.
     childTextClickToDismissText = childTextClickToDismiss.gameObject.GetComponent <Text>();
     //Get the childTextLog game object and its text component.
     childTextLog     = gameObject.transform.Find("PanelScrollTextLog").Find("TextLog");
     childTextLogText = childTextLog.gameObject.GetComponent <Text>();
     //Put reference to exhibitionDatabase.
     exhibitionDatabase       = GameObject.Find("ExhibitionDatabase");
     scriptExhibitionDatabase = exhibitionDatabase.GetComponent <ScriptExhibitionDatabase>();
     //Panel content show cards.
     panelContentShowCards       = GameObject.Find("PanelContentShowCards");
     scriptPanelContentShowCards = panelContentShowCards.GetComponent <ScriptPanelContentShowCards>();
     //Assign value to panelNotification.
     panelNotification       = GameObject.Find("PanelNotification");
     scriptPanelNotification = panelNotification.GetComponent <ScriptPanelNotification>();
 }
    void Start()
    {
        //Get the reference from this game object RectTransform component.
        rectTransform = gameObject.GetComponent <RectTransform>();

        //Assign value of border game object and its script.
        border       = GameObject.Find("Border");
        scriptBorder = border.GetComponent <ScriptBorder>();
        //Panel notification.
        panelNotification       = GameObject.Find("PanelNotification");
        scriptPanelNotification = panelNotification.GetComponent <ScriptPanelNotification>();
    }
    void Start()
    {
        /*
        Initial setting for this game object.
        The settings are like index setting and explanation settings.
        These meant so that this game object know which explanation belong to this game object.
        */
        SetExhibition();

        //Get reference to this script for comparison purpose.
        scriptButtonExhibition = gameObject.GetComponent<ScriptButtonExhibition>();

        //Find a Player game object and then take its RectTransform component.
        playerRectTransform = GameObject.Find("Player").GetComponent<RectTransform>();
        //Get image player reference.
        playerImage = GameObject.Find("Player").GetComponent<Image>();

        //This game object Image.
        image = gameObject.GetComponent<Image>();
        //This game object RectTransform.
        rectTransform = gameObject.GetComponent<RectTransform>();

        //Get reference to panel log game object.
        panelLog = GameObject.Find("PanelLog");
        scriptPanelLog = panelLog.GetComponent<ScriptPanelLog>();

        //Assign value to panelNotification.
        panelNotification = GameObject.Find("PanelNotification");
        scriptPanelNotification = panelNotification.GetComponent<ScriptPanelNotification>();

        //Assign image based on gameObject.name.
        image.sprite = Resources.Load<Sprite>("AssetsImage/MuseumCards/" + gameObject.name);
    }
 //Use this for initialization.
 void Start()
 {
     /*
     These code below mostly to get reference to this game object component or
         this game object's child component.
     Get this game object Image and RectTransform component.
     */
     image = gameObject.GetComponent<Image>();
     rectTransform = gameObject.GetComponent<RectTransform>();
     //Fill in childPanelScrollTextLog and take its Image component.
     childPanelScrollTextLog = gameObject.transform.Find("PanelScrollTextLog");
     childPanelScrollTextLogImage = childPanelScrollTextLog.gameObject.GetComponent<Image>();
     //Get the childTextClickToDismiss game object.
     childTextClickToDismiss = gameObject.transform.Find("TextClickToDismiss");
     //Get childTextClickToDismiss's text component.
     childTextClickToDismissText = childTextClickToDismiss.gameObject.GetComponent<Text>();
     //Get the childTextLog game object and its text component.
     childTextLog = gameObject.transform.Find("PanelScrollTextLog").Find("TextLog");
     childTextLogText = childTextLog.gameObject.GetComponent<Text>();
     //Put reference to exhibitionDatabase.
     exhibitionDatabase = GameObject.Find("ExhibitionDatabase");
     scriptExhibitionDatabase = exhibitionDatabase.GetComponent<ScriptExhibitionDatabase>();
     //Panel content show cards.
     panelContentShowCards = GameObject.Find("PanelContentShowCards");
     scriptPanelContentShowCards = panelContentShowCards.GetComponent<ScriptPanelContentShowCards>();
     //Assign value to panelNotification.
     panelNotification = GameObject.Find("PanelNotification");
     scriptPanelNotification = panelNotification.GetComponent<ScriptPanelNotification>();
 }
 void Start()
 {
     //Put reference to panel notification.
     panelNotification = GameObject.Find("PanelNotification");
     scriptPanelNotification = panelNotification.GetComponent<ScriptPanelNotification>();
 }
Example #7
0
 void Start()
 {
     //Put reference to panel notification.
     panelNotification       = GameObject.Find("PanelNotification");
     scriptPanelNotification = panelNotification.GetComponent <ScriptPanelNotification>();
 }