Пример #1
0
    // Start is called before the first frame update
    void Start()
    {
        //fonud inventory container in main Scene
        found_player = GameObject.FindGameObjectWithTag("Player");
        container    = found_player.GetComponentInChildren <EquipmentContainer>();

        container.OnEquipmentUpdated.AddListener(OnEquipmentUpdatedHandler);



        //add Event each slots
        for (int index = 0; index < EquipItemSlots.Count; index++)
        {
            EquipItemSlots[index].OnLeftClickEvent.AddListener(OnLeftClickEventHandler);
            EquipItemSlots[index].OnRightClickEvent.AddListener(OnRightClickEventHandler);
            EquipItemSlots[index].OnBeginDragEvent.AddListener(OnBeginDragEventHandler);
            EquipItemSlots[index].OnEndDragEvent.AddListener(OnEndDragEventHandler);
            EquipItemSlots[index].OnDragEvent.AddListener(OnDragEventHandler);
            EquipItemSlots[index].OnDropEvent.AddListener(OnDropEventHandler);
            EquipItemSlots[index].OnPointEnterEvent.AddListener(OnPointEnterEventHandler);
            EquipItemSlots[index].OnPointExitEvent.AddListener(OnPointExitEventHandler);
            EquipItemSlots[index].INDEX = index;
        }

        displayed = false;
        //display all item
        //DisplayedEquipment();
    }
Пример #2
0
 public static void PopulateEquipmentContainerProperties(EquipmentContainer equipContainer, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
 {
     if ((equipContainer != null) && (rd != null))
     {
         PowerTransformerConverter.PopulateConnectivityNodeContainerProperties(equipContainer, rd, importHelper, report);
     }
 }
Пример #3
0
        private string CheckIfPropertyNeedsId(string updated_property_info_name, object data)
        {
            switch (updated_property_info_name)
            {
            case "ConnectivityNode.ConnectivityNodeContainer":
                Circuit c = (Circuit)data;
                return(c.MRID);

            case "UsagePoint.ServiceLocation":
                ServiceLocation sl = (ServiceLocation)data;
                return(sl.MRID);

            case "PowerSystemResource.PSRType":
                PSRType psr = (PSRType)data;
                return(psr.Name);

            case "ACLineSegment.PerLengthImpedance":
                PerLengthImpedance pli = (PerLengthImpedance)data;
                return(pli.MRID);

            case "Equipment.EquipmentContainer":
                EquipmentContainer eq = (EquipmentContainer)data;
                return(eq.MRID);

            case "PowerSystemResource.AssetDatasheet":
                AssetInfo ad = (AssetInfo)data;
                return(ad.MRID);

            case "TransformerEnd.Terminal":
                Terminal t = (Terminal)data;
                return(t.MRID);

            case "PowerTransformerEnd.PowerTransformer":
                PowerTransformer pst = (PowerTransformer)data;
                return(pst.MRID);

            case "Terminal.ConductingEquipment":
                ConductingEquipment ce = (ConductingEquipment)data;
                return(ce.MRID);

            case "Terminal.ConnectivityNode":
                ConnectivityNode cn = (ConnectivityNode)data;
                return(cn.MRID);
            }


            return("");
        }
Пример #4
0
    protected void Start()
    {
        found_player = GameObject.FindGameObjectWithTag("Player");

        if (!ReferenceEquals(found_player, null))
        {
            inv_container   = found_player.GetComponentInChildren <InventoryContainer>();
            equip_container = found_player.GetComponentInChildren <EquipmentContainer>();
        }

        if (!ReferenceEquals(inv_container, null))
        {
            inv_container_display.OnLeftClickEvent.AddListener(InventoryLeftClick);
            inv_container_display.OnRightClickEvent.AddListener(InventoryRightClick);
            inv_container_display.OnPointEnterEvent.AddListener(ShowTooltip);
            inv_container_display.OnPointExitEvent.AddListener(HideTooltip);
            inv_container_display.OnBeginDragEvent.AddListener(BeginDrag);
            inv_container_display.OnEndDragEvent.AddListener(EndDrag);
            inv_container_display.OnDragEvent.AddListener(Drag);
            inv_container_display.OnDropEvent.AddListener(Drop);
        }

        if (!ReferenceEquals(equip_container, null))
        {
            equip_container_display.OnLeftClickEvent.AddListener(EquipmentUnequip);
            equip_container_display.OnRightClickEvent.AddListener(EquipmentUnequip);
            equip_container_display.OnPointEnterEvent.AddListener(ShowTooltip);
            equip_container_display.OnPointExitEvent.AddListener(HideTooltip);
            equip_container_display.OnBeginDragEvent.AddListener(BeginDrag);
            equip_container_display.OnEndDragEvent.AddListener(EndDrag);
            equip_container_display.OnDragEvent.AddListener(Drag);
            equip_container_display.OnDropEvent.AddListener(Drop);
        }


        Reset();
        draggableItem.gameObject.SetActive(false);
    }
Пример #5
0
    void LoadEquipment()
    {
        TextAsset textAsset = (TextAsset)Resources.Load(_equipmentFile.name);

        _equipmentData = EquipmentContainer.LoadFromText(textAsset.text)._data;
    }