Esempio n. 1
0
    /// <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);
    }
    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);
    }
Esempio n. 3
0
    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]);
                }
            }
        });
    }
Esempio n. 4
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);
    }
Esempio n. 5
0
    /// <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);
    }
Esempio n. 6
0
    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);
    }
Esempio n. 7
0
    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);
    }
    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);
    }
Esempio n. 9
0
    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>");
        }
    }
Esempio n. 10
0
    public void EndChangeMap()
    {
        Destroy();

        CEffectResourcePoolingManager.instance.Destroy();

        Debug.Log("EndChangeMap - EACEffectManager");
    }
Esempio n. 11
0
    public void OnSceneLoaded()
    {
        _worldCamera = CameraUtil.FindMainCamera();

        SoundManager.instance.CreateLowPassFilter();

        Debug.Log("EaMainframe - OnSceneLoaded frameCount : " + Time.frameCount);
    }
Esempio n. 12
0
    protected void SendCloseClick(string btnName)
    {
        uiResult.btId = btnName;

        Close();

        Debug.Log("SendCloseClick :" + btnName);
    }
Esempio n. 13
0
    public void StartChangeMap()
    {
        Debug.Log("StartChangeMap - EACObjManager begin frameCount : " + Time.frameCount);

        Destroy();

        Debug.Log("EndChangeMap - EACObjManager end frameCount : " + Time.frameCount);
    }
Esempio n. 14
0
    public void EndChangeMap()
    {
        Debug.Log("EndChangeMap - EACObjManager begin frameCount : " + Time.frameCount);

        Destroy();

        CObjResourcePoolingManager.instance.Destroy();

        Debug.Log("EndChangeMap - EACObjManager end");
    }
Esempio n. 15
0
    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 + "]");
    }
Esempio n. 16
0
    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(&quot;Bam! Done animating&quot;);
                if (_currState.wrapMode != WrapMode.Loop)
                {
                    //Debug.Log(&quot;Animation is not a loop anim, kill it.&quot;);
                    //_currState.enabled = false;
                    isPlaying = false;
                }
                else
                {
                    //Debug.Log(&quot;Loop anim, continue.&quot;);
                    _progressTime = 0.0f;
                }
            }

            yield return(new WaitForEndOfFrame());
        }

        yield return(null);

        if (onComplete != null)
        {
            Debug.Log("Complete");
            onComplete();
        }
    }
Esempio n. 17
0
    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);
        }
    }
Esempio n. 18
0
    void OnDestroy()
    {
        if (onSceneDestroy != null)
        {
            onSceneDestroy();
        }

        Debug.Log("EASceneLogic.OnDestroy()");

        Debug.Assert(instance != null);
        instance = null;
    }
Esempio n. 19
0
    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);
    }
Esempio n. 20
0
    void CreateSceneLogic()
    {
        EASceneLogic sm = null;

        Type t = null;

        _sceneInfo.TryGetValue(controllerClass, out t);

        sm = (EASceneLogic)EAFrameUtil.AddChild(EAMainFrame.instance.gameObject, t, "gameLogic") as EASceneLogic;

        Debug.Log("EA SceneConfig.CreateSceneLogic - call CreateSceneLogic sm is " + ((sm == null) ? "null" : "valid") + " controller class :" + controllerClass + " frameCount:" + Time.frameCount);
    }
Esempio n. 21
0
    public void OnApplicationQuit()
    {
        Debug.Log("MainFrame.OnApplicationQuit()");

        isApplicationQuiting = true;

        if (EASceneLogic.instance != null)
        {
            EASceneLogic.instance.Destroy();
        }

        FileLogger.CloseAllFileLoggers();
    }
Esempio n. 22
0
    public void DoPostInit()
    {
        if (_sceneLoadingState == SceneLoadingState.PostInited)
        {
            return;
        }

        Debug.Log("EASceneLogic.DoPostInit() frameCount:" + Time.frameCount);

        OnPostInit();

        _sceneLoadingState = SceneLoadingState.PostInited;
    }
Esempio n. 23
0
    /*protected virtual */
    private void OnDisable()
    {
        if (_uiState >= UiState.Inited && _uiState < UiState.WillDestroy)
        {
            OnDisableUI();

            _onUiEnabled(this, false);
            if (!_uiId.IsInvalid())
            {
                Debug.Log("<color=lightblue>Ui deActivate :" + _uiId + "</color>");
            }
        }
    }
    void _ChangeState(State newState)
    {
        if (_state == newState)
        {
            Debug.Log("same State:" + newState);
            return;
        }
        Debug.Log("Change State:" + newState);

        // DownloadFiles만 같은 State로 전환가능. 나머진 불가.
        if (_state != State.DownloadEachFile && _state == newState)
        {
            Debug.Assert(false, "Invalid State Transition: " + _state + "-->" + newState);
            return;
        }

        _state = newState;


        switch (_state)
        {
        case State.DownloadMasterFile:
            _StartDownloadMasterFile();
            break;

        case State.CalcDownloadList:
            StartCoroutine(_BuildDownloadList());
            break;

        case State.ShowConfirmMsg:
            _ShowDownloadConfirmMsg();
            break;

        case State.DownloadEachFile:
            _StartDownloadBundleFile();
            break;

        case State.End:
            OnComplete(_errorDesc);
            break;

        case State.ConfirmRetry:
            _ShowRetryConfirmMsg();
            break;

        case State.WaitRetry:
            Debug.Log("WaitRetry. ContinuousNetworkErrorCnt:" + _continuousNetworkErrorCnt);
            _retryWaitTimer = 1;
            break;
        }
    }
Esempio n. 25
0
    public static int GetOsVersion()
    {
        string osVersion = SystemInfo.operatingSystem;

        Debug.Log("SystemInfo.operatingSystem:" + osVersion);

        if (CoreApplication.IsMobileIPhone == true)
        {
            osVersion = osVersion.Replace("iPhone OS ", "");
            return(Mathf.FloorToInt(float.Parse(osVersion.Substring(0, 1))));
        }

        return(0);
    }
Esempio n. 26
0
    /*protected virtual */
    private void OnEnable()
    {
        if (_uiState > UiState.None && _uiState < UiState.WillDestroy)
        {
            OnEnableUI();

            _onUiEnabled(this, true);

            if (!_uiId.IsInvalid())
            {
                Debug.Log("<color=yellow>Ui Activate :" + _uiId + "</color>");
            }
        }
    }
Esempio n. 27
0
    void PlayOnce()
    {
        if (audioClip.Count > playMin)
        {
            Debug.Log("playSound sfx index : " + playMin);

            if (audioClip[playMin] != null)
            {
                if (SoundManager.instance != null)
                {
                    SoundManager.instance.PlayOneShot(audioClip[playMin], volume, SOUND_TYPE.SFX);
                }
            }
        }
    }
Esempio n. 28
0
    /// <summary>
    ///  Transition FSM
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="nState"></param>
    public void TransitionFSMCommand <T>(T nState)
    {
        Type typeParameterType = typeof(T);

        if (typeParameterType.IsEnum == false)
        {
            Debug.Log("invalid type - type is not null");
            return;
        }

        T    current_state = (T)Enum.ToObject(typeParameterType, nState);
        uint idx           = System.Convert.ToUInt32(current_state);

        TransitionCommand(idx);
    }
Esempio n. 29
0
    public void Init()
    {
        _sceneLoadingState = SceneLoadingState.Inited;

        sceneName = SceneLoadingManager.instance.GetLoadedSceneName();

        if (EAMainFrame.instance != null)
        {
            EAMainFrame.instance.OnSceneLoaded();
        }

        Debug.Log("EASceneLogic.Init() frameCount:" + Time.frameCount);

        OnInit();
    }
Esempio n. 30
0
    // player pref save
    public void SaveToDisc()
    {
        foreach (var keyPair in optionValues)
        {
            PlayerPrefs.SetInt(keyPair.Value.key, keyPair.Value.GetValue());
        }

        foreach (var keyPair in optionValues_string)
        {
            PlayerPrefs.SetString(keyPair.Value.key, keyPair.Value.GetValue_String());
        }

        PlayerPrefs.Save();

        Debug.Log("OptionManager - saveToDisc");
    }