Пример #1
0
 public static void Postfix(ref TheForestAtmosphere __instance)
 {
     if (Menu.NoFog && LocalPlayer.IsInWorld)
     {
         __instance.FogCurrent = 300000f;
         TheForestAtmosphere.Instance.FogCurrent = 300000f;
     }
 }
Пример #2
0
 private void OnEnable()
 {
     if (TheForestAtmosphere.Instance == null)
     {
         TheForestAtmosphere.Instance = this;
     }
     this.clock = UnityEngine.Object.FindObjectOfType <Clock>();
     this.Randomize(true);
     this.SetShadowQualityLevel((int)TheForestQualitySettings.UserSettings.CascadeCount);
 }
Пример #3
0
    private void UpdateWind()
    {
        this.windBase = TheForestAtmosphere.MoveTowardsTarget(this.windBase, this.windBaseTarget, this.windBaseDelta);
        this.windGust = TheForestAtmosphere.MoveTowardsTarget(this.windGust, this.windGustTarget, this.windGustDelta);
        if (this.windGustTarget > 0f && this.windGust == this.windGustTarget)
        {
            this.windGustTarget = 0f;
            this.windGustDelta  = 1f / UnityEngine.Random.Range(5f, 30f);
        }
        this.windBaseHoldTimer -= Time.deltaTime;
        if (this.windBaseHoldTimer <= 0f)
        {
            this.windBaseTarget    = UnityEngine.Random.Range(0f, 0.4f);
            this.windBaseDelta     = 1f / UnityEngine.Random.Range(60f, 120f);
            this.windBaseHoldTimer = UnityEngine.Random.Range(60f, 600f);
        }
        this.windGustIntervalTimer -= Time.deltaTime;
        if (this.windGustIntervalTimer <= 0f)
        {
            this.windGustTarget        = UnityEngine.Random.Range(0.2f, 0.7f);
            this.windGustDelta         = 1f / UnityEngine.Random.Range(5f, 30f);
            this.windGustIntervalTimer = UnityEngine.Random.Range(15f, 120f);
        }
        float num;

        if (LocalPlayer.Transform)
        {
            num = Mathf.Lerp(1f, 2.5f, (LocalPlayer.Transform.position.y - 150f) / 150f);
        }
        else
        {
            num = 1f;
        }
        if (this.debugWind)
        {
            this.windIntensity = this.debugWindIntensity;
        }
        else
        {
            this.WindIntensity = this.windBase * num + this.windGust;
        }
        this.UpdateFoliageShaderWind();
        if (FMOD_Listener.IsDebugEnabled && UnityEngine.Input.GetKeyDown(KeyCode.RightControl))
        {
            this.showDebug = !this.showDebug;
        }
    }
Пример #4
0
 public static void Postfix(ref TheForestAtmosphere __instance)
 {
     if (Menu.NoFog && LocalPlayer.IsInWorld)
     {
         __instance.FogColor = new Color(0f, 0f, 0f, 0f);
         if (Sunshine.Instance.Ready)
         {
             Sunshine.Instance.ScatterColor = __instance.FogColor;
         }
         if (LocalPlayer.IsInCaves)
         {
             __instance.FogColor = new Color(0f, 0f, 0f, 0f);
         }
         __instance.CurrentFogColor = __instance.FogColor;
         Shader.SetGlobalColor("_FogColor", __instance.FogColor);
     }
 }
Пример #5
0
 private void Start()
 {
     this.Atmos         = Scene.Atmosphere;
     this.currentCamera = Camera.main;
     if (this.spawnAmount > 0)
     {
         base.StartCoroutine("spawnGeese");
     }
     if (this.debugGeese)
     {
         base.Invoke("doTakeOff", this.debugStartFlyTime);
     }
     else
     {
         base.Invoke("doTakeOff", (float)UnityEngine.Random.Range(60, 120));
     }
     base.InvokeRepeating("updateGeese", 1f, 5f);
 }
Пример #6
0
 private static void GameStandardValues(TheForestAtmosphere __instance)
 {
     baseCaveAddLight1Intensity = __instance.CaveAddLight1Intensity;
     baseCaveAddLight2Intensity = __instance.CaveAddLight2Intensity;
 }
Пример #7
0
 private void Awake()
 {
     BleedBehavior.BloodAmount = 0f;
     BleedBehavior.BloodReductionRatio = 1f;
     this.explodeHash = Animator.StringToHash("explode");
     this.DSpots = GameObject.FindWithTag("DeadSpots").GetComponent<DeadSpotController>();
     this.Hud = Scene.HudGui;
     this.Ocean = GameObject.FindWithTag("Ocean");
     this.mutantControl = Scene.MutantControler;
     this.sceneInfo = Scene.SceneTracker;
     this.Player = base.gameObject.GetComponent<PlayerInventory>();
     this.camFollow = base.GetComponentInChildren<camFollowHead>();
     this.hitReaction = base.GetComponent<playerHitReactions>();
     this.Atmos = Scene.Atmosphere;
     this.FrostScript = LocalPlayer.MainCam.GetComponent<Frost>();
     this.Tuts = LocalPlayer.Tuts;
     this.Sfx = LocalPlayer.Sfx;
     this.animator = LocalPlayer.Animator;
     this.DyingVision = LocalPlayer.MainCam.GetComponent<Grayscale>();
     this.Fullness = 1f;
     this.bloodPropertyBlock = new MaterialPropertyBlock();
     if (!LevelSerializer.IsDeserializing)
     {
         CoopPlayerVariations component = base.GetComponent<CoopPlayerVariations>();
         this.PlayerVariation = UnityEngine.Random.Range(0, component.Variations.Length);
         this.PlayerVariationBody = UnityEngine.Random.Range(0, component.BodyMaterials.Length);
     }
     if (this.CurrentArmorTypes == null || this.CurrentArmorTypes.Length != this.ArmorModel.Length)
     {
         this.CurrentArmorTypes = new PlayerStats.ArmorTypes[this.ArmorModel.Length];
         for (int i = 0; i < this.CurrentArmorTypes.Length; i++)
         {
             this.CurrentArmorTypes[i] = PlayerStats.ArmorTypes.None;
             this.ArmorModel[i].SetActive(false);
         }
     }
     if (this.CurrentArmorHP == null || this.CurrentArmorHP.Length != this.ArmorModel.Length)
     {
         this.CurrentArmorHP = new int[this.ArmorModel.Length];
     }
     this.CaveDoors = GameObject.FindGameObjectsWithTag("CaveDoor");
 }
Пример #8
0
 private void Awake()
 {
     Scene.ActiveMB = this;
     Scene.GameStats = this._gameStats;
     Scene.SceneTracker = this._sceneTracker;
     Scene.MutantControler = this._mutantControler;
     Scene.MutantSpawnManager = this._mutantSpawnManager;
     Scene.Yacht = this._yacht;
     Scene.PlaneCrash = this._plane;
     Scene.PlaneCrashAnimGO = this._planeCrashAnimGO;
     Scene.TriggerCutScene = this._triggerCutScene;
     Scene.RainFollowGO = this._rainFollowGO;
     Scene.RainTypes = this._rainTypes;
     Scene.WeatherSystem = this._weatherSystem;
     Scene.HudGui = this._hudGui;
     Scene.Cams = this._cams;
     Scene.Clock = this._clock;
     Scene.Atmosphere = this._atmos;
     Scene.WorkScheduler = this._workScheduler;
     Scene.LoadSave = this._loadSave;
     Scene.PlaneGreebles = this._planeGreebles;
     Scene.OceanFlat = this._oceanFlat;
     Scene.OceanCeto = this._oceanCeto;
     Scene.ShoreMask = this._shoreMask;
     Scene.SinkHoleCenter = this._sinkHoleCenter;
     Scene.CaveGrounds = this._caveGrounds;
 }
Пример #9
0
 private void OnDestroy()
 {
     Scene.ActiveMB = null;
     Scene.GameStats = null;
     Scene.SceneTracker = null;
     Scene.MutantControler = null;
     Scene.MutantSpawnManager = null;
     Scene.Yacht = null;
     Scene.PlaneCrash = null;
     Scene.PlaneCrashAnimGO = null;
     Scene.TriggerCutScene = null;
     Scene.RainFollowGO = null;
     Scene.RainTypes = null;
     Scene.WeatherSystem = null;
     Scene.HudGui = null;
     Scene.Cams = null;
     Scene.Clock = null;
     Scene.Atmosphere = null;
     Scene.WorkScheduler = null;
     Scene.LoadSave = null;
     Scene.PlaneGreebles = null;
     Scene.OceanFlat = null;
     Scene.OceanCeto = null;
     Scene.ShoreMask = null;
     Scene.SinkHoleCenter = null;
     Scene.CaveGrounds = null;
 }
Пример #10
0
 private void OnEnable()
 {
     if (TheForestAtmosphere.Instance == null)
     {
         TheForestAtmosphere.Instance = this;
     }
     this.clock = UnityEngine.Object.FindObjectOfType<Clock>();
     this.Randomize(true);
     this.SetShadowQualityLevel((int)TheForestQualitySettings.UserSettings.CascadeCount);
 }
Пример #11
0
 private void Start()
 {
     this.Atmos = Scene.Atmosphere;
     this.currentCamera = Camera.main;
     if (this.spawnAmount > 0)
     {
         base.StartCoroutine("spawnGeese");
     }
     if (this.debugGeese)
     {
         base.Invoke("doTakeOff", this.debugStartFlyTime);
     }
     else
     {
         base.Invoke("doTakeOff", (float)UnityEngine.Random.Range(60, 120));
     }
     base.InvokeRepeating("updateGeese", 1f, 5f);
 }