Ejemplo n.º 1
0
    public override void OnEnter()
    {
        TsLog.Log("--- {0}.OnEnter", new object[]
        {
            base.GetType().FullName
        });
        Scene.ChangeSceneType(this.SceneType());
        CommonTasks.ClearAssetBundleResources(false);
        if (Scene.PreScene == Scene.Type.SELECTCHAR)
        {
            SceneSwitch.DeleteFieldScene();
        }
        NrTSingleton <FormsManager> .Instance.ClearShowHideForms();

        base.StartTaskSerial(CommonTasks.InitializeChangeScene());
        base.StartTaskSerial(CommonTasks.LoadEmptyMainScene());
        base.StartTaskSerial(CommonTasks.MemoryCleaning(true, 8));
        base.StartTaskSerial(this._DownloadTables());
        base.StartTaskSerial(this._SetBilling());
        base.StartTaskSerial(CommonTasks.FinalizeChangeScene(false));
        base.StartTaskSerial(this._WaitToGoNextStage());
        if (TsPlatform.IsWeb)
        {
        }
        NrTSingleton <NkClientLogic> .Instance.SetLoginGameServer(false);

        UnityEngine.Debug.LogWarning("========== GS_LOAD_CHAR_NFY : SetLoginGameServer false ----- ");
    }
Ejemplo n.º 2
0
 public static void TraceSperator()
 {
     if (Option.ms_EnableTrace)
     {
         TsLog.Log("[TsBundle] www =================================================================", new object[0]);
     }
 }
Ejemplo n.º 3
0
    private void OnInputText(IUIObject obj)
    {
        string text = this.m_taInput.Text;

        text = text.Trim();
        if (text.Length == 0)
        {
            TsLog.Log("OnInputText >>" + this.m_taInput.Text.Length.ToString(), new object[0]);
            this.m_taInput.ClearText();
            if (!TsPlatform.IsIPhone)
            {
                this.m_taInput.SetFocus();
            }
            return;
        }
        if (NrTSingleton <WhisperManager> .Instance.GetRoom(this.m_CurChatUnique) == null)
        {
            TsLog.Log("OnInputText >>" + this.m_CurChatUnique.ToString(), new object[0]);
            this.m_taInput.ClearText();
            if (!TsPlatform.IsIPhone)
            {
                this.m_taInput.SetFocus();
            }
            return;
        }
        NrTSingleton <ChatManager> .Instance.SendMessage(CHAT_TYPE.NUM, this.m_taInput.Text, false, null, short.Parse(NrTSingleton <WhisperManager> .Instance.ChatColor), 0L, this.m_CurChatUnique);

        this.m_taInput.ClearText();
        this.m_taInput.Text = string.Empty;
    }
Ejemplo n.º 4
0
    private int[] GetStat(NkSoldierInfo pSoldierinfo, short nLevel, int nGrade = -1)
    {
        NrCharKindInfo charKindInfo = pSoldierinfo.GetCharKindInfo();

        int[] array    = new int[4];
        int   solgrade = (nGrade != -1) ? nGrade : ((int)pSoldierinfo.GetGrade());

        array[0]  = charKindInfo.GetGradePlusSTR(solgrade);
        array[1]  = charKindInfo.GetGradePlusVIT(solgrade);
        array[2]  = charKindInfo.GetGradePlusDEX(solgrade);
        array[3]  = charKindInfo.GetGradePlusINT(solgrade);
        array[0] += charKindInfo.GetIncSTR(solgrade, (int)nLevel);
        array[1] += charKindInfo.GetIncVIT(solgrade, (int)nLevel);
        array[2] += charKindInfo.GetIncDEX(solgrade, (int)nLevel);
        array[3] += charKindInfo.GetIncINT(solgrade, (int)nLevel);
        TsLog.Log("Grade : {4} Level : {5} ,STR : {0} VIT : {1} DEX: {2} INT:{3}", new object[]
        {
            array[0],
            array[1],
            array[2],
            array[3],
            nGrade,
            nLevel
        });
        return(array);
    }
Ejemplo n.º 5
0
    public override void OnExit()
    {
        StageWorld.s_bIsFirstWorld = false;
        NrTSingleton <NkQuestManager> .Instance.ClearClientNpc();

        NrTSingleton <NrAutoPath> .Instance.ClearRPPoint();

        NrTSingleton <MapManager> .Instance.ClearExtraMapInfo();

        RightMenuQuestUI rightMenuQuestUI = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.MAIN_QUEST) as RightMenuQuestUI;

        if (rightMenuQuestUI != null)
        {
            rightMenuQuestUI.OnTouchSoundStop();
        }
        StageWorld.m_bWorldStable = false;
        NrTSingleton <UIManager> .Instance.CloseKeyboard();

        NrTSingleton <FormsManager> .Instance.CloseForm(G_ID.GAMEGUIDE_DLG);

        NrTSingleton <UIDataManager> .Instance.DeleteBundle();

        TsLog.Log("====== {0}.OnExit", new object[]
        {
            base.GetType().FullName
        });
    }
Ejemplo n.º 6
0
 public void ReadXML(XmlReader Reader)
 {
     try
     {
         string attribute = Reader.GetAttribute("Mode");
         this.m_Mode = (EventTrigger._MODE)((int)Enum.Parse(typeof(EventTrigger._MODE), attribute));
         Reader.Read();
         Array values = Enum.GetValues(typeof(EventTrigger._EVENTTRIGGER));
         for (int i = 0; i < values.Length; i++)
         {
             string text = values.GetValue(i).ToString();
             EventTrigger._EVENTTRIGGER category = (EventTrigger._EVENTTRIGGER)((int)Enum.Parse(typeof(EventTrigger._EVENTTRIGGER), text));
             if (Reader.ReadToNextSibling(text))
             {
                 int num = int.Parse(Reader.GetAttribute(0));
                 if (num > 0)
                 {
                     this.ReadListXML(Reader, category);
                     Reader.ReadEndElement();
                 }
             }
         }
         Reader.Read();
     }
     catch (Exception ex)
     {
         TsLog.Log(ex.Message, new object[0]);
     }
 }
Ejemplo n.º 7
0
 private void ReadListXML(XmlReader Reader, EventTrigger._EVENTTRIGGER Category)
 {
     try
     {
         Reader.Read();
         while (Reader.ReadToNextSibling("Item"))
         {
             if (Reader.NodeType == XmlNodeType.EndElement)
             {
                 break;
             }
             if (Reader.NodeType == XmlNodeType.Element)
             {
                 Reader.MoveToNextAttribute();
                 GameObject item = EventTriggerHelper.CreateEventTriggerItem(this, Category, Reader.Value.ToString());
                 this.AddItem(Category, item);
                 this.ReadItemXML(Reader, ref item);
                 Reader.ReadEndElement();
             }
         }
     }
     catch (Exception ex)
     {
         TsLog.Log(ex.Message, new object[0]);
     }
 }
Ejemplo n.º 8
0
 public override void OnEnter()
 {
     TsLog.Log("====== {0}.OnEnter", new object[]
     {
         base.GetType().FullName
     });
     if (TsPlatform.IsLowSystemMemory)
     {
         TsSceneSwitcher.Instance.DeleteScene(TsSceneSwitcher.ESceneType.WorldScene);
         TsSceneSwitcher.Instance.DeleteScene(TsSceneSwitcher.ESceneType.SoldierBatchScene);
         Holder.ClearStackItem(Option.IndependentFromStageStackName, false);
         base.StartTaskSerial(CommonTasks.LoadEmptyMainScene());
         base.StartTaskSerial(CommonTasks.MemoryCleaning(true, 8));
     }
     Scene.ChangeSceneType(this.SceneType());
     base.StartTaskSerial(CommonTasks.InitializeChangeScene());
     base.StartTaskSerial(this._StageProcess());
     base.StartTaskSerial(CommonTasks.DownloadAsset(string.Format("Effect/CharEffect/cameramove{0}{1}", NrTSingleton <UIDataManager> .Instance.AddFilePath, Option.extAsset), new PostProcPerItem(this._funcDownloadedCameraTarget), null, true));
     base.StartTaskSerial(this._StageAfterBattleMapLoadProcess());
     base.StartTaskSerial(CommonTasks.DownloadAsset(string.Format("Effect/CharEffect/fx_battledamage{0}{1}", NrTSingleton <UIDataManager> .Instance.AddFilePath, Option.extAsset), new PostProcPerItem(this._funcDownloadedDamage), null, true));
     base.StartTaskSerial(CommonTasks.DownloadAsset(string.Format("Effect/Instant/fx_result{0}{1}", NrTSingleton <UIDataManager> .Instance.AddFilePath, Option.extAsset), new PostProcPerItem(this._funcDownloadedResultEffect), null, true));
     base.StartTaskSerial(CommonTasks.DownloadAsset(string.Format("Effect/Instant/fx_battlearrow{0}{1}", NrTSingleton <UIDataManager> .Instance.AddFilePath, Option.extAsset), new PostProcPerItem(this._fundBattleArrowDownload), null, true));
     base.StartTaskSerial(CommonTasks.DownloadAsset(string.Format("Effect/Instant/fx_skill_directing{0}{1}", NrTSingleton <UIDataManager> .Instance.AddFilePath, Option.extAsset), new PostProcPerItem(this._fundBattleSkillDirectingDownload), null, true));
     base.StartTaskSerial(CommonTasks.DownloadAsset(string.Format("Effect/Instant/fx_battle_fatality{0}{1}", NrTSingleton <UIDataManager> .Instance.AddFilePath, Option.extAsset), new PostProcPerItem(this._fundBattleSkillRivalDirectingDownload), null, true));
     base.StartTaskSerial(CommonTasks.DownloadAsset(string.Format("Effect/Instant/fx_angergauge{0}{1}", NrTSingleton <UIDataManager> .Instance.AddFilePath, Option.extAsset), new PostProcPerItem(this._fundBattleControlAngergaugeDownload), null, true));
     base.StartTaskSerial(this.DownLoadColosseumEffect());
     base.StartTaskSerial(CommonTasks.MemoryCleaning(true, 8));
     base.StartTaskSerial(CommonTasks.LoadEnvironment(true));
     NrLoadPageScreen.IncreaseProgress(1f);
     NrLoadPageScreen.IncreaseProgress(1f);
     base.StartTaskSerial(CommonTasks.FinalizeChangeScene(true));
     base.StartTaskSerial(this._StageStartBattle());
     base.StartTaskPararell(this._UpdateBattleTemporal());
 }
Ejemplo n.º 9
0
 public override void OnExit()
 {
     TsLog.Log("====== {0}.OnExit", new object[]
     {
         base.GetType().FullName
     });
 }
Ejemplo n.º 10
0
        public bool ConnectServer(string strIP, int strPort)
        {
            if (this.m_ReceiveBuffer == null)
            {
                this.m_ReceiveBuffer = new List <byte>();
            }
            strIP.Trim();
            if (this.m_Socket != null)
            {
                this.Quit();
            }
            this.m_Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            this.m_Socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, this.m_iBufferSize);
            IPAddress.TryParse(strIP, out this.m_kServeripaddress);
            Debug.Log("===========> m_kServeripaddress : " + this.m_kServeripaddress.ToString());
            Debug.Log("===========> strPort : " + strPort.ToString());
            try
            {
                this.m_Socket.Connect(this.m_kServeripaddress, strPort);
            }
            catch (Exception ex)
            {
                TsLog.Log(ex.Message, new object[0]);
                return(false);
            }
            this.m_Buffer = new ReceiveBuffer(this.m_Socket.ReceiveBufferSize);
            NrTSingleton <NrUpdateProcessor> .Instance.AddUpdate(new UpdateFunc(this.NetUpdate));

            SendPacket.GetInstance().SetSocket(this.m_Socket);
            this.m_IPAddress_Relogin = strIP;
            this.m_Port_Relogin      = strPort;
            return(this.m_Socket.Connected);
        }
Ejemplo n.º 11
0
 public WWWProgress RequestDownloadCoroutine(WWWItem wItem, DownGroup dnGroup, bool unloadAfterPostProcess)
 {
     if (wItem != null)
     {
         List <WWWItem> list = new List <WWWItem>();
         if (Option.EnableReportCallStatck)
         {
             wItem.RequestCallStack = StackTraceUtility.ExtractStackTrace();
         }
         list.Add(wItem);
         if (Option.EnableTrace)
         {
             wItem.DebugUnloadReserved = unloadAfterPostProcess;
             TsLog.Log("[TsBundle] RequestDownloadCoroutine( Unload={0} ) => \"{1}\"", new object[]
             {
                 unloadAfterPostProcess,
                 wItem.assetPath
             });
         }
         WWWProgress wWWProgress = new WWWProgress(list);
         this._AddRequestList(list, dnGroup, wWWProgress);
         base.StartCoroutine(this._DownloadPerList(list, unloadAfterPostProcess, null, null));
         return(wWWProgress);
     }
     return(null);
 }
Ejemplo n.º 12
0
    public static GameObject SoundPlay(string goName, AudioClip audioClip, bool loop)
    {
        if (string.IsNullOrEmpty(goName) || audioClip == null)
        {
            return(null);
        }
        GameObject gameObject = GameObject.Find(EventTriggerHelper.s_soundGameDrama);

        if (gameObject == null)
        {
            gameObject = new GameObject(EventTriggerHelper.s_soundGameDrama);
        }
        GameObject gameObject2 = new GameObject(goName, new Type[]
        {
            typeof(AudioSource),
            typeof(TsAudioAdapterGameDrama)
        });

        gameObject2.transform.position = TsAudioManager.Instance.CurrentAudioListener.transform.position;
        gameObject2.transform.parent   = gameObject.transform;
        TsAudioAdapterGameDrama component = gameObject2.GetComponent <TsAudioAdapterGameDrama>();

        component.GetAudioEx().RefAudioClip = audioClip;
        component.GetAudioEx().RefAudioSource = gameObject2.GetComponent <AudioSource>();
        component.GetAudioEx().RefAudioSource.loop = loop;
        component.Play();
        TsLog.Log("### EventTriggerHelper.SoundPlay() audioClip[{0}]", new object[]
        {
            audioClip.name
        });
        return(gameObject2);
    }
Ejemplo n.º 13
0
    public static Camera ActiveCamera()
    {
        Camera camera = null;

        if (Camera.main)
        {
            camera = Camera.main;
        }
        else if (Camera.main)
        {
            camera = Camera.main;
        }
        else if (Camera.current)
        {
            camera = Camera.current;
        }
        if (camera != null)
        {
            return(camera);
        }
        if (NrTSingleton <NrGlobalReference> .Instance.IsEnableLog)
        {
            TsLog.Log("Camera Error", new object[0]);
        }
        Camera[] allCameras = Camera.allCameras;
        for (int i = 0; i < allCameras.Length; i++)
        {
            Camera camera2 = allCameras[i];
            if (camera2.enabled)
            {
                return(camera2);
            }
        }
        return(null);
    }
Ejemplo n.º 14
0
    public void OnEvent_Downloaded(IDownloadedItem wItem, object obj)
    {
        if (!wItem.canAccessAssetBundle)
        {
            return;
        }
        AudioClip x = wItem.mainAsset as AudioClip;

        if (x == null)
        {
            TsLog.LogError("Error! It's not AudioClip. DownLoadPath= " + wItem.assetPath, new object[0]);
            return;
        }
        TsAudio.RequestData requestData = obj as TsAudio.RequestData;
        TsAudio             tsAudio     = TsAudioCreator.Create(requestData.baseData);

        if (tsAudio == null)
        {
            TsLog.LogError("Error! Cannot Create TsAudio DownLoadPath= " + wItem.assetPath, new object[0]);
            return;
        }
        tsAudio.RefAudioClip = (wItem.mainAsset as AudioClip);
        TsLog.Log("OnEvent_Downloaded() Success Download~! ClipName= " + tsAudio.RefAudioClip.name, new object[0]);
        this._downloadedAudioEx.Add(tsAudio);
        wItem.unloadImmediate = true;
    }
Ejemplo n.º 15
0
    public void ChangeNameAck(long nResult)
    {
        if (nResult == 0L)
        {
            TsLog.Log("이름 변경 성공", new object[0]);
            NrCharUser nrCharUser = NrTSingleton <NkCharManager> .Instance.GetChar(1) as NrCharUser;

            NrPersonInfoBase personInfo = nrCharUser.GetPersonInfo();
            personInfo.SetCharName(this.m_newName);
            NrTSingleton <NrMainSystem> .Instance.SetLatestPersonID(personInfo.GetPersonID().ToString());

            MsgHandler.Handle("Req_CONNECT_GAMESERVER_REQ", new object[]
            {
                personInfo.GetPersonID()
            });
            FacadeHandler.MoveStage(Scene.Type.PREPAREGAME);
            NrTSingleton <NkQuestManager> .Instance.SortingQuestInGroup();

            NrTSingleton <FormsManager> .Instance.CloseForm(G_ID.CHANGENAME_DLG);
        }
        else if (nResult == -20L)
        {
            Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("90"));
            this.m_btOk.SetEnabled(true);
        }
        else
        {
            Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("91"));
            this.m_btOk.SetEnabled(true);
        }
    }
Ejemplo n.º 16
0
 private bool _ReleaseLoadedAsset()
 {
     if (this.m_www != null)
     {
         if (Option.EnableTrace)
         {
             TsLog.Log("[TsBundle] your www instance already is loaded, so dispose it (AssetPaht=\"{0}\", Stack=\"{1}\", Type={2})\r\nCallStack={3}", new object[]
             {
                 this.assetPath,
                 this.stackName,
                 this.itemType,
                 this.RequestCallStack
             });
         }
         if (this.safeBundle != null)
         {
             this.safeBundle.Unload(true);
         }
         this.m_www.Dispose();
         this.m_www         = null;
         this.safeBundle    = null;
         this.safeString    = null;
         this.safeBytes     = null;
         this.subBundles    = null;
         this.safeAudioClip = null;
         return(true);
     }
     return(false);
 }
Ejemplo n.º 17
0
    public bool IsVerifyEvent()
    {
        bool flag = false;

        if (this.EventConditionList.Count > 0)
        {
            foreach (GameObject current in this.EventConditionList)
            {
                if (!(current == null))
                {
                    EventCondition component = current.GetComponent <EventCondition>();
                    if (component.Verify)
                    {
                        flag = true;
                    }
                    component.Verify = false;
                }
            }
        }
        else
        {
            flag = true;
        }
        if (flag && EventTrigger.m_DebugMode)
        {
            TsLog.Log("[{0}] Verify EventCondition: {1}", new object[]
            {
                base.GetType().Name,
                base.name
            });
        }
        return(flag);
    }
Ejemplo n.º 18
0
 public void Dispose()
 {
     if (Option.EnableTrace)
     {
         TsLog.Log("[TsBundle] Dispose (AssetPath=\"{0}\", Stack=\"{1}\", Type={2}, Size={3:#,###,###,###})", new object[]
         {
             this.assetPath,
             this.stackName,
             this.itemType,
             (this.m_kItem != null) ? this.m_kItem.nFileSize : 0
         });
     }
     if (this.canAccessAssetBundle)
     {
         this.UnloadSafeBundle(true);
     }
     if (this.m_www != null)
     {
         this.m_www.Dispose();
     }
     this.m_www         = null;
     this.safeBundle    = null;
     this.safeString    = null;
     this.safeBytes     = null;
     this.subBundles    = null;
     this.safeAudioClip = null;
     this.wiState       = WWWItem.StateWI.DESTROIED;
 }
Ejemplo n.º 19
0
    private void ReadItemXML(XmlReader Reader, ref GameObject go)
    {
        EventTriggerItem component = go.GetComponent <EventTriggerItem>();

        if (component == null)
        {
            return;
        }
        try
        {
            Reader.Read();
            while (Reader.ReadToNextSibling("Value"))
            {
                if (!Reader.IsEmptyElement)
                {
                    if (Reader.NodeType == XmlNodeType.EndElement)
                    {
                        break;
                    }
                    if (Reader.NodeType == XmlNodeType.Element)
                    {
                        component.ReadXML(Reader);
                        Reader.ReadEndElement();
                    }
                }
            }
        }
        catch (Exception ex)
        {
            TsLog.Log(ex.Message, new object[0]);
        }
    }
        public void Update(ref MiniDramaActorController.Actor kActor)
        {
            NrCharBase @char = NrTSingleton <NkCharManager> .Instance.GetChar(this._CharID);

            if (@char != null && @char.IsShaderRecovery())
            {
                GameObject rootGameObject = @char.Get3DChar().GetRootGameObject();
                if (this._goController != null)
                {
                    this._goController.transform.parent        = rootGameObject.transform;
                    this._goController.transform.localPosition = Vector3.zero;
                }
                if (MiniDramaActorController.EnableTypeList != null && MiniDramaActorController.EnableTypeList.Length > 0)
                {
                    Type[] enableTypeList = MiniDramaActorController.EnableTypeList;
                    for (int i = 0; i < enableTypeList.Length; i++)
                    {
                        Type          type          = enableTypeList[i];
                        MonoBehaviour monoBehaviour = rootGameObject.GetComponent(type) as MonoBehaviour;
                        if (monoBehaviour != null)
                        {
                            monoBehaviour.enabled = false;
                        }
                    }
                }
                TsLog.Log("[ActorController] {0}", new object[]
                {
                    this.m_Hide
                });
                @char.SetShowHide3DModel(!this.m_Hide, !this.m_Hide, !this.m_Hide);
                kActor.SetActor(@char, this._CharName, this.m_RealActor, !this.m_Hide);
                kActor.SetIdleAni(@char.GetCharAnimation().GetCurrentAniType());
                this._Ready = true;
            }
        }
    private static void _ReadCacheList()
    {
        string path = string.Format("{0}cachelist.txt", CustomCaching._locRoot);

        CustomCaching._cacheList.Clear();
        if (File.Exists(path))
        {
            try
            {
                using (Stream stream = File.Open(path, FileMode.Open))
                {
                    using (BinaryReader binaryReader = new BinaryReader(stream, Encoding.UTF8))
                    {
                        while (binaryReader.PeekChar() != -1)
                        {
                            CustomCaching.CacheItem cacheItem = new CustomCaching.CacheItem();
                            cacheItem.url                 = binaryReader.ReadString().ToLower();
                            cacheItem.version             = binaryReader.ReadInt32();
                            cacheItem.size                = binaryReader.ReadInt64();
                            CustomCaching._spaceOccupied += cacheItem.size;
                            CustomCaching._cacheList.Add(cacheItem.url, cacheItem);
                        }
                    }
                }
            }
            catch (Exception obj)
            {
                TsLog.LogWarning(obj);
            }
            TsLog.Log("CustomCaching. Read cache item list. ({0})", new object[]
            {
                CustomCaching._cacheList.Count
            });
        }
    }
Ejemplo n.º 22
0
 private static void _CreateDefaultStack()
 {
     Holder.m_stackIP = 0;
     TsLog.Log("[TsBundle] _CreateDefaultStack()", new object[0]);
     Holder.m_bundleGroupStack.Add(new Dictionary <string, WWWItem>());
     Holder.m_bundleNameStack.Add(Option.defaultStackName);
 }
Ejemplo n.º 23
0
    public void SetTextShowOrNot(ref Label[] lbControl, int[] arCurrentValue)
    {
        string textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1319");

        for (int i = 0; i < 4; i++)
        {
            lbControl[i].Visible = (arCurrentValue[i] != 0);
            if (arCurrentValue[i] > 0)
            {
                string empty = string.Empty;
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                {
                    textFromInterface,
                    "count",
                    arCurrentValue[i]
                });

                lbControl[i].SetText(empty);
            }
            TsLog.Log("arCurrentValue[{0}] = {1}", new object[]
            {
                i,
                arCurrentValue[i]
            });
        }
    }
Ejemplo n.º 24
0
        public static void ClearStackItem(string name, bool clearMemory)
        {
            if (0 > Holder.m_stackIP)
            {
                Holder._CreateDefaultStack();
            }
            name = name.ToLower();
            bool flag = false;
            Dictionary <string, WWWItem> dictionary = null;

            for (int i = Holder.m_stackIP; i >= 0; i--)
            {
                string b = Holder.m_bundleNameStack[i].ToLower();
                if (name == b)
                {
                    dictionary = Holder.m_bundleGroupStack[i];
                    foreach (KeyValuePair <string, WWWItem> current in dictionary)
                    {
                        Holder._UnloadAssetBundle(current.Value, clearMemory);
                    }
                    dictionary.Clear();
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                TsLog.Log("[TsBundle] ClearStackItem() Cannot found StackName= {0}", new object[]
                {
                    name
                });
            }
        }
Ejemplo n.º 25
0
 private void LoadViocePlay(string filename)
 {
     if (!string.IsNullOrEmpty(filename))
     {
         AudioClip audioClip = CResources.Load(filename) as AudioClip;
         if (audioClip == null)
         {
             TsLog.Log("!!PatchLoadingData Voice File[ {0} ]== NULL!!", new object[]
             {
                 filename
             });
             return;
         }
         if (this.pTouchVoiceObject.GetComponent <AudioSource>() == null)
         {
             this.pTouchVoiceObject.AddComponent <AudioSource>();
         }
         AudioSource component = this.pTouchVoiceObject.GetComponent <AudioSource>();
         if (component != null)
         {
             component.PlayOneShot(audioClip);
         }
         else
         {
             TsLog.LogWarning("!!AudioSource Play Error", new object[0]);
         }
     }
 }
Ejemplo n.º 26
0
 private static void _UnloadAssetBundle(WWWItem wItem, bool clearMemory)
 {
     if (wItem.isCreated)
     {
         try
         {
             if (wItem.canAccessAssetBundle)
             {
                 wItem.UnloadSafeBundle(clearMemory);
             }
             else if (Option.EnableTrace)
             {
                 TsLog.Log("[TsBundle] www unload (<<No-AssetBundle>> AssetPath=\"{0}\", Stack=\"{1}\", Type={2})", new object[]
                 {
                     wItem.assetPath,
                     wItem.stackName,
                     wItem.itemType
                 });
             }
             wItem.Dispose();
         }
         catch (Exception obj)
         {
             TsLog.LogWarning(obj);
         }
     }
     wItem._InternalOnly_ChangeStateCancel();
 }
Ejemplo n.º 27
0
        private static bool IsLackMemorySize(float curTime)
        {
            bool result;

            try
            {
                if (curTime > AutoMemoryCleanUp.m_RegularNextChkTime && NrTSingleton <NrMainSystem> .Instance.AppMemory > AutoMemoryCleanUp.m_LimitHeapSize)
                {
                    TsLog.Log("[Memory] IsLackMemorySize() : Memory Over = {0} MB", new object[]
                    {
                        AutoMemoryCleanUp.m_LimitHeapSize
                    });
                    if (++AutoMemoryCleanUp.m_LimitMemoryCount > 3)
                    {
                        AutoMemoryCleanUp.m_LimitMemoryCount = 0;
                        AutoMemoryCleanUp.m_LimitHeapSize   += AutoMemoryCleanUp.MAX_HEAP_UP_SIZE;
                    }
                    result = true;
                }
                else
                {
                    AutoMemoryCleanUp.m_LimitMemoryCount = 0;
                    result = false;
                }
            }
            catch (Exception message)
            {
                UnityEngine.Debug.LogError(message);
                result = false;
            }
            return(result);
        }
Ejemplo n.º 28
0
    public void DisplayNames(bool bMakeName)
    {
        for (short num = 1; num <= 3; num += 1)
        {
            int charID = NrTSingleton <NkCharManager> .Instance.m_kCharAccountInfo.GetCharID((int)num);

            NrCharUser nrCharUser = NrTSingleton <NkCharManager> .Instance.GetChar(charID) as NrCharUser;

            if (nrCharUser == null)
            {
                this.ShowHideCharName((int)num, false);
            }
            else
            {
                this.ShowHideCharName((int)num, true);
                if (bMakeName)
                {
                    this.SetCharName((int)num, nrCharUser.GetPersonInfo().GetLevel(0L), nrCharUser.GetPersonInfo().GetCharName(), nrCharUser.GetCharKindInfo().GetCHARKIND_INFO().CharTribe, nrCharUser.GetPersonInfo().GetPersonID(), nrCharUser.GetCharKindInfo().GetCHARKIND_INFO().CHARKIND);
                }
                else
                {
                    TsLog.Log("Test bMakeName == false", new object[0]);
                    this.ShowHideCharName((int)num, bMakeName);
                }
            }
        }
    }
Ejemplo n.º 29
0
 public void TogleChange(int RoomUnique)
 {
     this.m_CurChatUnique = RoomUnique;
     if (this.m_RoomUniqueList.Count != 0)
     {
         List <int> list = new List <int>();
         for (int i = 0; i < this.m_RoomUniqueList.Count; i++)
         {
             list.Add(this.m_RoomUniqueList[i]);
         }
         this.m_RoomUniqueList.Clear();
         this.m_RoomUniqueList.Add(RoomUnique);
         for (int j = 0; j < list.Count; j++)
         {
             if (!this.m_RoomUniqueList.Contains(list[j]))
             {
                 this.m_RoomUniqueList.Add(list[j]);
             }
             else
             {
                 TsLog.Log("Duplication Unique = {0}", new object[]
                 {
                     list[j]
                 });
             }
         }
     }
     else
     {
         this.m_RoomUniqueList.Add(RoomUnique);
     }
     this.RangeRoom();
     this.m_tgGroup[0].Value = true;
     this.RefreshChat();
 }
Ejemplo n.º 30
0
    public IntPtr FindChildWindowEX(IntPtr hParentWnd, StringBuilder winname)
    {
        StringBuilder stringBuilder = new StringBuilder(128);
        IntPtr        intPtr        = IUIIME.FindWindowEx(hParentWnd, IntPtr.Zero, null, winname);

        if (intPtr == IntPtr.Zero)
        {
            IntPtr window = IUIIME.GetWindow(hParentWnd, 5);
            IUIIME.GetWindowText(window, stringBuilder, 128);
            TsLog.Log("FindWindow = " + stringBuilder.ToString(), new object[0]);
            if (window == IntPtr.Zero)
            {
                TsLog.Log("FindWindow = " + this.m_hWnd.ToString(), new object[0]);
                return(intPtr);
            }
            IntPtr window2 = IUIIME.GetWindow(window, 1);
            for (int i = 0; i < 10; i++)
            {
                intPtr = this.FindChildWindowEX(window, winname);
                if (intPtr == IntPtr.Zero)
                {
                    if (window == window2)
                    {
                        break;
                    }
                    window = IUIIME.GetWindow(window, 2);
                    IUIIME.GetWindowText(window, stringBuilder, 128);
                    TsLog.Log("FindWindow = " + stringBuilder.ToString(), new object[0]);
                }
            }
        }
        return(intPtr);
    }