public KinematicCharacterMotor SpawnMotor(KinematicCharacterMotor motorPrefab, Vector3 position, Quaternion rotation, Transform parent = null) { var motor = Instantiate(motorPrefab, position, rotation, parent); CharacterMotors.Add(motor); return(motor); }
public void UnRegisterMotor(KinematicCharacterMotor motor) { if (!CharacterMotors.Contains(motor)) { return; } CharacterMotors.Remove(motor); OnMotorUnRegistered?.Invoke(motor); }
public void RegisterMotor(KinematicCharacterMotor motor) { if (CharacterMotors.Contains(motor)) { return; } CharacterMotors.Add(motor); OnMotorRegistered?.Invoke(motor); }