示例#1
0
    private void Awake()
    {
        m_infoDisplayObject = Instantiate(m_infoDisplayPrefab, m_displaysParent.transform, false);
        m_infoDisplay       = m_infoDisplayObject.GetComponent <DisplayItemInfo>();

        UpdateItem();
        m_infoDisplayObject.SetActive(false);
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        //sets the onclick to the activate displayItem
        //sets displayItem as the target in MouseHover
        GameObject      target      = GameObject.Find("Image");
        GameObject      itemPool    = GameObject.Find("ScrollMenu");
        MouseHover      mh          = GetComponent <MouseHover>();
        DisplayItemInfo displayItem = target.GetComponent <DisplayItemInfo> ();
        ItemControl     ic          = itemPool.GetComponent <ItemControl> ();
        Button          b           = gameObject.GetComponent <Button> ();

        mh.display = displayItem;
        //If on click occurs, then the mouse hover enables, the image displays in infoPanl and the
        //game object that is selected for the equipment is this one.
        b.onClick.AddListener(delegate {
            mh.enabled          = true;
            displayItem.enabled = true;
            ic.item             = gameObject;
            selectedItem        = gameObject;
        });
    }
示例#3
0
文件: Pickup.cs 项目: Tommiee/Mythe
 void Start()
 {
     showObject = canvas.GetComponent <DisplayItemInfo>();
     invScript  = inventory.GetComponent <Inventory>();
 }