示例#1
0
        public static void Load(PaintParam param, string path)
        {
            string filePath = Path.Combine(path, SERIALIZED_NAME);

            if (File.Exists(filePath))
            {
                EditorJsonUtility.FromJsonOverwrite(File.ReadAllText(filePath), param);
            }
        }
示例#2
0
 void OnDisable()
 {
     PaintParam.Save(param, SERIALIZED_PATH);
     SceneView.onSceneGUIDelegate -= SceneGUI;
     if (paintPosition)
     {
         DestroyImmediate(paintPosition.gameObject);
     }
 }
示例#3
0
        public static void Save(PaintParam param, string path)
        {
            string filePath = Path.Combine(path, SERIALIZED_NAME);

            if (File.Exists(filePath))
            {
                File.Delete(filePath);
            }
            File.WriteAllText(filePath, EditorJsonUtility.ToJson(param));
        }
示例#4
0
        /// <summary>
        /// Called on start
        /// </summary>
        void OnEnable()
        {
            SERIALIZED_PATH = Application.persistentDataPath;
            param           = new PaintParam();
            PaintParam.Load(param, SERIALIZED_PATH);
            SceneView.onSceneGUIDelegate += SceneGUI;
            if (param.objects == null)
            {
                param.objects = new List <PaintObject>();
            }
            layerNames = new List <string>();
            int count = 0;

            for (int i = 0; i <= 31; i++)
            {
                layerNames.Add(LayerMask.LayerToName(i));
                count++;
            }
        }