示例#1
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;
                }
            }
        }
示例#2
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;
            }
        }
示例#3
0
        public void Dispose()
        {
            GO = null;
            DynamicObject marker = Marker;

            if (marker == null)
            {
                return;
            }
            marker.Delete();
            Marker = null;
        }
示例#4
0
        public void Dispose()
        {
            this.GO = (GameObject)null;
            DynamicObject marker = this.Marker;

            if (marker == null)
            {
                return;
            }
            marker.Delete();
            this.Marker = (DynamicObject)null;
        }