Ejemplo n.º 1
0
        /// <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;
            }
        }
Ejemplo n.º 2
0
        /// <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;
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Deselects the given Character's current GO
        /// </summary>
        internal void Deselect(ExtraInfo info)
        {
            GOSelection selection = info.m_goSelection;

            if (selection != null)
            {
                selection.Dispose();
                info.m_goSelection = null;
            }
        }
Ejemplo n.º 4
0
        /// <summary>Deselects the given Character's current GO</summary>
        internal void Deselect(ExtraInfo info)
        {
            GOSelection goSelection = info.m_goSelection;

            if (goSelection == null)
            {
                return;
            }
            goSelection.Dispose();
            info.m_goSelection = null;
        }
Ejemplo n.º 5
0
		/// <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.Region, value.Position);
						selection.Marker = marker;
					}
					info.m_goSelection = selection;
				}
			}
		}
Ejemplo n.º 6
0
        /// <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;
                }
            }
        }