- Home /
SVG asset variable
I'm using vector graphics package to import SVG's. I want to assign them to an array. I know it's possible with sprites. It'll be something like:
public Sprite[] spriteArray;
I want to do the same with SVG's. What's the name of SVG variable? Can i create SVG array?
Answer by unity_ye0nFU97f0spdQ · May 27, 2021 at 02:35 PM
Hi, @Myshoo. Just use "Sprite[]" in your code. In Unity editor set the game object to use SVGImage component. Then from your code, you can access the component using "GetComponent()", and assign the desired sprite from the array.
Your answer
Follow this Question
Related Questions
C# Make array based on script variable 1 Answer
Perform Action Foreach Variable of a Specific INT in an Array C# 2 Answers
Make an array of scripts? 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers