博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在lua中加载游戏资源时改变资源类型(二)
阅读量:3565 次
发布时间:2019-05-20

本文共 237 字,大约阅读时间需要 1 分钟。

之前写过如何在lua中加载游戏资源时改变资源类型,当时的做法是新建了一个C#脚本, 这样做不符合热更新的需求. 其实可以直接在lua中完成在加载游戏资源时对资源类型的改变.

gameObject:GetComponent('Image').sprite = CS.UnityEngine.Resources.Load("资源路径", typeof(CS.UnityEngine.Sprite))

注意将图片的Texture Type设置为Sprite(2D and UI).

转载地址:http://inerj.baihongyu.com/

你可能感兴趣的文章
中国大学MOOC-陈越、何钦铭-数据结构-2018秋 03-树3 Tree Traversals Again (25 分)
查看>>
中国大学MOOC-陈越、何钦铭-数据结构-2018秋 03-树2 List Leaves (25 分)
查看>>
中国大学MOOC-陈越、何钦铭-数据结构-2018秋 03-树1 树的同构 (25 分)
查看>>
中国大学MOOC-陈越、何钦铭-数据结构-2018秋 02-线性结构4 Pop Sequence (25 分) 栈
查看>>
中国大学MOOC-陈越、何钦铭-数据结构-2018秋 02-线性结构3 Reversing Linked List (25 分)
查看>>
Leetcode 41. 缺失的第一个正数
查看>>
Leetcode 78. 子集 dfs
查看>>
数据结构与算法题目集(中文) 6-1 单链表逆转 (20 分)
查看>>
Leetcode 442. 数组中重复的数据
查看>>
PAT (Advanced Level) Practice 1147 Heaps (30 分)堆
查看>>
PAT (Advanced Level) Practice 1146 Topological Order (25 分) 拓扑排序
查看>>
PAT (Advanced Level) Practice 1149 Dangerous Goods Packaging (25 分)set
查看>>
PAT (Advanced Level) Practice 1001 A+B Format (20 分)
查看>>
PAT (Advanced Level) Practice 1021 Deepest Root (25 分)
查看>>
数据结构 顺序表 操作集
查看>>
PAT (Advanced Level) Practice 1040 Longest Symmetric String (25 分) 最长回文字符串 dp
查看>>
PAT (Advanced Level) Practice 1142 Maximal Clique (25 分) 暴力
查看>>
HDU 数塔 dp
查看>>
AOJ 0-1 Knapsack Problem 01背包 dp
查看>>
Aizu - DPL_1_D Longest Increasing Subsequence dp+二分查找 最长递增子序列
查看>>