int _OnNetworkError(string desc) { _continuousNetworkErrorCnt++; Debug.Log("_OnNetworkError : " + desc + " _continuousNetworkErrorCnt: " + _continuousNetworkErrorCnt); _errorDesc = desc; if (_continuousNetworkErrorCnt == 1) { // 연속 1회는 자동 재시도 _errorDesc = null; _stateToRetry = _state; _ChangeState(State.WaitRetry); return(1); } else if (_continuousNetworkErrorCnt >= 2) { if (_continuousNetworkErrorCnt == 2) { _stateToRetry = _state; // 연속 2회는 재시도 확인창 _ChangeState(State.ConfirmRetry); } return(2); } return(0); }
public static bool EntityUnSetting(EA_CObjectBase pDelObjBase) { if (pDelObjBase != null) { if (pDelObjBase.GetObjInfo().m_eObjState == eObjectState.CS_SETENTITY) { // [3/6/2014 puos] entity unsetting error check Debug.Log("EntityUnSetting error : " + pDelObjBase.GetObjInfo().m_strGameName); return(false); } GameObject pGameObject = pDelObjBase.GetLinkEntity(); if (pGameObject == null) { Debug.Log("EntityUnSetting gameobject is null : " + pDelObjBase.GetObjInfo().m_strGameName); return(false); } // puos 20141019 null parent set pGameObject.transform.parent = null; CObjResourcePoolingManager.instance.Despawn(pDelObjBase.GetLinkEntity()); pDelObjBase.SetLinkEntity(null); //Debug.Log("EntityUnSetting pSetObject :" + pDelObjBase.GetObjInfo().m_strGameName); } return(true); }
void _ShowRetryConfirmMsg() { string errorMsg = Translate("EC_NOT_CONNECT_1000") + System.Environment.NewLine + _errorDesc; Debug.Log(errorMsg); // Popup.OneButton _popup = new Popup.OneButton //{ // Title = "UI_Noti", // Message = errorMsg, // FirstBtn_Txt = "UI_Confirm", // }; // [12/17/2018 puos] 게임 종료 버튼 추가 //_popup.Popup(delegate (bool ok) { _errorDesc = null; _continuousNetworkErrorCnt = 0; if (_downloadMaterfileByteArray == null) { _ChangeState(State.DownloadMasterFile); } else { _ChangeState(State.DownloadEachFile); } } //); //PopupManager.Instance.Push(_popup); }
static string MakeFilePathForAccount(string fileName, string accountName, bool isOffline) { Debug.Assert(accountName != null); string offMode = isOffline ? "_offline" : string.Empty; return(string.Format("{0}/{1}{2}_{3}", Application.persistentDataPath, accountName, offMode, fileName)); }
public bool UpdateResource(string szResourceFullPath) { if (File.Exists(szResourceFullPath) == false) { return(false); } string szlowerResourcePath = AssetBundleResourceInfo.GetRemoveExtPath(szResourceFullPath).ToLower(); if (m_ResourceList.ContainsKey(szlowerResourcePath) == false) { return(false); } AssetBundleResourceInfo resource = m_ResourceList[szlowerResourcePath]; AssetBundleInfo bundleInfo = m_AssetBundleList[resource.m_AssetBundleKey]; if (bundleInfo == null) { Debug.LogError("assetbundle info is null : @" + resource.m_AssetBundleKey); } FileInfo fileInfo = new FileInfo(szResourceFullPath); resource.m_dateResource = fileInfo.LastWriteTime; resource.m_lResourceSize = fileInfo.Length; FileInfo metaFileInfo = new FileInfo(szResourceFullPath + @".meta"); resource.m_dateMetaResource = metaFileInfo.LastWriteTime; resource.m_lMetaResourceSize = metaFileInfo.Length; return(true); }
public bool RemoveResource(string szResourceFullPath) { string szlowerResourcePath = AssetBundleResourceInfo.GetRemoveExtPath(szResourceFullPath).ToLower(); if (m_ResourceList.ContainsKey(szlowerResourcePath) == false) { return(false); } AssetBundleResourceInfo resource = m_ResourceList[szlowerResourcePath]; AssetBundleInfo assetbundleinfo = m_AssetBundleList[resource.m_AssetBundleKey]; if (assetbundleinfo != null) { assetbundleinfo.m_ResourceList.Remove(szlowerResourcePath); if (assetbundleinfo.m_ResourceList.Count == 0) { m_AssetBundleList.Remove(assetbundleinfo.GetBundleMidPath() + assetbundleinfo.m_szAssetRealBundleName); } } else { Debug.LogError("assetbundle info is null"); } resource.Clear(); m_ResourceList.Remove(szlowerResourcePath); return(true); }
public bool HandleEscapeKey() { if (uiPopupList.Count > 0) { UiCtrlBase ui = uiPopupList[uiPopupList.Count - 1]; if (ui != null && ui.isActiveAndEnabled) { string uiName = ui.name; bool handled = ui.HandleEscapeKey(); if (handled) { Debug.Log("EscapeKey has handled by PopupUi[" + uiName + "]."); return(handled); } } } if (_currUi != null) { _currUi.OnClickEscapeKey(); return(false); } return(true); }
//each time you want to get a new average, feed it the most recent value //and this method will return an average over the last SampleSize updates public Vector3 Update(Vector3 MostRecentValue) { Debug.Assert(m_iNextUpdateSlot < m_History.Count, "next update slot is fault count : " + m_iNextUpdateSlot); if (m_iNextUpdateSlot < m_History.Count) { //overwrite the oldest value with the newest m_History[m_iNextUpdateSlot++] = MostRecentValue; } //make sure m_iNextUpdateSlot wraps around. if (m_iNextUpdateSlot >= m_History.Count) { m_iNextUpdateSlot = 0; } //now to calculate the average of the history list //c++ code make a copy here, I use Zero method instead. //Another approach could be creating public clone() method in Vector2D ... Vector3 sum = m_ZeroValue; sum = Vector3.zero; for (int i = 0; i < m_History.Count; ++i) { sum += m_History[i]; } sum = sum / m_History.Count; return(sum); }
/// <summary> /// change animation state /// </summary> /// <param name="animParam"></param> protected override void ChangeAnim(AnimStateBase state) { List <PlayAnimParam> animParam = ((AnimState)state).playAnimParams; string aniTemp = ""; for (int i = 0; i < animParam.Count; i++) { PlayAnimParam param = (PlayAnimParam)animParam[i]; string aniName = param.aniName; if (m_anim[aniName] != null) { m_anim[aniName].wrapMode = param.warpMode; if (param.isForcePlay) { m_anim.CrossFade(aniName, param.fadeLength); } else { m_anim.CrossFadeQueued(aniName, param.fadeLength); } aniTemp += "/" + aniName; } } Debug.Log("#Animation# Play Anim : " + aniTemp); }
/// <summary> /// play sound using sfx /// </summary> /// <param name="index"> 0: method , 1: min , 2: max </param> public void AnimEvent_PlaySound(string index) { Debug.Assert(soundCue != null, "sfx - soundCue is null :" + gameObject.name); if (soundCue != null) { string szSeparateExt = ";"; string[] v = index.Split(szSeparateExt.ToCharArray()); Debug.Assert(v.Length >= 2, "PlaySound is invalid : " + gameObject.name + " arg : " + index); if (v.Length == 2) { soundCue.method = (SoundCue.eMethod)System.Convert.ToInt32(v[0]); soundCue.playMin = soundCue.playMax = System.Convert.ToInt32(v[1]); } else if (v.Length > 2) { soundCue.method = (SoundCue.eMethod)System.Convert.ToInt32(v[0]); soundCue.playMin = System.Convert.ToInt32(v[1]); soundCue.playMax = System.Convert.ToInt32(v[2]); } soundCue.PlaySound(); SendEventToOwner(SfxEventType.PlaySound, index); } }
void AnimEvent_PlaySfxGroup(string active_group) { string szSeparateExt = ";"; string[] v = active_group.Split(szSeparateExt.ToCharArray()); Debug.Assert(v.Length >= 2, "AnimEvent_ActiveSfxGroup is invalid : " + active_group); bool active = false; active = (v.Length < 2) ? true : (v[1].Equals("true") ? true : false); SetParam(v[0], delegate(GameObject go) { if (go != null) { Debug.Log("Active Sfx Group : " + active_group + " frameCount : " + Time.frameCount); if (active) { SendEventToOwner(SfxEventType.ActiveSfxGroup, v[0]); } else { SendEventToOwner(SfxEventType.DeActiveSfxGroup, v[0]); } } }); }
protected void _ChangeUiState(UiState state) { Debug.Assert(_uiState != state); _uiState = state; _onUiStateChanged(this, state); }
/// <summary> /// change animation state /// </summary> /// <param name="animParam"></param> protected override void ChangeAnim(AnimStateBase state) { if (m_anim == null) { return; } List <PlayAnimParam> animParam = ((AnimState)state).playAnimParams; string aniTemp = ""; for (int i = 0; i < animParam.Count; i++) { string aniName = ((PlayAnimParam)animParam[i]).aniName; int value = ((PlayAnimParam)animParam[i]).value; PlayAnimParam.Type type = ((PlayAnimParam)animParam[i]).type; if (type == PlayAnimParam.Type.Trigger) { m_anim.SetTrigger(((PlayAnimParam)animParam[i]).paramId); aniTemp += "/" + aniName; continue; } m_anim.SetInteger(((PlayAnimParam)animParam[i]).paramId, value); aniTemp += "/" + aniName + ":" + value; } Debug.Log(gameObject.name + " # Play Anim # " + aniTemp); }
sealed public override void _Init() { Debug.Assert(_uiState < UiState.Inited, @"UiCtrl(" + name + @") has already initialized."); if (!_isCreated) { _Create(); } _ChangeUiState(UiState.Inited); _RelayUiParam(); if (_uiParamBase != null && _uiParamBase.onLoadCompleted != null) { _uiParamBase.onLoadCompleted(this); } OnInit(); // Refresh () is executed when refreshFlag is specified in OnInit (). TryRefresh(); if (!_uiId.IsInvalid()) { Debug.Log("<color=lightblue>Ui Activate :" + _uiId + "</color>"); } }
static void ApplyFrameRate(int frameRateType) { switch (frameRateType) { case 0: Application.targetFrameRate = 20; QualitySettings.vSyncCount = CoreApplication.IsMobile ? 0 : 0; break; case 1: Application.targetFrameRate = 30; QualitySettings.vSyncCount = CoreApplication.IsMobile ? 1 : 0; break; case 2: Application.targetFrameRate = 40; QualitySettings.vSyncCount = CoreApplication.IsMobile ? 1 : 0; break; case 3: Application.targetFrameRate = 60; QualitySettings.vSyncCount = CoreApplication.IsMobile ? 1 : 0; break; } Debug.Log("FrameRate:" + Application.targetFrameRate + " IsMobile : " + CoreApplication.IsMobile); }
protected void SendCloseClick(string btnName) { uiResult.btId = btnName; Close(); Debug.Log("SendCloseClick :" + btnName); }
public void EndChangeMap() { Destroy(); CEffectResourcePoolingManager.instance.Destroy(); Debug.Log("EndChangeMap - EACEffectManager"); }
public SteeringBehaviour(AIAgent _entity) { m_entity = _entity; m_fWaypointSeekDistSq = wayPointSeekDist * wayPointSeekDist; Debug.Assert(m_entity != null, "entity is null"); }
public void StartChangeMap() { Debug.Log("StartChangeMap - EACObjManager begin frameCount : " + Time.frameCount); Destroy(); Debug.Log("EndChangeMap - EACObjManager end frameCount : " + Time.frameCount); }
protected void GeneralProjectileType() { Debug.DrawLine(transform.position, transform.position + m_vDir * WeaponInfo.fProjectileSpeed, Color.yellow); Vector2 vPos = transform.position + m_vDir * WeaponInfo.fProjectileSpeed * Time.deltaTime; SetVPos(vPos); }
public void OnSceneLoaded() { _worldCamera = CameraUtil.FindMainCamera(); SoundManager.instance.CreateLowPassFilter(); Debug.Log("EaMainframe - OnSceneLoaded frameCount : " + Time.frameCount); }
/// <summary> /// Called after subframe managers of MainFrame are initialized /// </summary> public void PostInit() { if (Application.isPlaying) { Debug.Assert(IsMainFramePosInitReady()); } _postInitCalled = true; }
public void EndChangeMap() { Debug.Log("EndChangeMap - EACObjManager begin frameCount : " + Time.frameCount); Destroy(); CObjResourcePoolingManager.instance.Destroy(); Debug.Log("EndChangeMap - EACObjManager end"); }
private void StartLoad(string sceneName) { // When testing from a particular scene in the editor, calling GetLoadedSceneName () is correct because _sceneNameToLoad does not carry the name of the first scene when moving the scene. _prevSceneId = GetLoadedSceneName(); _sceneNameToLoad = sceneName; _state = State.CloseCurrScene; Debug.Log("SceneManager.LoadScene() [" + GetPrevSceneName() + "] -> [" + sceneName + "]"); }
public static IEnumerator CtimeScaleZeroPlay(Animation animation, System.Action onComplete) { AnimationState _currState = GetFirstAnimState(animation); bool isPlaying = true; float _progressTime = 0f; float _timeAtLastFrame = 0f; float _timeAtCurrentFrame = 0f; float deltaTime = 0f; animation.Play(); _timeAtLastFrame = Time.realtimeSinceStartup; while (isPlaying) { _timeAtCurrentFrame = Time.realtimeSinceStartup; deltaTime = _timeAtCurrentFrame - _timeAtLastFrame; _timeAtLastFrame = _timeAtCurrentFrame; _progressTime += deltaTime; _currState.normalizedTime = _progressTime / _currState.length; animation.Sample(); //Debug.Log(_progressTime); if (_progressTime >= _currState.length) { //Debug.Log("Bam! Done animating"); if (_currState.wrapMode != WrapMode.Loop) { //Debug.Log("Animation is not a loop anim, kill it."); //_currState.enabled = false; isPlaying = false; } else { //Debug.Log("Loop anim, continue."); _progressTime = 0.0f; } } yield return(new WaitForEndOfFrame()); } yield return(null); if (onComplete != null) { Debug.Log("Complete"); onComplete(); } }
public void SetResultCb <T>(UiCallbackType <T> cb) { _resultCbD = cb; if (_resultCbD == null) { return; } Debug.Assert(GetResultType() == typeof(T), @"SetResultCb() - Callback types do not match. '" + this.GetType().ToString() + @"' The return type of type '" + GetResultType()); }
void Init() { EAMainFrame mainframe = FindObjectOfType <EAMainFrame>(); // When the first scene runs, it creates a MainFrame. if (mainframe == null) { EAMainframeUtil.CreateMainFrameTree(); Debug.Log("EA SceneConfig.Init - Call Init() frameCount:" + Time.frameCount); } }
public void SetDummyObject(string dummyObject_id) { GameObject _DummyObject = GetObjectInItem(dummyObject_id); Debug.Assert(_DummyObject != null, "EAWeapon DummyObject is null"); if (_DummyObject != null) { fireDummyObject = _DummyObject; } }
public static string[] LoadTextLineArray(string filePath) { if (!File.Exists(filePath)) { return(null); } string[] s = File.ReadAllLines(filePath); Debug.Log("FileManager - " + filePath + " - read string:" + s); return(s); }
void OnDestroy() { if (onSceneDestroy != null) { onSceneDestroy(); } Debug.Log("EASceneLogic.OnDestroy()"); Debug.Assert(instance != null); instance = null; }