/// <summary> /// Sets the Character's selected GameObject /// </summary> internal GameObject this[Character chr] { get { return(chr.ExtraInfo.SelectedGO); } set { var info = chr.ExtraInfo; Deselect(info); if (value != null) { var selection = new GOSelection(value); if (MarkerId != SpellId.None) { var marker = new DynamicObject(chr, MarkerId, MarkerRadius, value.Map, value.Position); selection.Marker = marker; // also delete marker marker.CallPeriodically(2000, obj => { if (!chr.IsInWorld || chr.Map != marker.Map || selection.GO == null || !selection.GO.IsInWorld) { marker.Delete(); } }); } info.m_goSelection = selection; } } }
/// <summary>Sets the Character's selected GameObject</summary> internal GameObject this[Character chr] { get { return(chr.ExtraInfo.SelectedGO); } set { ExtraInfo extraInfo = chr.ExtraInfo; Deselect(extraInfo); if (value == null) { return; } GOSelection selection = new GOSelection(value); if (MarkerId != SpellId.None) { DynamicObject marker = new DynamicObject(chr, MarkerId, MarkerRadius, value.Map, value.Position); selection.Marker = marker; marker.CallPeriodically(2000, obj => { if (chr.IsInWorld && chr.Map == marker.Map && (selection.GO != null && selection.GO.IsInWorld)) { return; } marker.Delete(); }); } extraInfo.m_goSelection = selection; } }
public void Dispose() { GO = null; DynamicObject marker = Marker; if (marker == null) { return; } marker.Delete(); Marker = null; }
public void Dispose() { this.GO = (GameObject)null; DynamicObject marker = this.Marker; if (marker == null) { return; } marker.Delete(); this.Marker = (DynamicObject)null; }