private void Update() { if (countdown > 0 && isStunned) { countdown -= Time.deltaTime; input = null; } else { isStunned = false; countdown = timer; input = inpt; } }
void Start() { countdown = timer; GetComponent <CharacterController2D>().OnPhysicsStep += PhysicsStep; input = new ActorPlayerInput(gameObject); inpt = input; jetPack = GetComponent <Jetpack>(); LeftWallJumpPoint = new CollisionPoint2D( transform, Vector2.up * GetComponent <CharacterController2D>().CeilingCheckPoint / 2 - Vector2.right * WallJumpDistance, 0.06f, GetComponent <CharacterController2D>().GroundLayers, 1); RightWallJumpPoint = new CollisionPoint2D( transform, Vector2.up * GetComponent <CharacterController2D>().CeilingCheckPoint / 2 + Vector2.right * WallJumpDistance, 0.06f, GetComponent <CharacterController2D>().GroundLayers, 1); }