示例#1
0
        static void LoadMap()
        {
            GameObject[] rootGameObjects = UnityEngine.SceneManagement.SceneManager.GetActiveScene().GetRootGameObjects();

            foreach (GameObject currentGameObject in rootGameObjects)
            {
                if (currentGameObject != null)
                {
                    Test            testComponent            = currentGameObject.GetComponent <Test>();
                    uSrcSettings    settingsComponent        = currentGameObject.GetComponent <uSrcSettings>();
                    ResourceManager resourceManagerComponent = currentGameObject.GetComponent <ResourceManager>();
                    if (testComponent && settingsComponent && resourceManagerComponent)
                    {
                        settingsComponent.Setup();
                        resourceManagerComponent.Setup();
                        testComponent.Setup();

                        bool sceneModified = testComponent.loadBSP();
                        if (sceneModified)
                        {
                            //AssetDatabase.SaveAssets();
                            EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
                        }
                    }
                }
            }
        }
示例#2
0
        /*public Shader Lmap;
         * public Shader LmapAlpha;
         * public Shader Sky;
         * public Shader Solid;*/

        void Awake()
        {
            inst = this;

            if (sDiffuse == null)
            {
                sDiffuse = Shader.Find("Diffuse");
            }
        }
        /*public Shader Lmap;
         * public Shader LmapAlpha;
         * public Shader Sky;
         * public Shader Solid;*/

        void Awake()
        {
            inst = this;

            if (diffuseMaterial == null)
            {
                //diffuseMaterial = Shader.Find ("Diffuse");
                print("diffuse material is not there, please fix");
            }
        }
        /* //public Shader sDiffuse;
         * public Material diffuseMaterial;
         * //public Shader sTransparent;
         * public Material transparentMaterial;
         * //public Shader sAlphatest;
         * public Material transparentCutout;
         * public Shader sUnlit;
         * public Shader sUnlitTransparent;
         * public Material vertexLitMaterial;
         * //public Shader sVertexLit;
         * public Shader sSelfillum;
         * public Shader sAdditive;
         * public Shader sRefract;
         * public Shader sWorldVertexTransition; */

        /*public Shader Lmap;
         * public Shader LmapAlpha;
         * public Shader Sky;
         * public Shader Solid;*/

        void Awake()
        {
            inst = this;

            if (resources == null)
            {
                resources = Resources.Load <uSrcResources>("uSrcResources");
            }

            if (resources.diffuseMaterial == null)
            {
                //diffuseMaterial = Shader.Find ("Diffuse");
                print("diffuse material is not there, please fix");
            }
        }