MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / GetOrCreateStepper

Method GetOrCreateStepper

StereoKit/SK.cs:321–326  ·  view source on GitHub ↗

This will search the list of `IStepper`s that are currently attached to StereoKit. This includes `IStepper`s that have been added but are not yet initialized. This will return the first `IStepper` in the list that is assignable to the provided generic type, and if one is not found, it will attempt to create one. Any concrete type that contains an empty constr

()

Source from the content-addressed store, hash-verified

319 /// <returns>The first `IStepper` in the list that is assignable to the
320 /// provided generic type, or a new object of type T.</returns>
321 public static T GetOrCreateStepper<T>() where T : IStepper
322 {
323 T result = _steppers.Get<T>();
324 if (result == null) result = _steppers.Add<T>();
325 return result;
326 }
327 /// <summary>This will search the list of `IStepper`s that are
328 /// currently attached to StereoKit. This includes `IStepper`s that
329 /// have been added but are not yet initialized. This will return the

Callers

nothing calls this directly

Calls 2

GetMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected