示例#1
0
        /// <summary>
        ///     Fired upon GameObject creation.
        /// </summary>
        public void OnDestroy(GameObject obj)
        {
            if (obj != null && obj.IsValid)
            {
                if (WorkedGrounds.Any(o => o.Key == obj.NetworkId))
                {
                    WorkedGrounds.Remove(obj.NetworkId);
                }

                if (MineField.Any(o => o.Key == obj.NetworkId))
                {
                    MineField.Remove(obj.NetworkId);
                }
            }
        }
示例#2
0
        /// <summary>
        ///     Fired upon GameObject creation.
        /// </summary>
        public void OnDelete(GameObjectDeleteEventArgs args)
        {
            var obj = args.Sender;

            if (obj.IsValid)
            {
                if (WorkedGrounds.Any(o => o.Key == obj))
                {
                    WorkedGrounds.Remove(obj);
                }

                if (MineField.Any(o => o.Key == obj))
                {
                    MineField.Remove(obj);
                }
            }
        }