Exemple #1
0
        static GameInfo()
        {
            MethodInfo wallJumpCheck          = typeof(Player).GetMethodInfo("WallJumpCheck");
            FieldInfo  strawberryCollectTimer = typeof(Strawberry).GetFieldInfo("collectTimer");
            FieldInfo  dashCooldownTimer      = typeof(Player).GetFieldInfo("dashCooldownTimer");
            FieldInfo  jumpGraceTimer         = typeof(Player).GetFieldInfo("jumpGraceTimer");
            FieldInfo  varJumpTimer           = typeof(Player).GetFieldInfo("varJumpTimer");
            FieldInfo  maxFall                  = typeof(Player).GetFieldInfo("maxFall");
            FieldInfo  playerSeekerSpeed        = typeof(PlayerSeeker).GetFieldInfo("speed");
            FieldInfo  playerSeekerDashTimer    = typeof(PlayerSeeker).GetFieldInfo("dashTimer");
            MethodInfo playerLiftSpeed          = typeof(Player).GetPropertyInfo("LiftBoost").GetGetMethod(true);
            FieldInfo  actorLiftSpeedTimer      = typeof(Actor).GetFieldInfo("liftSpeedTimer");
            FieldInfo  playerRetainedSpeed      = typeof(Player).GetFieldInfo("wallSpeedRetained");
            FieldInfo  playerRetainedSpeedTimer = typeof(Player).GetFieldInfo("wallSpeedRetentionTimer");
            FieldInfo  levelUnpauseTimer        = typeof(Level).GetFieldInfo("unpauseTimer");
            FieldInfo  currentCoroutine         = typeof(StateMachine).GetFieldInfo("currentCoroutine");
            FieldInfo  waitTimer                = typeof(Coroutine).GetFieldInfo("waitTimer");

            WallJumpCheck          = (DWallJumpCheck)wallJumpCheck.CreateDelegate(typeof(DWallJumpCheck));
            StrawberryCollectTimer = strawberryCollectTimer.CreateDelegate_Get <GetBerryFloat>();
            DashCooldownTimer      = dashCooldownTimer.CreateDelegate_Get <GetFloat>();
            JumpGraceTimer         = jumpGraceTimer.CreateDelegate_Get <GetFloat>();
            VarJumpTimer           = varJumpTimer.CreateDelegate_Get <GetFloat>();
            MaxFall                      = maxFall.CreateDelegate_Get <GetFloat>();
            PlayerSeekerSpeed            = playerSeekerSpeed.CreateDelegate_Get <GetPlayerSeekerSpeed>();
            PlayerSeekerDashTimer        = playerSeekerDashTimer.CreateDelegate_Get <GetPlayerSeekerDashTimer>();
            PlayerLiftBoost              = (Func <Player, Vector2>)playerLiftSpeed.CreateDelegate(typeof(Func <Player, Vector2>));
            ActorLiftSpeedTimer          = actorLiftSpeedTimer.CreateDelegate_Get <GetFloat>();
            PlayerRetainedSpeed          = playerRetainedSpeed.CreateDelegate_Get <GetFloat>();
            PlayerRetainedSpeedTimer     = playerRetainedSpeedTimer.CreateDelegate_Get <GetFloat>();
            LevelUnpauseTimer            = levelUnpauseTimer?.CreateDelegate_Get <Func <Level, float> >();
            StateMachineCurrentCoroutine = currentCoroutine.CreateDelegate_Get <Func <StateMachine, Coroutine> >();
            CoroutineWaitTimer           = waitTimer.CreateDelegate_Get <Func <Coroutine, float> >();
        }
Exemple #2
0
        static Manager()
        {
            MethodInfo wallJumpCheck       = typeof(Player).GetMethodInfo("WallJumpCheck");
            MethodInfo updateVirtualInputs = typeof(MInput).GetMethodInfo("UpdateVirtualInputs");

            FieldInfo strawberryCollectTimer = typeof(Strawberry).GetFieldInfo("collectTimer");
            FieldInfo dashCooldownTimer      = typeof(Player).GetFieldInfo("dashCooldownTimer");
            FieldInfo jumpGraceTimer         = typeof(Player).GetFieldInfo("jumpGraceTimer");
            FieldInfo playerSeekerSpeed      = typeof(PlayerSeeker).GetFieldInfo("speed");
            FieldInfo playerSeekerDashTimer  = typeof(PlayerSeeker).GetFieldInfo("dashTimer");


            Manager.UpdateVirtualInputs = (DUpdateVirtualInputs)updateVirtualInputs.CreateDelegate(typeof(DUpdateVirtualInputs));
            Manager.WallJumpCheck       = (DWallJumpCheck)wallJumpCheck.CreateDelegate(typeof(DWallJumpCheck));

            StrawberryCollectTimer = strawberryCollectTimer.CreateDelegate_Get <GetBerryFloat>();
            DashCooldownTimer      = dashCooldownTimer.CreateDelegate_Get <GetFloat>();
            JumpGraceTimer         = jumpGraceTimer.CreateDelegate_Get <GetFloat>();
            PlayerSeekerSpeed      = playerSeekerSpeed.CreateDelegate_Get <GetPlayerSeekerSpeed>();
            PlayerSeekerDashTimer  = playerSeekerDashTimer.CreateDelegate_Get <GetPlayerSeekerDashTimer>();
        }