/// <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) { var success = this.Assign(sourceSlot.GetShip()); if (source is UIShipFormationSlot) { formationSlot = source as UIShipFormationSlot; //formationSlot.fleetSlot = this; //if (IsSelected) // formationSlot.SelectSlot(); } else if (source is UIShipFleetSlot) { var ss = source as UIShipFleetSlot; formationSlot = ss.formationSlot; } else if (source is UIShipHangerSlot) { formationSlot = GUIManager.Instance.View_Fleet.GetFormationSlot(GetShip().Formation); //if (!formation.IsAssigned()) // formationSlot = formation; } return success; } } // Default return false; }
/// <summary> /// Unassign this slot. /// </summary> public override void Unassign() { if (this.m_Ship != null && dropPreformed == false) { this.m_Ship.InFleet = false; this.m_Ship.hangerSlot.DimSlot(false); } if (GUIManager.Instance.View_GlanceScript != null) GUIManager.Instance.View_GlanceScript.CheckUnassignedSlot(this); if (formationSlot != null) { //formationSlot.Unassign(); formationSlot = null; } base.Unassign(); //this.m_Ship = null; //if (this.m_Ship != null) // this.m_Ship.hangerSlot.enabled = true; // Invoke the on assign event }
public void ClearFormationSlot() { m_formationSlot = null; }