Exemple #1
0
        public void Awake()
        {
            if (_instance == null)
            {
                _instance = this;
            }

            DebugLogging = Application.isEditor;

            if (this == Instance)
            {
                return;
            }

            if (Application.isPlaying)
            {
                Destroy(this);
            }
            else
            {
                DestroyImmediate(this);
            }

            PrimitiveType[] primitiveTypes = (PrimitiveType[])Enum.GetValues(typeof(PrimitiveType));
            foreach (PrimitiveType primitiveType in primitiveTypes)
            {
                GameObject go            = GameObject.CreatePrimitive(primitiveType);
                Mesh       primitiveMesh = go.GetComponent <MeshFilter>().sharedMesh;
                Destroy(go);
                Blacklist(primitiveMesh);
            }
        }
Exemple #2
0
        public void Awake()
        {
            if (_instance == null)
            {
                _instance = this;
            }

            DebugLogging = Application.isEditor;

            if (this == Instance)
            {
                return;
            }

            if (Application.isPlaying)
            {
                Destroy(this);
            }
            else
            {
                DestroyImmediate(this);
            }
        }