Exemple #1
0
    public void init(GameObject parentPanel, string name, Rarity rarity, BaseItem baseItem)
    {
        //find our components
        this.root          = parentPanel;
        infoPanel          = parentPanel.transform.Find("InfoPanel").gameObject;
        imagePanel         = parentPanel.transform.Find("ImagePanel").gameObject;
        this.invController = InvintoryController.Instance;


        if (infoPanel == null)
        {
            Debug.Log("infoPanel null");
        }
        if (imagePanel == null)
        {
            Debug.Log("imagePanel null");
        }

        this.ItemName = name;
        this.Rarity   = rarity;
        this.BaseItem = baseItem;
    }
 // Use this for initialization
 void Start()
 {
     invControl  = InvintoryController.Instance;
     itemFactory = ItemFactory.Instance;
 }
 void Awake()
 {
     Instance = this;
     //all factories are singeltons
     itemFactory = ItemFactory.Instance;
 }