コード例 #1
0
        public static void OnSpy()
        {
            bool flag  = TrajectoryComponent.Highlighted != null;
            bool flag2 = flag;

            if (flag2)
            {
                TrajectoryComponent.RemoveHighlight(TrajectoryComponent.Highlighted);
            }
            TrajectoryComponent.spying = true;
        }
コード例 #2
0
        // Token: 0x060001F3 RID: 499 RVA: 0x00012908 File Offset: 0x00010B08
        public void OnGUI()
        {
            Player mainPlayer = OptimizationVariables.MainPlayer;
            bool   flag       = mainPlayer == null;
            object obj;

            if (flag)
            {
                obj = null;
            }
            else
            {
                PlayerEquipment equipment = mainPlayer.equipment;
                obj = ((equipment != null) ? equipment.useable : null);
            }
            UseableGun useableGun = obj as UseableGun;
            bool       flag2      = useableGun == null || TrajectoryComponent.spying || !WeaponOptions.EnableBulletDropPrediction || !Provider.modeConfigData.Gameplay.Ballistics;
            bool       flag3      = flag2;

            if (flag3)
            {
                bool flag4 = TrajectoryComponent.Highlighted != null;
                bool flag5 = flag4;
                if (flag5)
                {
                    TrajectoryComponent.RemoveHighlight(TrajectoryComponent.Highlighted);
                    TrajectoryComponent.Highlighted = null;
                }
            }
            else
            {
                RaycastHit     raycastHit;
                List <Vector3> list   = TrajectoryComponent.PlotTrajectory(useableGun, out raycastHit, 255);
                bool           flag6  = Vector3.Distance(list.Last <Vector3>(), OptimizationVariables.MainPlayer.look.aim.position) > useableGun.equippedGunAsset.range;
                ColorVariable  color  = ColorUtilities.getColor("_TrajectoryPredictionInRange");
                ColorVariable  color2 = ColorUtilities.getColor("_TrajectoryPredictionOutOfRange");
                bool           flag7  = WeaponOptions.HighlightBulletDropPredictionTarget && raycastHit.collider != null;
                bool           flag8  = flag7;
                if (flag8)
                {
                    Transform  transform  = raycastHit.transform;
                    GameObject gameObject = null;
                    bool       flag9      = DamageTool.getPlayer(transform) != null;
                    bool       flag10     = flag9;
                    if (flag10)
                    {
                        gameObject = DamageTool.getPlayer(transform).gameObject;
                    }
                    else
                    {
                        bool flag11 = DamageTool.getZombie(transform) != null;
                        bool flag12 = flag11;
                        if (flag12)
                        {
                            gameObject = DamageTool.getZombie(transform).gameObject;
                        }
                        else
                        {
                            bool flag13 = DamageTool.getAnimal(transform) != null;
                            bool flag14 = flag13;
                            if (flag14)
                            {
                                gameObject = DamageTool.getAnimal(transform).gameObject;
                            }
                            else
                            {
                                bool flag15 = DamageTool.getVehicle(transform) != null;
                                bool flag16 = flag15;
                                if (flag16)
                                {
                                    gameObject = DamageTool.getVehicle(transform).gameObject;
                                }
                            }
                        }
                    }
                    bool flag17 = gameObject != null;
                    bool flag18 = flag17;
                    if (flag18)
                    {
                        Highlighter highlighter = gameObject.GetComponent <Highlighter>() ?? gameObject.AddComponent <Highlighter>();
                        bool        flag19      = !highlighter.enabled;
                        bool        flag20      = flag19;
                        if (flag20)
                        {
                            highlighter.occluder = true;
                            highlighter.overlay  = true;
                            highlighter.ConstantOnImmediate(flag6 ? color2 : color);
                        }
                        bool flag21 = TrajectoryComponent.Highlighted != null && highlighter != TrajectoryComponent.Highlighted;
                        bool flag22 = flag21;
                        if (flag22)
                        {
                            TrajectoryComponent.RemoveHighlight(TrajectoryComponent.Highlighted);
                        }
                        TrajectoryComponent.Highlighted = highlighter;
                    }
                    else
                    {
                        bool flag23 = TrajectoryComponent.Highlighted != null;
                        bool flag24 = flag23;
                        if (flag24)
                        {
                            TrajectoryComponent.RemoveHighlight(TrajectoryComponent.Highlighted);
                            TrajectoryComponent.Highlighted = null;
                        }
                    }
                }
                else
                {
                    bool flag25 = !WeaponOptions.HighlightBulletDropPredictionTarget && TrajectoryComponent.Highlighted != null;
                    bool flag26 = flag25;
                    if (flag26)
                    {
                        TrajectoryComponent.RemoveHighlight(TrajectoryComponent.Highlighted);
                        TrajectoryComponent.Highlighted = null;
                    }
                }
                ESPComponent.GLMat.SetPass(0);
                GL.PushMatrix();
                GL.LoadProjectionMatrix(OptimizationVariables.MainCam.projectionMatrix);
                GL.modelview = OptimizationVariables.MainCam.worldToCameraMatrix;
                GL.Begin(2);
                GL.Color(flag6 ? color2 : color);
                foreach (Vector3 v in list)
                {
                    GL.Vertex(v);
                }
                GL.End();
                GL.PopMatrix();
            }
        }