Unity 游戏框架搭建 2017 (十四) 优雅的 QSingleton (五) 优雅地进行GameObject命名

这段时间空调吹感冒了,休息了好久

本篇介绍 QSingleton 最重要的功能,是它让 QSingleton 称得上优雅。相关内容之前介绍过。

代码如下: MonoSingletonPath.cs:

namespace QFramework.Example
{
    using UnityEngine;

    [QMonoSingletonPath("[Example]/QMonoSingeltonPath")]
    class ClassUseMonoSingletonPath : QMonoSingleton<ClassUseMonoSingletonPath>
    {

    }

    public class MonoSingletonPath : MonoBehaviour
    {
        private void Start()
        {
            var intance = ClassUseMonoSingletonPath.Instance;
        }
    }
}

结果:


转载请注明地址:凉鞋的笔记:liangxiegame.com

更多内容

原文地址:https://www.cnblogs.com/liangxiegame/p/you-ya-deQSignleton-wu-you-ya-de-jin-xingGameObjec.html