Search Issue Tracker
By Design
Votes
0
Found in
Issue ID
1269760
Regression
No
[Textures] CubemapArray API forces duplicate code because you cannot access individual cubemaps directly
Steps to repro:
1. create a new project
2. create a new script
3. in the script, create 1x Cubemap and 1x CubemapArray objects
4. make a function which does something with a Cubemap argument (for example, call GetPixels on the given Cubemap)
5. make a loop from 0 to cubemaparray.count
6. inside the loop, attempt to call the function which operates on a single Cubemap, on a Cubemap from the CubemapArray
Expected: you can use the same logic on a CubemapArray element, or an individual Cubemap
Actual: you must duplicate the code with slight changes, depending if you are passing a CubemapArray or Cubemap
Repro: 2020.2.0a20
Notes:
- this is not a true bug, but a UX issue and likely needs a new feature to solve
- Proposed solution is something like a .GetCubemapAtIndex API or [ ] operator or implement IEnumerable on the CubemapArray to give access to each Cubemap individually
- See https://docs.unity3d.com/2020.2/Documentation/ScriptReference/CubemapArray.html
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Standalone Player crashes with "TDerived GetOrLoad<TDerived>() where TDerived : T" when IL2CPP Code generation is set to "Faster (smaller) Builds"
- IndexOutOfRangeException and InvalidOperationException when logging XML string
- Script missing in "Assets/Settings/Mobile_Renderer/GlobalVolumeFeature" of "com.unity.template.urp-blank" template
- “Font Asset Creator - Error Code [Invalid_File_Structure]…“ error is logged when generating Font Assets from fonts with meta files from previous Editor versions
- Input.mousePosition returns (NaN, NaN, 0.00) when Scene view is opened
Resolution Note:
We will be adding documentation on this to make this more clear