예제 #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);
    }
    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);
    }