优雅的QSignleton (五) 优雅地进行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

output/writing/Unity游戏框架搭建

猜你喜欢

转载自blog.csdn.net/u010125551/article/details/78517009