Пример #1
0
        protected override void Awake()
        {
            if (!this.CheckInstance())
            {
                return;
            }
            string path1 = UserData.Path + "bg/";

            if (!System.IO.Directory.Exists(path1))
            {
                System.IO.Directory.CreateDirectory(path1);
            }
            string path2 = UserData.Path + "cardframe/Back/";

            if (!System.IO.Directory.Exists(path2))
            {
                System.IO.Directory.CreateDirectory(path2);
            }
            string path3 = UserData.Path + "cardframe/Front/";

            if (!System.IO.Directory.Exists(path3))
            {
                System.IO.Directory.CreateDirectory(path3);
            }
            Object.DontDestroyOnLoad((Object)((Component)this).get_gameObject());
            this.EncryptedMacAddress = YS_Assist.CreateIrregularStringFromMacAddress();
            this.GenerateUserInfo(false);
            this.LoadHandleName();
            this.GameVersion = new Version(0, 0, 0);
            this.LoadVersion();
            this.LoadLanguage();
            this.LoadNetworkSetting();
            this.LoadDownloadInfo();
            this.LoadApplauseInfo();
        }
Пример #2
0
        public bool SaveCharaFile(string filename, byte sex = 255, bool newFile = false)
        {
            string path          = this.ConvertCharaFilePath(filename, sex, newFile);
            string directoryName = Path.GetDirectoryName(path);

            if (!System.IO.Directory.Exists(directoryName))
            {
                System.IO.Directory.CreateDirectory(directoryName);
            }
            this.charaFileName = Path.GetFileName(path);
            string userId = this.userID;
            string dataId = this.dataID;

            if (this.userID != Singleton <GameSystem> .Instance.UserUUID)
            {
                this.dataID = YS_Assist.CreateUUID();
            }
            else if (!File.Exists(path))
            {
                this.dataID = YS_Assist.CreateUUID();
            }
            this.userID = Singleton <GameSystem> .Instance.UserUUID;
            using (FileStream fileStream = new FileStream(path, FileMode.Create, FileAccess.Write))
            {
                bool flag = this.SaveCharaFile((Stream)fileStream, true);
                this.userID = userId;
                this.dataID = dataId;
                return(flag);
            }
        }
Пример #3
0
    public static string CreateIrregularString(string str, bool bitRand = false)
    {
        if (str.IsNullOrEmpty())
        {
            return(str);
        }
        byte[] bytes    = Encoding.UTF8.GetBytes(str);
        int    startPos = 7;

        if (bitRand)
        {
            startPos = Random.Range(0, YS_Assist.tblRevCode.Length - 1);
        }
        YS_Assist.BitRevBytes(bytes, startPos);
        int num1 = bytes.Length / 4;
        int num2 = bytes.Length % 4;

        if (num2 != 0)
        {
            int    length1  = 4 - num2;
            byte[] numArray = new byte[length1];
            int    length2  = bytes.Length;
            Array.Resize <byte>(ref bytes, length2 + length1);
            Array.Copy((Array)numArray, 0, (Array)bytes, length2, length1);
            ++num1;
        }
        StringBuilder stringBuilder = new StringBuilder(str.Length);

        for (int index = 0; index < num1; ++index)
        {
            stringBuilder.Append(YS_Assist.Convert62StringFromInt32(BitConverter.ToInt32(bytes, index * 4)));
        }
        return(stringBuilder.ToString());
    }
Пример #4
0
 public static List <string> LoadAllListTextFromList(
     string _assetbundleFolder,
     string _strLoadFile,
     ref List <string> lst,
     List <string> _OmitFolderName = null)
 {
     GlobalMethod.lstABName.Clear();
     GlobalMethod.lstABName = GlobalMethod.GetAssetBundleNameListFromPath(_assetbundleFolder, false);
     GlobalMethod.lstABName.Sort();
     for (int index = 0; index < GlobalMethod.lstABName.Count; ++index)
     {
         string stringRight = YS_Assist.GetStringRight(Path.GetFileNameWithoutExtension(GlobalMethod.lstABName[index]), 2);
         if (_OmitFolderName == null || !_OmitFolderName.Contains(stringRight))
         {
             if (GlobalMethod.AssetFileExist(GlobalMethod.lstABName[index], _strLoadFile, string.Empty))
             {
                 TextAsset textAsset = CommonLib.LoadAsset <TextAsset>(GlobalMethod.lstABName[index], _strLoadFile, false, string.Empty);
                 AssetBundleManager.UnloadAssetBundle(GlobalMethod.lstABName[index], true, (string)null, false);
                 if (!Object.op_Equality((Object)textAsset, (Object)null))
                 {
                     lst.Add(textAsset.get_text());
                 }
             }
         }
     }
     return(lst);
 }
Пример #5
0
    public static string CreateIrregularStringFromMacAddress()
    {
        StringBuilder stringBuilder = new StringBuilder(16);

        stringBuilder.Append(YS_Assist.GetMacAddress());
        return(string.Empty == stringBuilder.ToString() ? string.Empty : YS_Assist.CreateIrregularString(stringBuilder.ToString(), false));
    }
Пример #6
0
        private void LoadChara()
        {
            Singleton <Character> .Instance.BeginLoadAssetBundle();

            if (this.modeNew)
            {
                this.chaCtrl = Singleton <Character> .Instance.CreateChara(this.modeSex, ((Component)this).get_gameObject(), 0, (ChaFileControl)null);

                this.chaCtrl.chaFile.pngData = (byte[])null;
                this.chaCtrl.chaFile.userID  = Singleton <GameSystem> .Instance.UserUUID;
                this.chaCtrl.chaFile.dataID  = YS_Assist.CreateUUID();
            }
            else
            {
                this.chaCtrl = Singleton <Character> .Instance.CreateChara(this.modeSex, ((Component)this).get_gameObject(), 0, (ChaFileControl)null);

                this.chaCtrl.chaFile.LoadCharaFile(this.customBase.editSaveFileName, this.modeSex, false, true);
                this.chaCtrl.ChangeNowCoordinate(false, true);
            }
            this.chaCtrl.releaseCustomInputTexture = false;
            this.chaCtrl.Load(false);
            this.chaCtrl.ChangeEyebrowPtn(0, true);
            this.chaCtrl.ChangeEyesPtn(0, true);
            this.chaCtrl.ChangeMouthPtn(0, true);
            this.chaCtrl.ChangeLookEyesPtn(1);
            this.chaCtrl.ChangeLookNeckPtn(0, 1f);
            this.chaCtrl.hideMoz = true;
            this.chaCtrl.fileStatus.visibleSon = false;
        }
Пример #7
0
 public void CreateBoneList(GameObject obj, string assetBundleName, string assetName)
 {
     this.dictBone.Clear();
     if (!AssetBundleCheck.IsFile(assetBundleName, assetName))
     {
         Debug.LogWarning((object)("読み込みエラー\r\nassetBundleName:" + assetBundleName + "\tassetName:" + assetName));
     }
     else
     {
         AssetBundleLoadAssetOperation loadAssetOperation = AssetBundleManager.LoadAsset(assetBundleName, assetName, typeof(TextAsset), (string)null);
         if (loadAssetOperation.IsEmpty())
         {
             Debug.LogError((object)("読み込みエラー\r\nassetName:" + assetName));
         }
         else
         {
             string[,] data;
             YS_Assist.GetListString(loadAssetOperation.GetAsset <TextAsset>().get_text(), out data);
             int length1 = data.GetLength(0);
             int length2 = data.GetLength(1);
             if (length1 != 0 && length2 != 0)
             {
                 for (int index = 0; index < length1; ++index)
                 {
                     GameObject loop = obj.get_transform().FindLoop(data[index, 0]);
                     if (Object.op_Implicit((Object)loop))
                     {
                         this.dictBone[data[index, 0]] = loop;
                     }
                 }
             }
             AssetBundleManager.UnloadAssetBundle(assetBundleName, true, (string)null, false);
         }
     }
 }
Пример #8
0
 public void GenerateUserInfo(bool forceGenerate = false)
 {
     if (!forceGenerate && this.LoadIdAndPass())
     {
         return;
     }
     this.UserUUID   = YS_Assist.CreateUUID();
     this.UserPasswd = YS_Assist.GeneratePassword62(16);
     this.SaveIdAndPass();
 }
Пример #9
0
        public bool LoadListInfoAll()
        {
            ChaListDefine.CategoryNo[]     values   = (ChaListDefine.CategoryNo[])Enum.GetValues(typeof(ChaListDefine.CategoryNo));
            Dictionary <int, ListInfoBase> dictData = (Dictionary <int, ListInfoBase>)null;
            List <string> nameListFromPath          = CommonLib.GetAssetBundleNameListFromPath("list/characustom/", false);

            for (int index = 0; index < nameListFromPath.Count; ++index)
            {
                AssetBundleLoadAssetOperation loadAssetOperation = AssetBundleManager.LoadAllAsset(nameListFromPath[index], typeof(TextAsset), (string)null);
                if (loadAssetOperation == null)
                {
                    Debug.LogWarning((object)("読み込みエラー\r\nassetBundleName:" + nameListFromPath[index]));
                }
                else if (loadAssetOperation.IsEmpty())
                {
                    AssetBundleManager.UnloadAssetBundle(nameListFromPath[index], true, (string)null, false);
                }
                else
                {
                    TextAsset[] allAssets = loadAssetOperation.GetAllAssets <TextAsset>();
                    if (allAssets == null || allAssets.Length == 0)
                    {
                        AssetBundleManager.UnloadAssetBundle(nameListFromPath[index], true, (string)null, false);
                    }
                    else
                    {
                        foreach (ChaListDefine.CategoryNo categoryNo in values)
                        {
                            if (!this.dictListInfo.TryGetValue((int)categoryNo, out dictData))
                            {
                                Debug.LogWarning((object)"リストを読むための準備ができてない");
                            }
                            else
                            {
                                foreach (TextAsset ta in allAssets)
                                {
                                    if (!(YS_Assist.GetRemoveStringRight(((Object)ta).get_name(), "_", false) != categoryNo.ToString() + "_"))
                                    {
                                        this.LoadListInfo(dictData, ta);
                                    }
                                }
                            }
                        }
                        AssetBundleManager.UnloadAssetBundle(nameListFromPath[index], true, (string)null, false);
                    }
                }
            }
            this.EntryClothesIsInit();
            this.LoadItemID();
            OutputLog.Log(nameof(LoadListInfoAll), false, "UnloadUnusedAssets");
            Resources.UnloadUnusedAssets();
            GC.Collect();
            return(true);
        }
        internal static void UpdateVisible(ChaControl __instance, bool ___drawSimple, bool ___confSon, List <bool> ___lstActive)
        {
            if (!___drawSimple && __instance.cmpBody && __instance.cmpBody.targetEtc.objDanTop)
            {
                bool pantsOff     = !__instance.IsClothesStateKind(1) || __instance.fileStatus.clothesState[1] != 0;
                bool underwearOff = !__instance.IsClothesStateKind(3) || __instance.fileStatus.clothesState[3] != 0; //Added check

                ___lstActive.Clear();
                ___lstActive.Add(__instance.visibleAll);
                ___lstActive.Add(___drawSimple || (pantsOff && underwearOff) || __instance.fileStatus.visibleSon);
                ___lstActive.Add(___confSon);
                ___lstActive.Add(__instance.fileStatus.visibleSonAlways);
                YS_Assist.SetActiveControl(__instance.cmpBody.targetEtc.objDanTop, ___lstActive);
            }
        }
Пример #11
0
    public void LoadUseNameList()
    {
        if (Object.op_Equality((Object)null, (Object)this.taUseInfo))
        {
            return;
        }
        string[,] data;
        YS_Assist.GetListString(this.taUseInfo.get_text(), out data);
        this.lstUseName.Clear();
        int length = data.GetLength(0);

        for (int index = 0; index < length; ++index)
        {
            this.lstUseName.Add(data[index, 0].Replace("\r", string.Empty).Replace("\n", string.Empty));
        }
    }
Пример #12
0
 public static List <ExcelData.Param> LoadExcelDataAlFindlFile(
     string _strAssetPath,
     string _strFileName,
     int sCell,
     int sRow,
     int eCell,
     int eRow,
     List <string> _OmitFolderName = null,
     bool _isWarning = true)
 {
     GlobalMethod.lstABName.Clear();
     GlobalMethod.lstABName = GlobalMethod.GetAssetBundleNameListFromPath(_strAssetPath, false);
     GlobalMethod.lstABName.Sort();
     for (int index1 = 0; index1 < GlobalMethod.lstABName.Count; ++index1)
     {
         GlobalMethod.strNo.Clear();
         GlobalMethod.strNo.Append(Path.GetFileNameWithoutExtension(GlobalMethod.lstABName[index1]));
         GlobalMethod.strNo.Replace(GlobalMethod.strNo.ToString(), YS_Assist.GetStringRight(GlobalMethod.strNo.ToString(), 2));
         if (_OmitFolderName == null || !_OmitFolderName.Contains(GlobalMethod.strNo.ToString()))
         {
             string[] allAssetName = AssetBundleCheck.GetAllAssetName(GlobalMethod.lstABName[index1], false, (string)null, false);
             bool     flag         = false;
             for (int index2 = 0; index2 < allAssetName.Length; ++index2)
             {
                 if (allAssetName[index2].Compare(_strFileName, true))
                 {
                     flag = true;
                     break;
                 }
             }
             if (!flag)
             {
                 GlobalMethod.DebugLog("[" + GlobalMethod.lstABName[index1] + "][" + _strFileName + "]は見つかりません", 1);
             }
             else
             {
                 List <ExcelData.Param> objList = GlobalMethod.LoadExcelData(GlobalMethod.lstABName[index1], _strFileName, sCell, sRow, eCell, eRow, _isWarning);
                 if (objList != null)
                 {
                     return(objList);
                 }
             }
         }
     }
     return((List <ExcelData.Param>)null);
 }
Пример #13
0
        public void CreateAIS_URL(int kind)
        {
            string s   = string.Empty;
            string str = string.Empty;

            switch (kind)
            {
            case 0:
                s   = this.AIS_Check_URL;
                str = "ais_check_url.dat";
                break;

            case 1:
                s   = this.AIS_System_URL;
                str = "ais_system_url.dat";
                break;

            case 2:
                s   = this.AIS_UploadChara_URL;
                str = "ais_uploadChara_url.dat";
                break;

            case 3:
                s   = this.AIS_UploadHousing_URL;
                str = "ais_uploadHousing_url.dat";
                break;

            case 4:
                s   = this.AIS_Version_URL;
                str = "ais_version_url.dat";
                break;
            }
            byte[] buffer        = YS_Assist.EncryptAES(Encoding.UTF8.GetBytes(s), "aisyoujyo", "phpaddress");
            string path          = Application.get_dataPath() + "/../DefaultData/url/" + str;
            string directoryName = Path.GetDirectoryName(path);

            if (!Directory.Exists(directoryName))
            {
                Directory.CreateDirectory(directoryName);
            }
            using (FileStream fileStream = new FileStream(path, FileMode.Create, FileAccess.Write))
            {
                using (BinaryWriter binaryWriter = new BinaryWriter((Stream)fileStream))
                    binaryWriter.Write(buffer);
            }
        }
Пример #14
0
    public static List <T> LoadAllFolder <T>(
        string _findFolder,
        string _strLoadFile,
        List <string> _OmitFolderName = null)
        where T : Object
    {
        List <T> objList = new List <T>();

        GlobalMethod.lstABName.Clear();
        GlobalMethod.lstABName = GlobalMethod.GetAssetBundleNameListFromPath(_findFolder, false);
        GlobalMethod.lstABName.Sort();
        for (int index1 = 0; index1 < GlobalMethod.lstABName.Count; ++index1)
        {
            string stringRight = YS_Assist.GetStringRight(Path.GetFileNameWithoutExtension(GlobalMethod.lstABName[index1]), 2);
            if (_OmitFolderName == null || !_OmitFolderName.Contains(stringRight))
            {
                string[] allAssetName = AssetBundleCheck.GetAllAssetName(GlobalMethod.lstABName[index1], false, (string)null, false);
                bool     flag         = false;
                for (int index2 = 0; index2 < allAssetName.Length; ++index2)
                {
                    if (allAssetName[index2].Compare(_strLoadFile, true))
                    {
                        flag = true;
                        break;
                    }
                }
                if (!flag)
                {
                    GlobalMethod.DebugLog("[" + GlobalMethod.lstABName[index1] + "][" + _strLoadFile + "]は見つかりません", 1);
                }
                else
                {
                    T obj = CommonLib.LoadAsset <T>(GlobalMethod.lstABName[index1], _strLoadFile, false, string.Empty);
                    AssetBundleManager.UnloadAssetBundle(GlobalMethod.lstABName[index1], true, (string)null, false);
                    if (Object.op_Implicit((Object)(object)obj))
                    {
                        objList.Add(obj);
                    }
                }
            }
        }
        return(objList);
    }
Пример #15
0
 public void Save(string _path, byte[] _pngData)
 {
     using (FileStream fileStream = new FileStream(_path, FileMode.Create, FileAccess.Write, FileShare.Write))
     {
         using (BinaryWriter binaryWriter = new BinaryWriter((Stream)fileStream))
         {
             binaryWriter.Write(_pngData);
             binaryWriter.Write(100);
             binaryWriter.Write("【AIS_Housing】");
             binaryWriter.Write(this._version.ToString());
             binaryWriter.Write(Singleton <GameSystem> .Instance.UserUUID);
             binaryWriter.Write(YS_Assist.CreateUUID());
             binaryWriter.Write(Singleton <Manager.Housing> .Instance.GetSizeType(this.AreaNo));
             binaryWriter.Write(Singleton <GameSystem> .Instance.languageInt);
             byte[] buffer = MessagePackSerializer.Serialize <CraftInfo>((M0)this);
             binaryWriter.Write(buffer);
         }
     }
 }
Пример #16
0
    public static string LoadAllListText(
        string _assetbundleFolder,
        string _strLoadFile,
        List <string> _OmitFolderName = null)
    {
        StringBuilder stringBuilder = new StringBuilder();

        GlobalMethod.lstABName.Clear();
        GlobalMethod.lstABName = GlobalMethod.GetAssetBundleNameListFromPath(_assetbundleFolder, false);
        GlobalMethod.lstABName.Sort();
        for (int index1 = 0; index1 < GlobalMethod.lstABName.Count; ++index1)
        {
            string stringRight = YS_Assist.GetStringRight(Path.GetFileNameWithoutExtension(GlobalMethod.lstABName[index1]), 2);
            if (_OmitFolderName == null || !_OmitFolderName.Contains(stringRight))
            {
                string[] allAssetName = AssetBundleCheck.GetAllAssetName(GlobalMethod.lstABName[index1], false, (string)null, false);
                bool     flag         = false;
                for (int index2 = 0; index2 < allAssetName.Length; ++index2)
                {
                    if (allAssetName[index2].Compare(_strLoadFile, true))
                    {
                        flag = true;
                        break;
                    }
                }
                if (!flag)
                {
                    GlobalMethod.DebugLog("[" + GlobalMethod.lstABName[index1] + "][" + _strLoadFile + "]は見つかりません", 1);
                }
                else
                {
                    TextAsset textAsset = CommonLib.LoadAsset <TextAsset>(GlobalMethod.lstABName[index1], _strLoadFile, false, string.Empty);
                    AssetBundleManager.UnloadAssetBundle(GlobalMethod.lstABName[index1], true, (string)null, false);
                    if (!Object.op_Equality((Object)textAsset, (Object)null))
                    {
                        stringBuilder.Append(textAsset.get_text());
                    }
                }
            }
        }
        return(stringBuilder.ToString());
    }
Пример #17
0
        public static string LoadURL(string urlFile)
        {
            byte[] srcData = (byte[])null;
            string path    = Application.get_dataPath() + "/../DefaultData/url/" + urlFile;

            if (!File.Exists(path))
            {
                return(string.Empty);
            }
            using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read))
            {
                using (BinaryReader binaryReader = new BinaryReader((Stream)fileStream))
                    srcData = binaryReader.ReadBytes((int)fileStream.Length);
            }
            if (srcData == null)
            {
                return(string.Empty);
            }
            return(Encoding.UTF8.GetString(YS_Assist.DecryptAES(srcData, "aisyoujyo", "phpaddress")));
        }
Пример #18
0
        public void LoadHandleName()
        {
            string path = UserData.Create("system/") + "hn.dat";

            if (File.Exists(path))
            {
                try
                {
                    this.HandleName = Encoding.UTF8.GetString(YS_Assist.DecryptAES(File.ReadAllBytes(path), "illusion", "ai-syoujyo"));
                }
                catch (Exception ex)
                {
                    this.HandleName = string.Empty;
                }
            }
            else
            {
                this.HandleName = string.Empty;
            }
        }
Пример #19
0
 public static T LoadAllFolderInOneFile <T>(
     string _findFolder,
     string _strLoadFile,
     List <string> _OmitFolderName = null)
     where T : Object
 {
     GlobalMethod.lstABName.Clear();
     GlobalMethod.lstABName = GlobalMethod.GetAssetBundleNameListFromPath(_findFolder, false);
     GlobalMethod.lstABName.Sort();
     for (int index = 0; index < GlobalMethod.lstABName.Count; ++index)
     {
         string stringRight = YS_Assist.GetStringRight(Path.GetFileNameWithoutExtension(GlobalMethod.lstABName[index]), 2);
         if (_OmitFolderName == null || !_OmitFolderName.Contains(stringRight))
         {
             if (GlobalMethod.AssetFileExist(GlobalMethod.lstABName[index].ToString(), _strLoadFile, string.Empty))
             {
                 T obj = CommonLib.LoadAsset <T>(GlobalMethod.lstABName[index], _strLoadFile, false, string.Empty);
                 AssetBundleManager.UnloadAssetBundle(GlobalMethod.lstABName[index], true, (string)null, false);
                 return(obj);
             }
         }
     }
     return((T)null);
 }
Пример #20
0
        private void Update()
        {
            bool flag = Object.op_Inequality((Object)null, (Object)Singleton <Game> .Instance.Config);

            this.lstShow.Clear();
            this.lstShow.Add(this.showMainCvs);
            this.lstShow.Add(!flag);
            this.lstShow.Add(!this.showFusionCvs);
            this.lstShow.Add(!this.showInputCoordinate);
            bool active = YS_Assist.CheckFlagsList(this.lstShow);

            if (Object.op_Implicit((Object)this.objMainCanvas))
            {
                this.objMainCanvas.SetActiveIfDifferent(active);
            }
            if (Object.op_Implicit((Object)this.objSubCanvas))
            {
                this.objSubCanvas.SetActiveIfDifferent(active);
            }
            this.lstShow.Clear();
            this.lstShow.Add(this.showFusionCvs);
            this.lstShow.Add(!flag);
            bool enable1 = YS_Assist.CheckFlagsList(this.lstShow);

            if (Object.op_Implicit((Object)this.cvgFusionCanvas))
            {
                this.cvgFusionCanvas.Enable(enable1, false);
            }
            this.lstShow.Clear();
            this.lstShow.Add(this.showDrawMenu);
            this.lstShow.Add(!this.showFusionCvs);
            this.lstShow.Add(!this.showFileList);
            this.lstShow.Add(!flag);
            bool enable2 = YS_Assist.CheckFlagsList(this.lstShow);

            if (Object.op_Implicit((Object)this.cvgDrawCanvas))
            {
                this.cvgDrawCanvas.Enable(enable2, false);
            }
            this.lstShow.Clear();
            this.lstShow.Add(this.showColorCvs);
            this.lstShow.Add(!this.showFusionCvs);
            this.lstShow.Add(this.saveMode || this.updatePng || !this.showFileList);
            this.lstShow.Add(!flag);
            bool enable3 = YS_Assist.CheckFlagsList(this.lstShow);

            if (Object.op_Implicit((Object)this.cvgColorPanel))
            {
                this.cvgColorPanel.Enable(enable3, false);
            }
            this.lstShow.Clear();
            this.lstShow.Add(this.showPattern);
            this.lstShow.Add(!flag);
            bool enable4 = YS_Assist.CheckFlagsList(this.lstShow);

            if (Object.op_Implicit((Object)this.cvgPattern))
            {
                this.cvgPattern.Enable(enable4, false);
            }
            this.lstShow.Clear();
            this.lstShow.Add(this.showInputCoordinate);
            bool enable5 = YS_Assist.CheckFlagsList(this.lstShow);

            if (Object.op_Implicit((Object)this.cvsInputCoordinate))
            {
                this.cvsInputCoordinate.Enable(enable5, false);
            }
            if (Object.op_Implicit((Object)this.cvgShortcut))
            {
                this.cvgShortcut.Enable(this.showShortcut, false);
            }
            if (this.saveMode || this.updatePng)
            {
                if (Input.GetMouseButtonUp(0) || Input.GetMouseButtonUp(1))
                {
                    if (Object.op_Implicit((Object)this.camCtrl))
                    {
                        this.camCtrl.NoCtrlCondition = (BaseCameraControl_Ver2.NoCtrlFunc)(() => false);
                    }
                }
                else if ((Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1)) && (Illusion.Utils.uGUI.isMouseHit && Object.op_Implicit((Object)this.camCtrl)))
                {
                    this.camCtrl.NoCtrlCondition = (BaseCameraControl_Ver2.NoCtrlFunc)(() => true);
                }
            }
            else if (Input.GetMouseButtonUp(0) || Input.GetMouseButtonUp(1))
            {
                if (Object.op_Implicit((Object)this.camCtrl))
                {
                    this.camCtrl.NoCtrlCondition = (BaseCameraControl_Ver2.NoCtrlFunc)(() => false);
                }
            }
            else if ((Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1)) && (Illusion.Utils.uGUI.isMouseHit && Object.op_Implicit((Object)this.camCtrl)))
            {
                this.camCtrl.NoCtrlCondition = (BaseCameraControl_Ver2.NoCtrlFunc)(() => true);
            }
            this.customBase.UpdateIKCalc();
            if (this.customBase.playVoiceBackup.playSampleVoice && !Singleton <Sound> .Instance.IsPlay(Sound.Type.SystemSE, (string)null))
            {
                this.chaCtrl.ChangeEyebrowPtn(this.customBase.playVoiceBackup.backEyebrowPtn, true);
                this.chaCtrl.ChangeEyesPtn(this.customBase.playVoiceBackup.backEyesPtn, true);
                this.chaCtrl.HideEyeHighlight(false);
                this.chaCtrl.ChangeEyesBlinkFlag(this.customBase.playVoiceBackup.backBlink);
                this.chaCtrl.ChangeEyesOpenMax(this.customBase.playVoiceBackup.backEyesOpen);
                this.chaCtrl.ChangeMouthPtn(this.customBase.playVoiceBackup.backMouthPtn, true);
                this.chaCtrl.ChangeMouthFixed(this.customBase.playVoiceBackup.backMouthFix);
                this.chaCtrl.ChangeMouthOpenMax(this.customBase.playVoiceBackup.backMouthOpen);
                this.customBase.playVoiceBackup.playSampleVoice = false;
            }
            if (this.showShortcut)
            {
                if (Input.GetKeyDown((KeyCode)283) || Input.GetMouseButtonUp(0) || Input.GetMouseButtonUp(1))
                {
                    this.showShortcut = false;
                    return;
                }
            }
            else if (Object.op_Inequality((Object)null, (Object)Singleton <Game> .Instance.Config) && Input.GetKeyDown((KeyCode)284))
            {
                Singleton <Game> .Instance.Config.OnBack();
            }
            bool isInputFocused = this.customBase.IsInputFocused();

            if (!isInputFocused && "CharaCustom" == Singleton <Scene> .Instance.NowSceneNames[0] && (!this.showShortcut && Object.op_Equality((Object)null, (Object)Singleton <Game> .Instance.Config)) && Object.op_Equality((Object)null, (Object)Singleton <Game> .Instance.ExitScene))
            {
                if (Input.GetKeyDown((KeyCode)283))
                {
                    this.showShortcut = true;
                }
                else if (Input.GetKeyDown((KeyCode)27))
                {
                    if (Object.op_Equality((Object)null, (Object)Singleton <Game> .Instance.ExitScene))
                    {
                        AIProject.GameUtil.GameEnd(true);
                    }
                }
                else if (Input.GetKeyDown((KeyCode)122))
                {
                    Manager.Config.ActData.Look = !Manager.Config.ActData.Look;
                    this.customBase.centerDraw  = Manager.Config.ActData.Look;
                }
                else if (Input.GetKeyDown((KeyCode)119))
                {
                    if (this.customBase.objAcs01ControllerTop.get_activeSelf() || this.customBase.objAcs02ControllerTop.get_activeSelf())
                    {
                        this.cvsA_Slot.ShortcutChangeGuidType(0);
                    }
                    else if (this.customBase.objHairControllerTop.get_activeSelf())
                    {
                        this.cvsH_Hair.ShortcutChangeGuidType(0);
                    }
                }
                else if (Input.GetKeyDown((KeyCode)101))
                {
                    if (this.customBase.objAcs01ControllerTop.get_activeSelf() || this.customBase.objAcs02ControllerTop.get_activeSelf())
                    {
                        this.cvsA_Slot.ShortcutChangeGuidType(1);
                    }
                    else if (this.customBase.objHairControllerTop.get_activeSelf())
                    {
                        this.cvsH_Hair.ShortcutChangeGuidType(1);
                    }
                }
                else if (Input.GetKeyDown((KeyCode)284) && Object.op_Equality((Object)null, (Object)Singleton <Game> .Instance.Config))
                {
                    Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.OK_S);

                    ConfigWindow.UnLoadAction = (Action)(() => this.customBase.centerDraw = Manager.Config.ActData.Look);
                    Singleton <Game> .Instance.LoadConfig();
                }
            }
            if (!this.firstUpdate && Singleton <CustomBase> .IsInstance() && this.customBase.updateCustomUI)
            {
                this.customBase.changeCharaName           = true;
                this.customBase.updateCvsFaceType         = true;
                this.customBase.updateCvsFaceShapeWhole   = true;
                this.customBase.updateCvsFaceShapeChin    = true;
                this.customBase.updateCvsFaceShapeCheek   = true;
                this.customBase.updateCvsFaceShapeEyebrow = true;
                this.customBase.updateCvsFaceShapeEyes    = true;
                this.customBase.updateCvsFaceShapeNose    = true;
                this.customBase.updateCvsFaceShapeMouth   = true;
                this.customBase.updateCvsFaceShapeEar     = true;
                this.customBase.updateCvsMole             = true;
                this.customBase.updateCvsEyeLR            = true;
                this.customBase.updateCvsEyeEtc           = true;
                this.customBase.updateCvsEyeHL            = true;
                this.customBase.updateCvsEyebrow          = true;
                this.customBase.updateCvsEyelashes        = true;
                this.customBase.updateCvsEyeshadow        = true;
                this.customBase.updateCvsCheek            = true;
                this.customBase.updateCvsLip               = true;
                this.customBase.updateCvsFacePaint         = true;
                this.customBase.updateCvsBeard             = true;
                this.customBase.updateCvsBodyShapeWhole    = true;
                this.customBase.updateCvsBodyShapeBreast   = true;
                this.customBase.updateCvsBodyShapeUpper    = true;
                this.customBase.updateCvsBodyShapeLower    = true;
                this.customBase.updateCvsBodyShapeArm      = true;
                this.customBase.updateCvsBodyShapeLeg      = true;
                this.customBase.updateCvsBodySkinType      = true;
                this.customBase.updateCvsSunburn           = true;
                this.customBase.updateCvsNip               = true;
                this.customBase.updateCvsUnderhair         = true;
                this.customBase.updateCvsNail              = true;
                this.customBase.updateCvsBodyPaint         = true;
                this.customBase.updateCvsFutanari          = true;
                this.customBase.updateCvsHair              = true;
                this.customBase.updateCvsClothes           = true;
                this.customBase.updateCvsClothesSaveDelete = true;
                this.customBase.updateCvsClothesLoad       = true;
                this.customBase.updateCvsAccessory         = true;
                this.customBase.updateCvsAcsCopy           = true;
                this.customBase.updateCvsChara             = true;
                this.customBase.updateCvsType              = true;
                this.customBase.updateCvsStatus            = true;
                this.customBase.updateCvsCharaSaveDelete   = true;
                this.customBase.updateCvsCharaLoad         = true;
                this.customBase.updateCustomUI             = false;
            }
            if (Object.op_Implicit((Object)this.camCtrl))
            {
                this.camCtrl.KeyCondition = (BaseCameraControl_Ver2.NoCtrlFunc)(() => !isInputFocused);
            }
            this.firstUpdate = false;
        }
Пример #21
0
 public void SaveHandleName(string hn)
 {
     this.HandleName = hn;
     File.WriteAllBytes(UserData.Create("system/") + "hn.dat", YS_Assist.EncryptAES(Encoding.UTF8.GetBytes(this.HandleName), "illusion", "ai-syoujyo"));
 }
Пример #22
0
        public static bool PerformCapture(string _path, bool _alpha, int _width, int _height, int _rate)
        {
            RenderTexture rt, rt2;
            var           width  = (_width != 0 ? _width : Screen.width) * _rate;
            var           height = (_height != 0 ? _height : Screen.height) * _rate;
            var           tex    = new Texture2D(width, height, !_alpha ? TextureFormat.RGB24 : TextureFormat.ARGB32, false);
            var           tex2   = new Texture2D(width, height, !_alpha ? TextureFormat.RGB24 : TextureFormat.ARGB32, false);

            if (QualitySettings.antiAliasing != 0)
            {
                rt = RenderTexture.GetTemporary(width, height, !_alpha ? 0x18 : 0x20,
                                                RenderTextureFormat.Default, RenderTextureReadWrite.Default,
                                                QualitySettings.antiAliasing);
                rt2 = RenderTexture.GetTemporary(width, height, !_alpha ? 0x18 : 0x20,
                                                 RenderTextureFormat.Default, RenderTextureReadWrite.Default,
                                                 QualitySettings.antiAliasing);
            }
            else
            {
                rt  = RenderTexture.GetTemporary(width, height, !_alpha ? 0x18 : 0x20);
                rt2 = RenderTexture.GetTemporary(width, height, !_alpha ? 0x18 : 0x20);
            }
            var RenderCam         = Camera.main;
            var backRenderTexture = RenderCam.targetTexture;
            var backRect          = RenderCam.rect;

            var oldBackground = RenderCam.backgroundColor;
            var oldFlags      = RenderCam.clearFlags;

            RenderCam.backgroundColor = new Color(1.0f, 1.0f, 1.0f, 1.0f);
            RenderCam.clearFlags      = CameraClearFlags.Color;
            RenderCam.targetTexture   = rt;
            RenderCam.Render();
            RenderCam.targetTexture = backRenderTexture;
            RenderCam.rect          = backRect;
            RenderTexture.active    = rt;
            tex.ReadPixels(new Rect(0f, 0f, width, height), 0, 0);
            tex.Apply();
            RenderTexture.active = null;

            RenderCam.backgroundColor = new Color(0.0f, 0.0f, 0.0f, 1.0f);
            RenderCam.clearFlags      = CameraClearFlags.Color;
            RenderCam.targetTexture   = rt2;
            RenderCam.Render();
            RenderCam.targetTexture = backRenderTexture;
            RenderCam.rect          = backRect;
            RenderTexture.active    = rt2;
            tex2.ReadPixels(new Rect(0f, 0f, width, height), 0, 0);
            tex2.Apply();
            RenderTexture.active = null;

            RenderCam.backgroundColor = oldBackground;
            RenderCam.clearFlags      = oldFlags;


            var cols1 = tex.GetPixels();
            var cols2 = tex2.GetPixels();

            for (var i = 0; i < cols1.Length; ++i)
            {
                if (cols1[i] == cols2[i])
                {
                    continue;
                }

                var c1 = cols1[i];
                var c2 = cols2[i];
                //var a = 1.0f - Math.Min(Math.Abs(c1.r - c2.r), Math.Min(Math.Abs(c1.g - c2.g), Math.Abs(c1.b - c2.b)));
                //var a = 1.0f - (Math.Abs(c1.r - c2.r) + Math.Abs(c1.g - c2.g) + Math.Abs(c1.b - c2.b)) / 3.0f ;
                var a = 1.0f - Math.Max(Math.Abs(c1.r - c2.r), Math.Max(Math.Abs(c1.g - c2.g), Math.Abs(c1.b - c2.b)));
                cols1[i] = new Color(c1.r, c1.g, c1.b, a);
            }
            tex.SetPixels(cols1);
            tex.Apply();

            var bytes = tex.EncodeToPNG();

            Object.Destroy(tex);

            RenderTexture.ReleaseTemporary(rt);
            RenderTexture.ReleaseTemporary(rt2);
            tex = null;
            if (string.Empty == _path)
            {
                _path = UserData.Create("cap");
                var fileName = YS_Assist.GetDateTimeString(DateTime.Now, "", true, true, true, true, true, true, true);
                _path = Path.GetFullPath(Path.Combine(_path, fileName + ".png"));
                Console.WriteLine("Capture: " + _path);
            }
            File.WriteAllBytes(_path, bytes);
            return(true);
        }
Пример #23
0
    private bool LoadCategoryInfoList(
        string assetBundleName,
        string assetName,
        Dictionary <string, int> dictEnumSrc)
    {
        if (!AssetBundleCheck.IsFile(assetBundleName, assetName))
        {
            Debug.LogError((object)("読み込みエラー\r\nassetBundleName:" + assetBundleName + "\tassetName:" + assetName));
            return(false);
        }
        AssetBundleLoadAssetOperation loadAssetOperation = AssetBundleManager.LoadAsset(assetBundleName, assetName, typeof(TextAsset), (string)null);

        if (loadAssetOperation == null)
        {
            Debug.LogError((object)("読み込みエラー\r\nassetName:" + assetName));
            return(false);
        }
        TextAsset asset = loadAssetOperation.GetAsset <TextAsset>();

        if (Object.op_Equality((Object)null, (Object)asset))
        {
            Debug.LogError((object)"ありえない");
            return(false);
        }
        string[,] data;
        YS_Assist.GetListString(asset.get_text(), out data);
        int length1 = data.GetLength(0);
        int length2 = data.GetLength(1);

        this.dictCategory.Clear();
        if (length1 != 0 && length2 != 0)
        {
            for (int index = 0; index < length1; ++index)
            {
                ShapeInfoBase.CategoryInfo categoryInfo = new ShapeInfoBase.CategoryInfo();
                categoryInfo.Initialize();
                int key = int.Parse(data[index, 0]);
                categoryInfo.name = data[index, 1];
                int num = 0;
                if (!dictEnumSrc.TryGetValue(categoryInfo.name, out num))
                {
                    Debug.LogWarning((object)("SrcBone【" + categoryInfo.name + "】のIDが見つかりません"));
                }
                else
                {
                    categoryInfo.id        = num;
                    categoryInfo.use[0][0] = !(data[index, 2] == "0");
                    categoryInfo.use[0][1] = !(data[index, 3] == "0");
                    categoryInfo.use[0][2] = !(data[index, 4] == "0");
                    if (categoryInfo.use[0][0] || categoryInfo.use[0][1] || categoryInfo.use[0][2])
                    {
                        categoryInfo.getflag[0] = true;
                    }
                    categoryInfo.use[1][0] = !(data[index, 5] == "0");
                    categoryInfo.use[1][1] = !(data[index, 6] == "0");
                    categoryInfo.use[1][2] = !(data[index, 7] == "0");
                    if (categoryInfo.use[1][0] || categoryInfo.use[1][1] || categoryInfo.use[1][2])
                    {
                        categoryInfo.getflag[1] = true;
                    }
                    categoryInfo.use[2][0] = !(data[index, 8] == "0");
                    categoryInfo.use[2][1] = !(data[index, 9] == "0");
                    categoryInfo.use[2][2] = !(data[index, 10] == "0");
                    if (categoryInfo.use[2][0] || categoryInfo.use[2][1] || categoryInfo.use[2][2])
                    {
                        categoryInfo.getflag[2] = true;
                    }
                    List <ShapeInfoBase.CategoryInfo> categoryInfoList = (List <ShapeInfoBase.CategoryInfo>)null;
                    if (!this.dictCategory.TryGetValue(key, out categoryInfoList))
                    {
                        categoryInfoList       = new List <ShapeInfoBase.CategoryInfo>();
                        this.dictCategory[key] = categoryInfoList;
                    }
                    categoryInfoList.Add(categoryInfo);
                }
            }
        }
        AssetBundleManager.UnloadAssetBundle(assetBundleName, true, (string)null, false);
        return(true);
    }
Пример #24
0
    private void Start()
    {
        this.dictBone.Clear();
        if (!Object.op_Inequality((Object)null, (Object)this.text))
        {
            return;
        }
        string[,] data = (string[, ])null;
        YS_Assist.GetListString(this.text.get_text(), out data);
        OutputShapeCalcScript.Info info = (OutputShapeCalcScript.Info)null;
        int length1 = data.GetLength(0);
        int length2 = data.GetLength(1);

        if (length1 != 0 && length2 != 0)
        {
            for (int index = 0; index < length1; ++index)
            {
                if (!this.dictBone.TryGetValue(data[index, 0], out info))
                {
                    info = new OutputShapeCalcScript.Info();
                    this.dictBone[data[index, 0]] = info;
                }
                if ("v" == data[index, 2])
                {
                    info.lstPosX.Add(data[index, 1]);
                }
                if ("v" == data[index, 3])
                {
                    info.lstPosY.Add(data[index, 1]);
                }
                if ("v" == data[index, 4])
                {
                    info.lstPosZ.Add(data[index, 1]);
                }
                if ("v" == data[index, 5])
                {
                    info.lstRotX.Add(data[index, 1]);
                }
                if ("v" == data[index, 6])
                {
                    info.lstRotY.Add(data[index, 1]);
                }
                if ("v" == data[index, 7])
                {
                    info.lstRotZ.Add(data[index, 1]);
                }
                if ("v" == data[index, 8])
                {
                    info.lstSclX.Add(data[index, 1]);
                }
                if ("v" == data[index, 9])
                {
                    info.lstSclY.Add(data[index, 1]);
                }
                if ("v" == data[index, 10])
                {
                    info.lstSclZ.Add(data[index, 1]);
                }
                if (!this.lstSrc.Contains(data[index, 1]))
                {
                    this.lstSrc.Add(data[index, 1]);
                }
            }
        }
        this.OutputText(Application.get_dataPath() + "/shapecalc.txt");
    }