public static void fovRandom()
        {
            initialFOV = MiscSettings.fieldOfView;


            //This is a kinda janky method of grabbing a random fov outside of the typically playable fovs
            System.Random random = new System.Random();

            int lowRandNum  = random.Next(5, 45);
            int highRandNum = random.Next(85, 150);

            double randCoinFlip = random.NextDouble();
            int    randNum;

            if (randCoinFlip > 0.5)
            {
                randNum = highRandNum;
            }
            else
            {
                randNum = lowRandNum;
            }

            //ErrorMessage.AddMessage(randNum.ToString());
            if (randNum < 40)
            {
                HideForScreenshots.Hide(HideForScreenshots.HideType.Mask);
            }
            MiscSettings.fieldOfView = randNum;
            if (SNCameraRoot.main != null)
            {
                SNCameraRoot.main.SyncFieldOfView();
            }
        }
        private static void HideInternal(GameObject obj, HideForScreenshots parent)
        {
            obj.BroadcastMessage("HideForScreenshots", SendMessageOptions.DontRequireReceiver);

            // Only disable things for things that are not in the path of our custom objects
            if (!(obj.name.Contains("Twitch") || obj.name.Contains("OverlayCanvas") || obj.name.Contains("Overlays") || obj.name.Contains("OutOfOxygen")))
            {
                ProcessComponent(obj.GetComponent <GUIText>(), parent, false);
                ProcessComponent(obj.GetComponent <GUITexture>(), parent, false);
                ProcessComponent(obj.GetComponent <Renderer>(), parent, false);
            }
            else
            {
                // Enable the canvases in the path of our custom objects
                List <Canvas> canvasList = new List <Canvas>(obj.GetComponentsInChildren <Canvas>());
                canvasList.AddRange(obj.GetComponents <Canvas>());
                foreach (Canvas canvas in canvasList)
                {
                    if (!(canvas.sortingLayerName == "DepthClear"))
                    {
                        canvas.enabled = true;
                    }
                }
            }

            if (recursive)
            {
                Transform transform = obj.transform;
                for (int i = 0; i < transform.childCount; i++)
                {
                    Transform child = transform.GetChild(i);
                    HideInternal(child.gameObject, parent);
                }
            }
        }
        public static void fovNormal()
        {
            MiscSettings.fieldOfView = initialFOV;
            if (SNCameraRoot.main != null)
            {
                SNCameraRoot.main.SyncFieldOfView();
            }

            HideForScreenshots.Hide(HideForScreenshots.HideType.None);
        }
 private static void ProcessComponent(Renderer r, HideForScreenshots parent, bool enable)
 {
     if (r != null && !enable)
     {
         r.enabled = false;
     }
     else if (r != null && enable)
     {
         r.enabled = true;
     }
 }
 private static void ProcessComponent(Behaviour b, HideForScreenshots parent, bool enable)
 {
     if (b != null && !enable)
     {
         b.enabled = false;
     }
     else if (b != null && enable)
     {
         b.enabled = true;
     }
 }
        private static void UnhideInternal(GameObject obj, HideForScreenshots parent)
        {
            obj.BroadcastMessage("UnhideForScreenshots", SendMessageOptions.DontRequireReceiver);

            ProcessComponent(obj.GetComponent <GUIText>(), parent, true);
            ProcessComponent(obj.GetComponent <GUITexture>(), parent, true);
            ProcessComponent(obj.GetComponent <Renderer>(), parent, true);

            if (recursive)
            {
                Transform transform = obj.transform;
                for (int i = 0; i < transform.childCount; i++)
                {
                    Transform child = transform.GetChild(i);
                    UnhideInternal(child.gameObject, parent);
                }
            }
        }
Ejemplo n.º 7
0
        public static void fovRandom()
        {
            initialFOV = MiscSettings.fieldOfView;


            // this is bad
            // i did it because atto said to
            // blame him
            // it works tho
            // the weird random number thing that is
            // I completely agree with doing random fov
            System.Random random = new System.Random();

            int lowRandNum  = random.Next(5, 45);
            int highRandNum = random.Next(85, 150);

            double randCoinFlip = random.NextDouble();
            int    randNum;

            if (randCoinFlip > 0.5)
            {
                randNum = highRandNum;
            }
            else
            {
                randNum = lowRandNum;
            }

            //ErrorMessage.AddMessage(randNum.ToString());
            if (randNum < 40)
            {
                HideForScreenshots.Hide(HideForScreenshots.HideType.Mask);
            }
            MiscSettings.fieldOfView = randNum;
            if (SNCameraRoot.main != null)
            {
                SNCameraRoot.main.SyncFieldOfView();
            }
        }
Ejemplo n.º 8
0
 public static void showHUD()
 {
     HideForScreenshots.Hide(HideForScreenshots.HideType.None);
 }
Ejemplo n.º 9
0
 public static void hideHUD()
 {
     HideForScreenshots.Hide(HideForScreenshots.HideType.Mask | HideForScreenshots.HideType.HUD);
 }