コード例 #1
0
ファイル: ShameWall.cs プロジェクト: adverserath/TrueUO
        public static void AddTeleporters(ShameWall wall)
        {
            Map map = wall.Map;

            if (map == null || map == Map.Internal)
            {
                return;
            }

            foreach (AddonComponent component in wall.Components)
            {
                foreach (Point3D[] pnts in _TeleportLocs)
                {
                    if (component.Location == pnts[0])
                    {
                        ConditionTeleporter oldtele = map.FindItem <ConditionTeleporter>(new Point3D(pnts[1]));

                        if (oldtele != null)
                        {
                            WeakEntityCollection.Remove("newshame", oldtele);
                            oldtele.Delete();
                        }

                        ShameWallTeleporter teleporter = new ShameWallTeleporter(pnts[2], map);
                        teleporter.MoveToWorld(pnts[1], map);

                        WeakEntityCollection.Add("newshame", teleporter);
                    }
                }
            }
        }
コード例 #2
0
        public static void AddTeleporters(ShameWall wall)
        {
            Map map = wall.Map;

            if (map == null || map == Map.Internal)
            {
                return;
            }

            for (var index = 0; index < wall.Components.Count; index++)
            {
                AddonComponent component = wall.Components[index];

                for (var i = 0; i < _TeleportLocs.Length; i++)
                {
                    Point3D[] pnts = _TeleportLocs[i];

                    if (component.Location == pnts[0])
                    {
                        ConditionTeleporter oldtele = map.FindItem <ConditionTeleporter>(new Point3D(pnts[1]));

                        if (oldtele != null)
                        {
                            WeakEntityCollection.Remove("newshame", oldtele);
                            oldtele.Delete();
                        }

                        ShameWallTeleporter teleporter = new ShameWallTeleporter(pnts[2], map);
                        teleporter.MoveToWorld(pnts[1], map);

                        WeakEntityCollection.Add("newshame", teleporter);
                    }
                }
            }
        }