我想得到特殊的雪碧像'ArmL‘从spritesheet与多种模式。
我有很多多个精灵,所以我需要像下面这样使用;
我怎样才能做到这一点呢?
Public Sprite[] itemArmors;
examplesprite.sprite=itemArmors[ArmL];

发布于 2020-06-10 21:39:06
您需要将ArmL拖放到检查器中
public Sprite[] itemArmors;
examplesprite.sprite=itemArmors[0]; // refers to the first element in the itemArmours sprite array在检查器中,确保添加到itemArmours的第一个元素是ArmL。这称为索引。如果您只是想获得ArmL,那么不要使用数组,只需使用:
public Sprite ArmL;
examplesprite.sprite = ArmL;https://stackoverflow.com/questions/62302562
复制相似问题