using System; using UnityEngine; namespace Framework.Actors.Platformer { /// Manages movement and collisions for a platformer actor public class PlatformerActorPhysics : ActorPhysics { /// Whether the actor's Z coordinate is locked to a specific value public bool LockZ; /// Z coordinate the actor is locked to public float Z; /// Called once per physics frame protected override void FixedUpdate() { base.FixedUpdate(); if(this.LockZ) { Transform actorTransform = transform; Vector3 position = actorTransform.position; position.z = this.Z; actorTransform.position = position; } } } } // namespace Framework.Actors.Platformer