前言:在上次的博客中写了怎么创建图集,今天在这篇博客中记录下图集是怎么调用的。
(1)、在场景中创建一个UGUI的Image组件,如图所示:
(2)、创建一个调用图集的脚本,代码如下:
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.U2D;
前言:在上次的博客中写了怎么创建图集,今天在这篇博客中记录下图集是怎么调用的。
(1)、在场景中创建一个UGUI的Image组件,如图所示:
(2)、创建一个调用图集的脚本,代码如下:
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.U2D;