コード例 #1
0
    public void Select()
    {
        ImplantController impCont = GameObject.Find("ImplantScreen").GetComponent <ImplantController>();
        Transform         parent  = GameObject.Find("Implants").transform;

        if (inv_is_parent)
        {
            inv.DeleteItem(implant, false);
        }

        implant.transform.SetParent(parent);
        impCont.AddReference(implant);

        implant.GetComponent <RectTransform>().localPosition = new Vector3(0, 0, 0);
        implant.GetComponent <ImplantPrefab>().Setup();
        iUIh.Refresh();
    }
コード例 #2
0
    public void Setup(bool locked, int cost)
    {
        implantController = GameObject.Find("ImplantScreen").GetComponent <ImplantController>();
        img              = transform.GetComponent <Image>();
        cost_text        = transform.GetComponentInChildren <Text>();
        is_used          = false;
        unlock_cost      = cost;
        is_temp_unlocked = false;

        if (locked)
        {
            is_locked = true;
            img.color = Color.gray;
        }
        else
        {
            is_locked = false;
            img.color = Color.white;
        }
    }