Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Too much blackbox, for example Preset.CanBeAppliedTo

Discussion in 'Documentation' started by Xarbrough, Jul 27, 2020.

  1. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,188
    Very often, I'm frustrated by the Unity scripting API documentation because it only states the obvious, but not the helpful details I need to know as a programmer. Among others, here is an example:

    Preset.ApplyTo

    Preset.CanBeAppliedTo

    Both calls are black boxes since I cannot see what the C++ code is doing. The docs are vague on what both return values mean. If I check CanBeAppliedTo before using ApplyTo, is it safe to assume that ApplyTo succeeds? If I simply call ApplyTo and receive false, can I assume that the reason for failure is the same as would have been returned by CanBeAppliedTo?
     
    Cameron_SM and AdamCourtney like this.