Пример #1
0
 public void CheckReassignedSlot(UIShipFleetSlot newShipSlot)
 {
     //if (selectedShipSlot != newShipSlot) return;\
     if (selectedShipSlot != null)
         selectedShipSlot.DeselectSlot();
     selectedShipSlot = newShipSlot;
     selectedShipSlot.SelectSlot();
 }
Пример #2
0
    public void SetSelectedSlot(UIShipFleetSlot newShipSlot)
    {
        //Debug.Log("Setting Slot");
        if (selectedShipSlot != null)
            selectedShipSlot.DeselectSlot();
        if (selectedShipSlot == newShipSlot)
        {
            selectedShipSlot.DeselectSlot();
            selectedShipSlot = null;
        }
        else
        {
            selectedShipSlot = newShipSlot;
            selectedShipSlot.SelectSlot();
        }

        //Debug.Log(shipSlot.name);
    }
Пример #3
0
        /// <summary>
        /// Assign the slot by the passed source slot.
        /// </summary>
        /// <param name="source">Source.</param>
        public override bool Assign(Object source)
        {
            if (source is UIShipSlotBase)
            {
                UIShipSlotBase sourceSlot = source as UIShipSlotBase;

                if (sourceSlot != null && this.Assign(sourceSlot.GetShip()))
                {
                    if (source is UIShipFormationSlot)
                    {
                        var temp = source as UIShipFormationSlot;
                        fleetSlot = temp.fleetSlot;
                        fleetSlot.formationSlot = this;
                    }
                    return true;
                }
            }

            // Default
            return false;
        }
Пример #4
0
        /// <summary>
        /// Unassign this slot.
        /// </summary>
        public override void Unassign()
        {
            if (fleetSlot != null)
            {
                fleetSlot.ClearFormationSlot();
                fleetSlot = null;
            }
            (targetGraphic as Image).sprite = normalSprite;
            targetGraphic.color = new Color(1, 1, 1, 0.5f);
            DeselectSlot();

            base.Unassign();

            //this.m_Ship = null;
        }
Пример #5
0
 public void CheckUnassignedSlot(UIShipFleetSlot newShipSlot)
 {
     if (selectedShipSlot != newShipSlot) return;
     selectedShipSlot.DeselectSlot();
     selectedShipSlot = null;
 }