Beispiel #1
0
        private NPCAutoTurret DeployNpcAutoTurret(Drone drone, BasePlayer deployer)
        {
            SphereEntity sphereEntity = SpawnSphereEntity(drone);

            if (sphereEntity == null)
            {
                return(null);
            }

            var turret = GameManager.server.CreateEntity(NpcAutoTurretPrefab) as NPCAutoTurret;

            if (turret == null)
            {
                sphereEntity.Kill();
                return(null);
            }

            turret.SetParent(sphereEntity);
            turret.Spawn();

            drone.SetSlot(TurretSlot, turret);
            SetupDroneTurret(drone, turret, sphereEntity);

            Effect.server.Run(DeployEffectPrefab, turret.transform.position);
            Interface.CallHook("OnDroneNpcTurretDeployed", drone, turret, deployer);

            return(turret);
        }
        void AddSearchLight(MiniCopter copter)
        {
            SphereEntity sph = (SphereEntity)GameManager.server.CreateEntity(spherePrefab, copter.transform.position, new Quaternion(0, 0, 0, 0), true);

            DestroyMeshCollider(sph);
            DestroyGroundComp(sph);
            sph.Spawn();
            sph.SetParent(copter);
            sph.transform.localPosition = new Vector3(0, -100, 0);
            SearchLight searchLight = GameManager.server.CreateEntity(searchLightPrefab, sph.transform.position) as SearchLight;

            DestroyMeshCollider(searchLight);
            DestroyGroundComp(searchLight);
            searchLight.Spawn();
            searchLight.GetComponent <StorageContainer>().isLootable = false;
            searchLight.SetFlag(BaseEntity.Flags.Reserved5, true, false, true);
            searchLight.SetParent(sph);
            searchLight.transform.localPosition = new Vector3(0, 0, 0);
            searchLight.transform.localRotation = Quaternion.Euler(new Vector3(20, 0, 180));
            searchLight.transform.localRotation = Quaternion.Euler(new Vector3(20, 0, 0));
            searchLight.transform.localRotation = Quaternion.Euler(new Vector3(20, 0, 180));
            Puts(searchLight.eyePoint.transform.position.ToString());
            searchLight._maxHealth     = 99999999f;
            searchLight._health        = 99999999f;
            searchLight.pickup.enabled = false;
            searchLight.isLockable     = true;
            searchLight.SendNetworkUpdate();
            sph.transform.localScale += new Vector3(0.9f, 0, 0);
            sph.LerpRadiusTo(0.1f, 10f);
            timer.Once(3f, () => {
                sph.transform.localPosition = new Vector3(0, 0.24f, 1.8f);
            });
            sph.SendNetworkUpdateImmediate();
            //PrintComponents(searchLight);
        }
Beispiel #3
0
 private static Drone GetParentDrone(BaseEntity entity, out SphereEntity parentSphere)
 {
     parentSphere = entity.GetParentEntity() as SphereEntity;
     return(parentSphere != null
         ? parentSphere.GetParentEntity() as Drone
         : null);
 }
Beispiel #4
0
        private void GiveBackpackWorldmodel(BasePlayer player)
        {
            SphereEntity sph = GameManager.server.CreateEntity(spherePrefab, player.eyes.position, player.transform.rotation) as SphereEntity;

            sph.Spawn();
            sph.lerpSpeed     = 0f;
            sph.currentRadius = 0.6f;
            sph.SetParent(player, "spine3");
            sph.transform.localPosition = new Vector3(-0.08f, 0, 0);
            sph.transform.rotation      = Quaternion.Euler(0, 270, 180);
            DroppedItemContainer gObj = GameManager.server.CreateEntity(itemWorldModel, player.transform.position) as DroppedItemContainer;

            //PrintComponents(sph);
            gObj.ResetRemovalTime(9999999999999);
            //gObj.transform.localPosition = new Vector3(0, 0, 0);
            //gObj.transform.rotation = Quaternion.Euler(0, 270, 180);
            gObj.Spawn();
            UnityEngine.Object.DestroyImmediate(gObj.GetComponent <Rigidbody>());
            gObj.SetParent(sph);
            gObj.transform.localPosition = new Vector3(0, 0, 0);
            gObj.SendNetworkUpdateImmediate();
            timer.Once(1.0f, () => {
                gObj.SetParent(player, "spine3");
                gObj.transform.localPosition = new Vector3(-0.08f, 0.0f, 0);
                gObj.transform.rotation      = Quaternion.Euler(0, 270, 180);
                timer.Once(0.2f, () => {
                    sph?.Kill();
                });
            });
        }
        // This hook is exposed by plugin: Telekinesis.
        private string CanStartTelekinesis(BasePlayer player, SphereEntity moveEntity, BaseEntity rotateEntity)
        {
            if (!_pluginData.ScaledEntities.Contains(rotateEntity.net.ID))
            {
                return(null);
            }

            return(GetMessage(player, "Error.CannotMoveWithHiddenSpheres"));
        }
Beispiel #6
0
        public static SphereEntity CreateSphereEntity()
        {
            var entity = new SphereEntity {
                Name = Helper.GetUniqueName(), Radius = 1.2f
            };

            SetTransformation((IHasObjectSpace)entity.Geometry, 2, 3, 4);
            return(entity);
        }
Beispiel #7
0
        private void CreateSphere(Vector3 position, float radius)
        {
            BaseEntity   sphere = GameManager.server.CreateEntity(SphereEnt, position, new Quaternion(), true);
            SphereEntity ent    = sphere.GetComponent <SphereEntity>();

            ent.currentRadius = radius * 2;
            ent.lerpSpeed     = 0f;
            sphere?.Spawn();
            Spheres.Add(sphere);
        }
        private static void SetupSphereEntity(SphereEntity sphereEntity, BaseEntity scaledEntity)
        {
            // SphereEntity has enableSaving off by default, so enable it if the child has saving enabled.
            // This fixes an issue where the resized child gets orphaned on restart and spams console errors every 2 seconds.
            sphereEntity.EnableSaving(scaledEntity.enableSaving);

            // SphereEntity has globalBroadcast on by default, but it should generally be off for scaled entities.
            // This fixes an issue where clients who resubscribe do not recreate the sphere or its children.
            EnableGlobalBroadcastFixed(sphereEntity, scaledEntity.globalBroadcast);
        }
Beispiel #9
0
        private static void SetupSphereEntity(SphereEntity sphereEntity)
        {
            sphereEntity.EnableSaving(true);

            // Fix the issue where leaving the area and returning would not recreate the sphere and its children on clients.
            sphereEntity.EnableGlobalBroadcast(false);

            // Needs to be called since we aren't using server side lerping.
            sphereEntity.transform.localScale = SphereTransformScale;
        }
        private static void RefreshScaledEntity(BaseEntity scaledEntity, SphereEntity parentSphere)
        {
            SetupSphereEntity(parentSphere, scaledEntity);

            if (_pluginConfig.HideSpheresAfterResize)
            {
                foreach (var subscriber in scaledEntity.net.group.subscribers)
                {
                    EntitySubscriptionManager.Instance.InitResized(scaledEntity.net.ID, subscriber.ownerid);
                }
            }
        }
            void SpawnSphere()
            {
                entity = GetComponent <BaseEntity>();
                sphere = GameManager.server.CreateEntity(strPrefab, pos, rot, true);
                SphereEntity ball = sphere.GetComponent <SphereEntity>();

                ball.currentRadius = 1f;
                ball.lerpRadius    = 2.0f * UseCupboardRadius;
                ball.lerpSpeed     = 100f;
                showall            = false;
                sphere.SetParent(entity);
                sphere.Spawn();
            }
Beispiel #12
0
        private SearchLight TryDeploySearchLight(Drone drone)
        {
            if (DeployLightWasBlocked(drone))
            {
                return(null);
            }

            // Spawn the search light below the map initially while the resize is performed.
            SphereEntity sphereEntity = GameManager.server.CreateEntity(SpherePrefab, SphereEntityInitialLocalPosition) as SphereEntity;

            if (sphereEntity == null)
            {
                return(null);
            }

            // Fix the issue where leaving the area and returning would not recreate the sphere and its children on clients.
            sphereEntity.globalBroadcast = false;

            sphereEntity.currentRadius = 0.1f;
            sphereEntity.lerpRadius    = 0.1f;

            sphereEntity.SetParent(drone);
            sphereEntity.Spawn();

            var         localRotation = Quaternion.Euler(_pluginConfig.SearchLight.DefaultAngle - 90 % 350, SearchLightYAxisRotation, 0);
            SearchLight searchLight   = GameManager.server.CreateEntity(SearchLightPrefab, SearchLightLocalPosition, localRotation) as SearchLight;

            if (searchLight == null)
            {
                return(null);
            }

            SetupSearchLight(searchLight);

            searchLight.SetParent(sphereEntity);
            searchLight.Spawn();
            Interface.CallHook("OnDroneSearchLightDeployed", drone, searchLight);

            timer.Once(3, () =>
            {
                if (sphereEntity != null)
                {
                    sphereEntity.transform.localPosition = SphereEntityLocalPosition;
                }
            });

            return(searchLight);
        }
Beispiel #13
0
        private static SphereEntity SpawnSphereEntity(Drone drone)
        {
            SphereEntity sphereEntity = GameManager.server.CreateEntity(SpherePrefab, SphereEntityLocalPosition) as SphereEntity;

            if (sphereEntity == null)
            {
                return(null);
            }

            SetupSphereEntity(sphereEntity);
            sphereEntity.currentRadius = TurretScale;
            sphereEntity.lerpRadius    = TurretScale;
            sphereEntity.SetParent(drone);
            sphereEntity.Spawn();

            return(sphereEntity);
        }
Beispiel #14
0
        private void SetupDroneTurret(Drone drone, AutoTurret turret, SphereEntity sphereEntity)
        {
            // Damage will be processed by the drone.
            turret.baseProtection = null;

            RemoveProblemComponents(turret);
            HideInputsAndOutputs(turret);
            AddRigidBodyToTriggerCollider(turret);

            // Invert the localScale of the turret to compensate for the sphereEntity localScale being increased.
            // Without doing this, the range of the turret corresponds to the sphere scale.
            // This works fine for now because the only colliders remaining are triggers.
            // This will require a different approach if the non-trigger colliders are reintroduced.
            turret.transform.localScale = TurretTransformScale;

            RegisterWithEntityScaleManager(turret);
            RefreshDroneSettingsProfile(drone);
            _turretDroneTracker.Add(drone.net.ID);
        }
Beispiel #15
0
            public void CreateZones(string zoneId, Vector3 position, float initialRadius, float timeToTake)
            {
                transform.position = position;
                transform.rotation = new Quaternion();

                this.zoneId        = zoneId;
                this.initialRadius = initialRadius;
                this.timeToTake    = timeToTake;

                innerSphere = (SphereEntity)GameManager.server.CreateEntity(sphereEnt, position, new Quaternion(), true);
                innerSphere.currentRadius = initialRadius * 2;
                innerSphere.lerpSpeed     = 0;
                innerSphere.enableSaving  = false;
                innerSphere.Spawn();

                var innerRB = innerSphere.gameObject.AddComponent <Rigidbody>();

                innerRB.useGravity  = false;
                innerRB.isKinematic = true;

                innerCollider = gameObject.AddComponent <SphereCollider>();
                innerCollider.transform.position = innerSphere.transform.position;
                innerCollider.isTrigger          = true;
                innerCollider.radius             = initialRadius;

                outerSphere = (SphereEntity)GameManager.server.CreateEntity(sphereEnt, position, new Quaternion(), true);
                outerSphere.currentRadius = (initialRadius * 2) + bufferSize;
                outerSphere.lerpSpeed     = 0;
                outerSphere.enableSaving  = false;
                outerSphere.Spawn();

                radTrigger = outerSphere.gameObject.AddComponent <TriggerRadiation>();
                radTrigger.RadiationAmountOverride = radStrength;
                radTrigger.radiationSize           = initialRadius + bufferSize;
                radTrigger.interestLayers          = LayerMask.GetMask("Player (Server)");
                radTrigger.enabled = true;

                isDisabled = false;

                gameObject.SetActive(true);
                enabled = true;
            }
Beispiel #16
0
            public void Init(ZoneType type, string name, MonoBehaviour owner, float radius, int darkness, DateTime?endTime)
            {
                Type    = type;
                Name    = name;
                Owner   = owner;
                EndTime = endTime;

                Vector3 position = GetGroundPosition(owner.transform.position);

                gameObject.layer   = (int)Layer.Reserved1;
                gameObject.name    = $"imperium_zone_{name.ToLowerInvariant()}";
                transform.position = position;
                transform.rotation = Quaternion.Euler(new Vector3(0, 0, 0));

                for (var idx = 0; idx < darkness; idx++)
                {
                    var sphere = GameManager.server.CreateEntity(SpherePrefab, position);

                    SphereEntity entity = sphere.GetComponent <SphereEntity>();
                    entity.lerpRadius    = radius * 2;
                    entity.currentRadius = radius * 2;
                    entity.lerpSpeed     = 0f;

                    sphere.Spawn();
                    Spheres.Add(sphere);
                }

                var collider = gameObject.AddComponent <SphereCollider>();

                collider.radius    = radius;
                collider.isTrigger = true;
                collider.enabled   = true;

                if (endTime != null)
                {
                    InvokeRepeating("CheckIfShouldDestroy", 10f, 5f);
                }
            }
Beispiel #17
0
        private void OnServerInitialized()
        {
            ins = this;

            foreach (BasePlayer bPlayer in BasePlayer.activePlayerList)
            {
                OnPlayerInit(bPlayer);
            }

            timer.Every(1f, () =>
            {
                foreach (var sphere in Spheres)
                {
                    if (sphere != null)
                    {
                        sphere.KillMessage();
                    }
                }
                Spheres.Clear();

                foreach (BasePlayer bPlayer in BasePlayer.activePlayerList)
                {
                    //PrintToChat(bPlayer, $"{(int)Math.Floor(bPlayer.transform.position.x / 50)},{(int)Math.Floor(bPlayer.transform.position.z / 50)}");
                    int xC = -5;
                    int zC = -5;
                    for (xC = -5; xC <= 5; xC++)
                    {
                        for (zC = -5; zC <= 5; zC++)
                        {
                            Vector3 pos = bPlayer.transform.position;

                            int X = (int)Math.Floor(pos.x / 50) + xC;
                            int Z = (int)Math.Floor(pos.z / 50) + zC;

                            Chunk data = Interface.Oxide.DataFileSystem.ReadObject <Chunk>($"Factions/Chunks/{X},{Z}");

                            square(bPlayer, X * 50, Z * 50, 40, 50);
                            square(bPlayer, X * 50, Z * 50, 40 + 0.1f, 50);
                            square(bPlayer, X * 50, Z * 50, 40 + 0.2f, 50);
                            square(bPlayer, X * 50, Z * 50, 40 + 0.3f, 50);
                            square(bPlayer, X * 50, Z * 50, 40 + 0.4f, 50);
                            square(bPlayer, X * 50, Z * 50, 40 + 0.5f, 50);

                            if (data.faction != null && data.faction != "")
                            {
                                float h = 0;
                                for (h = 0; h < 100; h += 5)
                                {
                                    square(bPlayer, X * 50, Z * 50, h, 50);
                                    square(bPlayer, X * 50, Z * 50, h + 0.1f, 50);
                                    square(bPlayer, X * 50, Z * 50, h + 0.2f, 50);
                                }

                                Vector3 center;
                                center.x = (X * 50) + 25;
                                center.z = (X * 50) + 25;
                                center.y = 80;

                                BaseEntity sphere = GameManager.server.CreateEntity(SphereEnt, center, new Quaternion(), true);
                                SphereEntity ent  = sphere.GetComponent <SphereEntity>();
                                ent.currentRadius = 25;
                                ent.lerpSpeed     = 0f;

                                sphere.Spawn();
                            }
                        }
                    }
                }
            });

            // int a = -100;
            // int b = -100;
            // while (a < 100)
            // {
            //     Chunk data = Interface.Oxide.DataFileSystem.ReadObject<Chunk>($"Factions/Chunks/{a},{b}");

            //     if (data.faction != null && data.faction != "")
            //     {
            //         Vector3 center;
            //         center.x = (a*50)+25;
            //         center.z = (b*50)+25;
            //         center.y = 100;
            //         createChunkMarker(center);
            //     }

            //     b++;
            //     if (b == 100)
            //     {
            //         b = -100;
            //         a++;
            //     }
            // }
        }
 private static BaseEntity GetFirstChild(SphereEntity parentSphere)
 {
     return(parentSphere.children.Count > 0
         ? parentSphere.children[0]
         : null);
 }
 private static void SetSphereSize(SphereEntity sphereEntity, float scale)
 {
     sphereEntity.currentRadius        = scale;
     sphereEntity.lerpRadius           = scale;
     sphereEntity.transform.localScale = new Vector3(scale, scale, scale);
 }
Beispiel #20
0
        private AutoTurret DeployAutoTurret(Drone drone, BasePlayer basePlayer, float conditionFraction = 1)
        {
            SphereEntity sphereEntity = SpawnSphereEntity(drone);

            if (sphereEntity == null)
            {
                return(null);
            }

            var turret = GameManager.server.CreateEntity(AutoTurretPrefab) as AutoTurret;

            if (turret == null)
            {
                sphereEntity.Kill();
                return(null);
            }

            if (basePlayer != null)
            {
                turret.OwnerID = basePlayer.userID;
            }

            turret.SetFlag(IOEntity.Flag_HasPower, true);
            turret.SetParent(sphereEntity);
            turret.Spawn();
            turret.SetHealth(turret.MaxHealth() * conditionFraction);
            AttachTurretSwitch(turret);

            drone.SetSlot(TurretSlot, turret);
            SetupDroneTurret(drone, turret, sphereEntity);

            Effect.server.Run(DeployEffectPrefab, turret.transform.position);
            Interface.CallHook("OnDroneTurretDeployed", drone, turret, basePlayer);

            if (basePlayer == null)
            {
                return(turret);
            }

            turret.authorizedPlayers.Add(new ProtoBuf.PlayerNameID
            {
                userid   = basePlayer.userID,
                username = basePlayer.displayName
            });
            turret.SendNetworkUpdate();

            // Allow other plugins to detect the auto turret being deployed (e.g., to add a weapon automatically).
            var turretItem = FindPlayerAutoTurretItem(basePlayer);

            if (turretItem != null)
            {
                RunOnEntityBuilt(turretItem, turret);
            }
            else
            {
                // Temporarily increase the player inventory capacity to ensure there is enough space.
                basePlayer.inventory.containerMain.capacity++;
                var temporaryTurretItem = ItemManager.CreateByItemID(AutoTurretItemId);
                if (basePlayer.inventory.GiveItem(temporaryTurretItem))
                {
                    RunOnEntityBuilt(temporaryTurretItem, turret);
                    temporaryTurretItem.RemoveFromContainer();
                }
                temporaryTurretItem.Remove();
                basePlayer.inventory.containerMain.capacity--;
            }

            return(turret);
        }
Beispiel #21
0
 public static SphereEntity CreateSphereEntity()
 {
     var entity = new SphereEntity { Name = Helper.GetUniqueName(), Radius = 1.2f };
     SetTransformation((IHasObjectSpace)entity.Geometry, 2, 3, 4);
     return entity;
 }
Beispiel #22
0
        public void SetEntityKind(Entitykind Kind)
        {
            Entities = Kind;

            if (Entities != Entitykind.CtrlRectangle)
            {
                if (CRect != null)
                {
                    CRect.Device = null;
                }
            }
            switch (Entities)

            {
            case Entitykind.Boxentity:
            {
                Box = new BoxEntity(new xyz(0, 0, 0), new xyz(4, 5, 6));

                break;
            }

            case Entitykind.PolyCurveExtruder:
            {
                PolyCurveEx = new PolyCurveExtruder();
                Loca       _Loca   = new Loca();
                CurveArray Curves0 = new CurveArray();
                Curves0.Count = 4;
                Curves0[0]    = new Line(new xy(-3, -3), new xy(-3, 4));
                Curves0[1]    = new Line(new xy(-3, 4), new xy(4, 4));
                Curves0[2]    = new Line(new xy(4, 4), new xy(4, -3));
                Curves0[3]    = new Line(new xy(4, -3), new xy(-3, -3));

                _Loca.Add(Curves0);
                OpenGlDevice.CheckError();
                CurveArray Curves1 = new CurveArray();
                Curves1.Count = 4;
                Curves1[0]    = new Line(new xy(0, 0), new xy(1, 0));
                Curves1[1]    = new Line(new xy(1, 0), new xy(1, 1));
                Curves1[2]    = new Line(new xy(1, 1), new xy(0, 1));
                Curves1[3]    = new Line(new xy(0, 1), new xy(0, 0));
                _Loca.Add(Curves1);

                PolyCurveEx.DownPlane     = new Plane(new xyz(0, 0, 0), new xyz(0, 0, 1));
                PolyCurveEx.UpPlane       = new Plane(new xyz(0, 0, 4), new xyz(0, 0.5, 1));
                PolyCurveEx.Loca          = _Loca;
                PolyCurveEx.ShowUpPlane   = true;
                PolyCurveEx.ShowDownPlane = true;
                PolyCurveEx.Height        = -1;
                PolyCurveEx.Direction     = new xyz(0, 1, 1);
                break;
            }

            case Entitykind.CoordinateAxis:
            {
                Axis                   = new CoordinateAxis();
                Axis.FullSize          = true;
                Axis.ShowText          = true;
                Axis.TextHeight        = 1;
                Axis.Color             = Color.Black;
                Axis.Size              = new xyz(10, 20, 30);
                Axis.Devider           = new xyz(4, 4, 4);
                Axis.DeviderLineLength = 0.3;
                Axis.LeftAndRight      = true;
                Axis.Dim3d             = true;
                Axis.ShowDevider       = true;
                break;
            }

            case Entitykind.TextEntity:
            {
                Text      = new TextEntity();
                Text.Text = "Drawing3d";

                Text.Size     = 4;
                Text.Italic   = true;
                Text.Position = new xyz(-5, 0, 0);
                break;
            }

            case Entitykind.Interpolator:

            {
                Interpolator        = new Interpolator3D();
                Interpolator.Points = new xyz[, ]
                {
                    { new xyz(-3, -3, 0), new xyz(-3, 0, 2), new xyz(-3, 3, 0), new xyz(-3, 6, -2) },
                    { new xyz(0, -3, 2), new xyz(0, 0, 3), new xyz(0, 3, 2), new xyz(0, 6, -2) },
                    { new xyz(3, -3, 3), new xyz(3, 0, 2), new xyz(3, 3, 1), new xyz(3, 6, -2) },
                    { new xyz(6, -3, 2), new xyz(6, 0, 0), new xyz(6, 3, 0), new xyz(6, 6, -2) }
                };

                break;
            };



            case Entitykind.Zoom:

            {
                Zoom        = new RectCtrlZoom(this);
                Zoom.Device = this;
                Zoom.Color  = Color.White;
                break;
            }

            case Entitykind.CtrlRectangle:

            {
                CRect               = new CtrlRectangle(this);
                CRect.Color         = Color.Black;
                CRect.MarkerColor   = Color.Red;
                CRect.Creating      = false;
                CRect.Rectangle     = new RectangleF(-1, -1, 6, 5);
                CRect.CompileEnable = false;
                Triangle            = new xyArray();
                Triangle.data       = new xy[] { new xy(0, 0), new xy(2, 2), new xy(4, 0), new xy(0, 0) };
                CRect.TransformItems.Add(Triangle);

                // S = new SphereEntity(new xyz(0, 0, 0), 2);
                //S = new BoxEntity(new xyz(0, 0, 0), new xyz(4, 4, 4));
                //S.CompileEnable = false;
                // CRect.TransformItems.Add(S);
                // CRect.LiveTransform = true;
                break;
            }

            case Entitykind.Profiler:

            {
                xyzArray A = new xyzArray();
                A.data = new xyz[] { new xyz(-3, 0, 0), new xyz(-3, -4, 0), new xyz(3, -4, 0), new xyz(3, 0, 0) };
                Loca       _Loca   = new Loca();
                CurveArray Curves0 = new CurveArray();
                Curves0.Count = 4;
                Curves0[0]    = new Line(new xy(-1, -1), new xy(-1, 2));
                Curves0[1]    = new Line(new xy(-1, 2), new xy(2, 2));
                Curves0[2]    = new Line(new xy(2, 2), new xy(2, -1));
                Curves0[3]    = new Line(new xy(2, -1), new xy(-1, -1));
                _Loca.Add(Curves0);
                OpenGlDevice.CheckError();
                CurveArray Curves1 = new CurveArray();
                Curves1.Count = 4;
                Curves1[0]    = new Line(new xy(0, 0), new xy(1, 0));
                Curves1[1]    = new Line(new xy(1, 0), new xy(1, 1));
                Curves1[2]    = new Line(new xy(1, 1), new xy(0, 1));
                Curves1[3]    = new Line(new xy(0, 1), new xy(0, 0));
                _Loca.Add(Curves1);
                Profil = new Profiler();
                Profil.CompileEnable = false;
                Profil.Trace         = A;
                Profil.Transverse    = _Loca;
                Profil.CloseFirst    = true;
                Profil.CloseLast     = true;
                break;
            }

            case Entitykind.ActiveCursor:
            {
                //  ActiveC.CrossColor = Color.Red;
                break;
            }

            case Entitykind.SphereEntity:
            {
                Sphere = new SphereEntity(new xyz(3, 2, 1), 4);
                //  Sphere.CompileEnable = false;
                //  Sphere = new SphereEntity(new xyz(0, 0, 0), 4);
                break;
            }

            case Entitykind.Cone:
            {
                Cone = new Cone(3, 5);
                break;
            }

            case Entitykind.Arrow:
            {
                Arrow = new Arrow();
                Arrow.Transformation = Matrix.Translation(new xyz(5, 0, 0));
                Arrow.SetShaftAndTop(new xyz(-10, 0, 0), new xyz(0, 0, 0));
                Arrow.Size = 8;
                drawSphere(new xyz(0, 0, 0), 0.5);
                break;
            }
            }


            Selector.RefreshSnapBuffer();
        }