void toggleTeleport(bool enabled) { if (enabled) { teleport.EnableTeleportation(); } else { teleport.DisableTeleportation(); } }
public void ChangeLocomotionType(LocomotionType loc) { selectedLocomotion = loc; if (teleport == null) { teleport = GetComponent <PlayerTeleport>(); } if (selectedLocomotion == LocomotionType.Teleport) { teleport.EnableTeleportation(); } else if (selectedLocomotion == LocomotionType.SmoothLocomotion) { teleport.DisableTeleportation(); } // Default to Disable All else { // Disable all teleport.DisableTeleportation(); } }