123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- namespace AtlasUtility
- {
- using LitJson;
- using System.IO;
- using System.Linq;
- using System.Collections.Generic;
- using UnityEditor;
- using UnityEngine;
- using UnityEngine.UI;
- [CustomEditor(typeof(Test))]
- public class TestEditor : Editor
- {
- #region Variable
- public Test Script;
- #endregion
- public void OnEnable()
- {
- Script = (Test) target;
- }
- public override void OnInspectorGUI()
- {
- base.OnInspectorGUI();
- if (GUILayout.Button("Test"))
- {
- List<string> lines = new List<string>();
- StreamReader streamReader = new StreamReader(@"C:\Users\Administrator\Desktop\新建文本文档.txt");
- string line = "";
- while (!string.IsNullOrEmpty(line = streamReader.ReadLine()))
- {
- lines.Add(line);
- }
- streamReader.Close();
- // lines.Insert("if ([url.host isEqualToString:@"safepay"]) {
- ////跳转支付宝钱包进行支付,处理支付结果
- //[[AlipaySDK defaultService] processOrderWithPaymentResult: url standbyCallback:^ (NSDictionary * resultDic) {
- // NSLog(@"result 1 = %@", resultDic);
- // }];
- // }
- // ");
- StreamWriter streamWriter = new StreamWriter(@"C:\Users\Administrator\Desktop\新建文本文档.txt");
- streamWriter.Close();
- //Texture2D texture2D = new Texture2D(Script.Texture2D.width, Script.Texture2D.height, TextureFormat.RGBA32, false);
- //for (int i = 0; i < texture2D.width; i++)
- //{
- // for (int j = 0; j < texture2D.height; j++)
- // {
- // texture2D.SetPixel(i, j, Script.Texture2D.GetPixel(i, j));
- // }
- //}
- //texture2D.Apply();
- //File.WriteAllBytes("Assets/Test.png", texture2D.EncodeToPNG());
- //PlayerPrefs.SetString("AtlasUtility_ReferenceTableText", "");
- //PlayerPrefs.SetString("AtlasUtility_ReferenceTableGUID", "");
- //PlayerPrefs.SetString("AtlasUtility_SerializeObjectGUID", "");
- }
- }
- }
- }
|