コード例 #1
0
ファイル: SquirrelHealth.cs プロジェクト: AshbyGeek/Hot-Stuff
    // Use this for initialization
    void Start()
    {
        health = maxHealth;

        curTile = null;
        engine = (EnvironmentEngine) FindObjectOfType(typeof(EnvironmentEngine));
        terrain = (PrettyTerrain) FindObjectOfType(typeof(PrettyTerrain));
    }
コード例 #2
0
ファイル: Peety.cs プロジェクト: Maera90/RunPeetyRun
 // Use this for initialization
 void Start()
 {
     animator                  = GetComponent <Animator>();
     anim                      = GetComponent <Animation>();
     rigidBody                 = GetComponent <Rigidbody2D>();
     environmentEngine         = GameObject.Find("EnvironmentEngine").GetComponent <EnvironmentEngine>();
     dustParticles             = DustParticlesGO.GetComponent <ParticleSystem>();
     boxCollider               = GetComponent <BoxCollider2D>();
     OriginalBoxColliderSize   = boxCollider.size;
     OriginalBoxColliderOffset = boxCollider.offset;
 }
        static bool Prefix(EnvironmentEngine __instance)
        {
            if (MainGame.game_starting || MainGame.paused || !MainGame.game_started || __instance.IsTimeStopped())
            {
                return(true);
            }
            Config.Options opts = Config.GetOptions();
            float          mult = Time.timeScale == 10f ? opts.SleepTimeMult : opts.TimeMult;

            if (mult != 1)
            {
                float accountableDelta = Time.deltaTime / 225f;                 // since this._cur_time += deltaTime / 225f
                float adjDelta         = accountableDelta * mult - accountableDelta;
                EnvironmentEngine.SetTime(__instance.time_of_day.time_of_day + adjDelta);
            }
            if (opts.ConfigReloadKey.IsPressed())
            {
                Config.GetOptions(true);
                EffectBubblesManager.ShowImmediately(MainGame.me.player.pos3, "NKN configuration reloaded");
            }
            else if (opts.AddMoneyKey.IsPressed())
            {
                MainGame.me.player.data.money += 100;
                EffectBubblesManager.ShowImmediately(MainGame.me.player.pos3, "1 gold coin granted");
            }
            else if (opts.ResetPrayKey.IsPressed())
            {
                MainGame.me.player.SetParam("prayed_this_week", 0f);
                EffectBubblesManager.ShowImmediately(MainGame.me.player.pos3, "Weekly pray count reset");
            }
            else if (opts.TimeScaleSwitchKey.IsPressed())
            {
                if (opts.TimeScaleSwitchKey.State == 0)
                {
                    opts.TimeMult /= 10;
                }
                else
                {
                    opts.TimeMult *= 10;
                }
                EffectBubblesManager.ShowImmediately(MainGame.me.player.pos3, "Timescale is set to " + opts.TimeMult);
            }
            else if (opts.AllowSaveEverywhere)
            {
                if (opts.SaveGameKey.IsPressed())
                {
                    PlatformSpecific.SaveGame(MainGame.me.save_slot, MainGame.me.save, (PlatformSpecific.OnSaveCompleteDelegate)(slot => {
                        EffectBubblesManager.ShowImmediately(MainGame.me.player.pos3, "Saved succesfully");
                    }));
                }
            }
            return(true);
        }
コード例 #4
0
        static bool Prefix(EnvironmentEngine __instance)
        {
            if (MainGame.game_starting || MainGame.paused || !MainGame.game_started || __instance.IsTimeStopped())
            {
                return(true);
            }
            Config.Options opts = Config.GetOptions();
            float          mult = Time.timeScale == 10f ? opts.SleepTimeMult : opts.TimeMult;

            if (mult != 1)
            {
                float accountableDelta = Time.deltaTime / 225f;                 // since this._cur_time += deltaTime / 225f
                float adjDelta         = accountableDelta * mult - accountableDelta;
                EnvironmentEngine.SetTime(__instance.time_of_day.time_of_day + adjDelta);
            }
            return(true);
        }
コード例 #5
0
 // Use this for initialization
 void Start()
 {
     EnviromentEngineGO = GameObject.Find("EnvironmentEngine");
     _environmentEngine = EnviromentEngineGO.GetComponent <EnvironmentEngine>();
 }