コード例 #1
0
    void OnValidate()
    {
        UiWeaponPartSlotPanel uiSlot = GetComponentInChildren <UiWeaponPartSlotPanel>();

        if (uiSlot != null)
        {
            uiSlot.slotName.text = slotName;
        }
    }
コード例 #2
0
    void Awake()
    {
        if (SceneManager.GetActiveScene().name != "WeaponCustomization")
        {
            return;
        }

        UiWeaponPartSlotPanel uiSlot = Instantiate(uiSlotPrefab, transform).GetComponent <UiWeaponPartSlotPanel>();

        uiSlot.transform.localPosition = uiSlotPosition;
        uiSlot.slotName.text           = slotName;
    }
コード例 #3
0
    /// <summary>
    /// Use this for initialization
    /// </summary>
    protected override void Initialize()
    {
        base.Initialize();

        dragPanel = GameObject.FindGameObjectWithTag("WeaponPartItemPanel").GetComponent <DragAndDropPanel>();

        slot  = GetComponentInParent <WeaponPartSlot>();
        panel = GetComponent <UiWeaponPartSlotPanel>();
        panel.SetIndeces(containerIndex, new int[] { 0 });
        panel.SetObject(slot.part);

        uiWeaponPartList = FindObjectOfType <UiWeaponPartList>();
    }
コード例 #4
0
    void Load()
    {
        weapon.bodySlot.SetPart(null);

        playerData.LoadWeapon(selectedWeapon, weapon);
        weaponNameInput.text = weapon.weaponName;

        UiWeaponPartSlotPanel uiSlot = weapon.bodySlot.GetComponentInChildren <UiWeaponPartSlotPanel>();

        if (uiSlot != null)
        {
            uiSlot.SetObject(weapon.bodySlot.part);
        }

        UiWeaponStats.UpdateStats();
    }