Exemplo n.º 1
0
    //Test function
    public void add(collectable building)
    {
        Inventory.buildings.Add(building);
        Inventory_UI ui = Instantiate(UIElement, content).GetComponent <Inventory_UI>();

        ui.SetUp(Inventory.buildings.Count, building);
    }
Exemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     gameObject.GetComponent <Image>().enabled = false;
     inventory_ui     = GameObject.FindGameObjectWithTag("inventory-ui").GetComponent <Inventory_UI>();
     rectTransform    = gameObject.GetComponent <RectTransform>();
     canvas           = GameObject.FindGameObjectWithTag("canvas").GetComponent <Canvas>();
     regular_size     = rectTransform.localScale;
     scaled_size      = new Vector3(rectTransform.localScale.x * 2f, rectTransform.localScale.y * 2f, rectTransform.localScale.z);
     initial_position = rectTransform.localPosition;
     combinable       = false;
 }
Exemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     inventory_ui = GameObject.FindGameObjectWithTag("inventory-ui").GetComponent <Inventory_UI>();
 }