Exemple #1
0
    } // end of OnInspectorGUI()

    private void UpdateMotionPath(SoxAtkMotionPath motionPath, AnimationClip[] animClips)
    {
        if (!motionPath.m_motionPathObject)
        {
            return;
        }

        if (motionPath.m_animator == null)
        {
            return;
        }

        if (motionPath.m_pathPositions.Length != motionPath.m_pathStep)
        {
            motionPath.m_pathPositions = new Vector3[motionPath.m_pathStep];
        }

        for (int i = 0; i < motionPath.m_pathStep; i++)
        {
            float stepTime = (float)i / ((float)motionPath.m_pathStep - 1);                // 0 ~ 1
            stepTime = Mathf.Lerp(motionPath.m_timeStart, motionPath.m_timeEnd, stepTime); // Min ~ Max
            animClips[motionPath.m_animClipIndex].SampleAnimation(motionPath.m_animator.gameObject, stepTime);

            // 애니메이터가 적용된 오브젝트의 로컬 스페이스로 포지션 배열을 저장함
            motionPath.m_pathPositions[i] = m_motionPathTransform.InverseTransformPoint(motionPath.m_motionPathObject.position);
        }

        animClips[motionPath.m_animClipIndex].SampleAnimation(motionPath.m_animator.gameObject, motionPath.m_animationSlider);
        motionPath.m_initialized = true;
    }
Exemple #2
0
 private void Clear(SoxAtkMotionPath motionPath)
 {
     motionPath.m_pathPositions = new Vector3[2];
     motionPath.m_initialized   = false;
 }
Exemple #3
0
 private void OnEnable()
 {
     m_motionPath = (SoxAtkMotionPath)target;
 }