/// <summary>
        /// [Please do not use it] Set AnimClip to get data
        /// </summary>
        /// <param name="playData"></param>
        /// <param name="layer"></param>
        /// <param name="blendMethod"></param>
        /// <param name="isAutoEndIfNotLoop"></param>
        /// <param name="isEditor"></param>
        public void SetAnimClip(apAnimPlayData playData, int layer, BLEND_METHOD blendMethod, bool isAutoEndIfNotLoop, bool isEditor)
        {
            _linkedAnimClip = playData._linkedAnimClip;
            _targetRootUnit = playData._linkedOptRootUnit;

            //추가
            if (_linkedAnimClip._parentPlayUnit != null &&
                _linkedAnimClip._parentPlayUnit != this)
            {
                //이미 다른 PlayUnit이 사용중이었다면..
                _linkedAnimClip._parentPlayUnit.SetEnd();
                //_linkedAnimClip._parentPlayUnit._linkedAnimClip = null;
            }
            _linkedAnimClip._parentPlayUnit = this;

            _layer = layer;

            _isLoop    = _linkedAnimClip.IsLoop;
            _isAutoEnd = isAutoEndIfNotLoop;
            if (_isLoop)
            {
                _isAutoEnd = false;                //<<Loop일때 AutoEnd는 불가능하다
            }


            _blendMethod = blendMethod;

            _isPause                = false;
            _playStatus             = PLAY_STATUS.Ready;
            _isPlayStartEventCalled = false;
            _isEndEventCalled       = false;


            //_speedRatio = 1.0f;

            _isFirstFrame   = true;
            _nextPlayStatus = _playStatus;

            //추가 1.14
            _isResetFrameOnReadyStatus = true;

            if (isEditor)
            {
                _linkedAnimClip.Stop_Editor(false);                //Stop은 하되 업데이트는 하지 않는다. (false)
            }
            else
            {
                _linkedAnimClip.Stop_Opt(false);
            }

            _unitWeight          = 0.0f;
            _totalRequestWeights = 0.0f;
        }
Example #2
0
        public void Mecanim_Unlink()
        {
            _playStatus = PLAY_STATUS.End;
            if (_linkedAnimClip != null)
            {
                _linkedAnimClip.Stop_Opt(false);
                _linkedAnimClip._parentPlayUnit = null;
                _linkedAnimClip = null;
            }

            _unitWeight          = 0.0f;
            _totalRequestWeights = 1.0f;

            _totalRequestWeights = 1.0f;
            //_isWeightCalculated = true;
            _isPlayStartEventCalled = false;

            _mecanimTime       = 0.0f;
            _mecanimTimePrev   = 0.0f;
            _mecanimTimeLength = 1.0f;
        }
Example #3
0
        // 메카님 전용 함수
        //---------------------------------------------------------------------

        public void Mecanim_Link(apAnimClip animClip)
        {
            _playStatus = PLAY_STATUS.Play;

            _linkedAnimClip          = animClip;
            animClip._parentPlayUnit = this;

            _isPause = false;
            _isPlayStartEventCalled = false;
            _isEndEventCalled       = false;
            _isFirstFrame           = true;
            _mecanimTime            = 0.0f;
            _mecanimTimePrev        = 0.0f;
            _mecanimTimeLength      = animClip.TimeLength;


            if (!animClip.IsLoop)
            {
                animClip.Stop_Opt(false);
            }
        }
Example #4
0
        /// <summary>
        /// [Please do not use it] Set AnimClip to get data
        /// </summary>
        /// <param name="playData"></param>
        /// <param name="layer"></param>
        /// <param name="blendMethod"></param>
        /// <param name="isAutoEndIfNotLoop"></param>
        /// <param name="isEditor"></param>
        public void SetAnimClip(apAnimPlayData playData, int layer, BLEND_METHOD blendMethod, bool isAutoEndIfNotLoop, bool isEditor)
        {
            _linkedAnimClip = playData._linkedAnimClip;
            _targetRootUnit = playData._linkedOptRootUnit;

            //추가
            if (_linkedAnimClip._parentPlayUnit != null &&
                _linkedAnimClip._parentPlayUnit != this)
            {
                //이미 다른 PlayUnit이 사용중이었다면..
                _linkedAnimClip._parentPlayUnit.SetEnd();
                //_linkedAnimClip._parentPlayUnit._linkedAnimClip = null;
            }
            _linkedAnimClip._parentPlayUnit = this;

            _layer = layer;

            _isLoop    = _linkedAnimClip.IsLoop;
            _isAutoEnd = isAutoEndIfNotLoop;
            if (_isLoop)
            {
                _isAutoEnd = false;                //<<Loop일때 AutoEnd는 불가능하다
            }


            _blendMethod = blendMethod;

            _isPause                = false;
            _playStatus             = PLAY_STATUS.Ready;
            _isPlayStartEventCalled = false;
            _isEndEventCalled       = false;

            //_fadeInTime = 0.0f;
            //_fadeOutTime = 0.0f;

            //_delayToPlayTime = 0.0f;
            //_delayToEndTime = 0.0f;

            _speedRatio = 1.0f;

            _isFirstFrame   = true;
            _nextPlayStatus = _playStatus;

            if (isEditor)
            {
                _linkedAnimClip.Stop_Editor(false);                //Stop은 하되 업데이트는 하지 않는다. (false)
            }
            else
            {
                _linkedAnimClip.Stop_Opt(false);
            }

            //_tAnimClipLength = _linkedAnimClip.TimeLength;
            _unitWeight          = 0.0f;
            _isWeightCalculated  = false;
            _totalRequestWeights = 0.0f;
            //_prevUnitWeight = 0.0f;

            //_debugWeight1 = 0.0f;
            //_debugWeight2 = 0.0f;
            //_debugWeight3 = 0.0f;

            //_isDelayIn = false;
            //_isDelayOut = false;

            //_tDelay = 0.0f;
        }