protected internal override void OnEditorTick(float dt)
 {
     base.OnEditorTick(dt);
     if (!MBEditor.IsEntitySelected(this.GameEntity))
     {
         return;
     }
     DebugExtensions.RenderDebugCircleOnTerrain(this.Scene, this.CaptureFrame, this.InteractionDistance, 2852192000U);
 }
 protected internal override void OnEditorTick(float dt)
 {
     base.OnEditorTick(dt);
     if (MBEditor.IsEntitySelected(this.GameEntity))
     {
         this.RenderCameraFrustrum();
         this._sceneView.SetEnable(true);
     }
     else
     {
         this._sceneView.SetEnable(false);
     }
 }
        protected internal override void OnEditorTick(float dt)
        {
            base.OnEditorTick(dt);
            this.timer += dt;
            if (!MBEditor.BorderHelpersEnabled() || (double)this.timer < 0.200000002980232)
            {
                return;
            }
            this.timer = 0.0f;
            if ((NativeObject)this.Scene == (NativeObject)null)
            {
                return;
            }
            bool boundaries1 = this.CalculateBoundaries("walk_area_vertex", ref this._lastPoints);
            bool boundaries2 = this.CalculateBoundaries("defender_area_vertex", ref this._lastDefenderPoints);
            bool boundaries3 = this.CalculateBoundaries("attacker_area_vertex", ref this._lastAttackerPoints);

            if (this._lastPoints.Count >= 3 || this._lastDefenderPoints.Count >= 3 || this._lastAttackerPoints.Count >= 3)
            {
                if (!(boundaries1 | boundaries2 | boundaries3))
                {
                    return;
                }
                this.GameEntity.ClearEntityComponents(true, false, true);
                this.GameEntity.Name = "editor_map_border";
                Mesh boundaryMesh1 = BoundaryWallView.CreateBoundaryMesh(this.Scene, (ICollection <Vec2>) this._lastPoints);
                if ((NativeObject)boundaryMesh1 != (NativeObject)null)
                {
                    this.GameEntity.AddMesh(boundaryMesh1);
                }
                Mesh boundaryMesh2 = BoundaryWallView.CreateBoundaryMesh(this.Scene, (ICollection <Vec2>) this._lastDefenderPoints, new Color(0.0f, 0.0f, 0.8f).ToUnsignedInteger());
                if ((NativeObject)boundaryMesh2 != (NativeObject)null)
                {
                    this.GameEntity.AddMesh(boundaryMesh2);
                }
                Mesh boundaryMesh3 = BoundaryWallView.CreateBoundaryMesh(this.Scene, (ICollection <Vec2>) this._lastAttackerPoints, new Color(0.0f, 0.8f, 0.8f).ToUnsignedInteger());
                if (!((NativeObject)boundaryMesh3 != (NativeObject)null))
                {
                    return;
                }
                this.GameEntity.AddMesh(boundaryMesh3);
            }
            else
            {
                this.GameEntity.ClearEntityComponents(true, false, true);
            }
        }
Beispiel #4
0
 protected override void OnTick(float realDt)
 {
     base.OnTick(realDt);
     if (this.CurrentMission.CurrentState == Mission.State.NewlyCreated || this.CurrentMission.CurrentState == Mission.State.Initializing)
     {
         if (this.CurrentMission.CurrentState == Mission.State.NewlyCreated)
         {
             this.CurrentMission.ClearUnreferencedResources(this.CurrentMission.NeedsMemoryCleanup);
         }
         this.TickLoading(realDt);
     }
     else if (this.CurrentMission.CurrentState == Mission.State.Continuing || this.CurrentMission.MissionEnded())
     {
         if ((double)this.MissionFastForwardAmount != 0.0)
         {
             this.CurrentMission.FastForwardMission(this.MissionFastForwardAmount, 0.033f);
             this.MissionFastForwardAmount = 0.0f;
         }
         bool flag = false;
         if ((double)this.MissionEndTime != 0.0 && (double)this.CurrentMission.Time > (double)this.MissionEndTime)
         {
             this.CurrentMission.EndMission();
             flag = true;
         }
         if (!flag && (this.Handler == null || this.Handler.RenderIsReady()))
         {
             this.TickMission(realDt);
         }
         if (flag && MBEditor._isEditorMissionOn)
         {
             MBEditor.LeaveEditMissionMode();
             this.TickMission(realDt);
         }
     }
     if (this.CurrentMission.CurrentState != Mission.State.Over)
     {
         return;
     }
     Game.Current.GameStateManager.PopState();
 }
        protected internal override void OnEditorTick(float dt)
        {
            base.OnEditorTick(dt);
            if (!this.visualizeRadius || MapAtmosphereProbe.hideAllProbesStatic)
            {
                return;
            }
            uint num1 = 16711680;
            uint num2 = 720640;
            uint factorColor1_1;
            uint factorColor1_2;

            if (MBEditor.IsEntitySelected(this.GameEntity))
            {
                factorColor1_1 = num1 | 2147483648U;
                factorColor1_2 = num2 | 2147483648U;
            }
            else
            {
                factorColor1_1 = num1 | 1073741824U;
                factorColor1_2 = num2 | 1073741824U;
            }
            this.innerSphereMesh.SetFactor1(factorColor1_1);
            this.outerSphereMesh.SetFactor1(factorColor1_2);
            MatrixFrame frame1;

            frame1.origin   = this.GameEntity.GetGlobalFrame().origin;
            frame1.rotation = Mat3.Identity;
            frame1.rotation.ApplyScaleLocal(this.minRadius);
            MatrixFrame frame2;

            frame2.origin   = this.GameEntity.GetGlobalFrame().origin;
            frame2.rotation = Mat3.Identity;
            frame2.rotation.ApplyScaleLocal(this.maxRadius);
            this.innerSphereMesh.SetVectorArgument(this.minRadius, this.maxRadius, 0.0f, 0.0f);
            this.outerSphereMesh.SetVectorArgument(this.minRadius, this.maxRadius, 0.0f, 0.0f);
            MBEditor.RenderEditorMesh(this.innerSphereMesh, frame1);
            MBEditor.RenderEditorMesh(this.outerSphereMesh, frame2);
        }
        protected internal override void OnEditorTick(float dt)
        {
            base.OnEditorTick(dt);
            foreach (GameEntity highlightedEntite in this._highlightedEntites)
            {
                highlightedEntite.SetContourColor(new uint?());
            }
            this._highlightedEntites.Clear();
            if (!MBEditor.IsEntitySelected(this.GameEntity))
            {
                return;
            }
            uint color = 4294901760;

            if ((double)this.Radius > 0.0)
            {
                DebugExtensions.RenderDebugCircleOnTerrain(this.Scene, this.GameEntity.GetGlobalFrame(), this.Radius, color);
            }
            foreach (SpawnerBase spawnerBase in this.GetSpawnersForEditor())
            {
                spawnerBase.GameEntity.SetContourColor(new uint?(color));
                this._highlightedEntites.Add(spawnerBase.GameEntity);
            }
        }
Beispiel #7
0
 protected internal override void OnEditorTick(float dt)
 {
     base.OnEditorTick(dt);
     MBEditor.IsEntitySelected(this.GameEntity);
 }