Exemplo n.º 1
0
    // ========================================================================== //

    /* public - [Do] Function
     * 외부 객체가 호출(For External class call)*/

    // ========================================================================== //

    /* protected - Override & Unity API         */

    public override void IReplayObserver_Record_ReplayData(float fCurrentTime, ref bool bIsRecordData_DefaultValue_Is_False)
    {
        bool bIsDebug = CheckDebugFilter(EDebugFilter.Debug_Level_Core);

        if (p_bIsRecord_Position)
        {
            Vector3 vecPosition = _pTransform_Target.position;
            if (_listRecord_Position.GetLastValue() != vecPosition)
            {
                _listRecord_Position.Add(vecPosition, fCurrentTime);
                bIsRecordData_DefaultValue_Is_False = true;

                if (bIsDebug)
                {
                    Debug.Log(name + "Record Position " + vecPosition);
                }
            }
        }

        if (p_bIsRecord_Rotation)
        {
            Quaternion rotation = _pTransform_Target.rotation;
            if (_listRecord_Rotation.GetLastValue() != rotation)
            {
                _listRecord_Rotation.Add(rotation, fCurrentTime);
                bIsRecordData_DefaultValue_Is_False = true;

                if (bIsDebug)
                {
                    Debug.Log(name + "Record Position " + rotation);
                }
            }
        }

        if (p_bIsRecord_Scale)
        {
            Vector3 vecScale = _pTransform_Target.localScale;
            if (_listRecord_Scale.GetLastValue() != vecScale)
            {
                _listRecord_Scale.Add(vecScale, fCurrentTime);
                bIsRecordData_DefaultValue_Is_False = true;

                if (bIsDebug)
                {
                    Debug.Log(name + "Record Position " + vecScale);
                }
            }
        }
    }
Exemplo n.º 2
0
    // Dictionary<string, CommandExecuteData> _pReplayData_Origin = new Dictionary<string, CommandExecuteData>();

    // ========================================================================== //

    /* public - [Do] Function
     * 외부 객체가 호출(For External class call)*/


    // ========================================================================== //

    /* protected - Override & Unity API         */

    protected override void OnAwake()
    {
        base.OnAwake();

        _pCommandExecuter.p_Event_OnExecuteCommand.Subscribe +=
            (arg) =>
        {
            var pCommandExecuted = arg.pCommandExecuted;

            if (pCommandExecuted.sInputValue.bIsAlwaysInput)
            {
                // AlwaysInput은 별도로 처리해야 한다.
            }

            _listReplayData_Temp.Add(pCommandExecuted, pCommandExecuted.fExcuteTime);
        };
    }
Exemplo n.º 3
0
    public override void IReplayObserver_Record_ReplayData(float fCurrentTime, ref bool bIsRecordData_DefaultValue_Is_False)
    {
        int iOriginCount = _listReplayData.Count;

        for (int i = 0; i < _listReplayData_Temp.Count; i++)
        {
            ReplayDataList <CommandExcuted> .SReplayData pReplayData = _listReplayData_Temp[i];
            float fRecordTime = pReplayData.fRecordTime;
            if (_fPrevRecordTime <= fRecordTime && fRecordTime <= fCurrentTime)
            {
                _listReplayData.Add(pReplayData);
            }
        }
        _listReplayData_Temp.Clear();

        _fPrevRecordTime = fCurrentTime;
        bIsRecordData_DefaultValue_Is_False = iOriginCount != _listReplayData.Count;
    }