示例#1
0
        private void Start()
        {
            Source = GetComponent <InputMap>();

            if (Source == null)
            {
                throw new NullReferenceException("Input map is null. Have you added a Input map component to PreProcess game object?");
            }

            ApplicationDataPath = Application.dataPath;

            try
            {
                switch ((int)Mode)
                {
                case (int)MODE.HEIGHT:
                    PreprocessDem();
                    break;

                case (int)MODE.COLOR:
                    PreprocessOrtho();
                    break;

                default:
                    Logger.LogWarning("PreProcessTerrain.Start: Nothing to produce/precompute!");
                    break;
                }
            }
            finally
            {
                if (DeleteTempOnFinish)
                {
                    var directory = new DirectoryInfo(ApplicationDataPath + TempFolder);

                    if (directory.Exists)
                    {
                        foreach (var file in directory.GetFiles())
                        {
                            file.Delete();
                        }
                    }
                }

#if UNITY_EDITOR
                AssetDatabase.Refresh();
#endif
            }
        }
示例#2
0
        void PreprocessOrtho()
        {
            switch ((int)Type)
            {
            case (int)TYPE.PLANE:
                PreprocessPlaneOrtho(Source, ApplicationDataPath + TempFolder, ApplicationDataPath + DestinationFolder);
                break;

            case (int)TYPE.SPHERICAL:
                throw new NotImplementedException();

            default:
                Logger.LogWarning("PreProcessTerrain.Preprocess: Nothing to produce/precompute!");
                break;
            }
        }
示例#3
0
        void PreprocessDem()
        {
            switch ((int)Type)
            {
            case (int)TYPE.PLANE:
                PreprocessPlaneDem(Source, ApplicationDataPath + TempFolder, ApplicationDataPath + DestinationFolder);
                break;

            case (int)TYPE.SPHERICAL:
                PreprocessSphericalDem(Source, ApplicationDataPath + TempFolder, ApplicationDataPath + DestinationFolder);
                break;

            default:
                Logger.LogWarning("PreProcessTerrain.Preprocess: Nothing to produce/precompute!");
                break;
            }
        }