书接上回,上次介绍了对象池在游戏开发中的概念, 这篇文章我们来看一看在一款游戏demo中如何运用对象池技术和资源加载器结合来应对反复生成的游戏对象 我们先编写一个简单的Resources资源加载器 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; public class ResMgr : BaseMgr<ResMgr> { /// <summary> /// 同步加载资源 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="name"></param> /// <returns></returns> public T Load<T>(string name) where T : Object { T obj = Resources.Load<T>(name); if (obj == null) {...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile