Example #1
0
    public static string ShowLog(AnimationFrameComponent animComp)
    {
        var cachedStr = string.Empty;

        if (0 != (run & animComp.state))
        {
            cachedStr += " run";
        }

        if (0 != (jump & animComp.state))
        {
            cachedStr += " jump";
        }

        if (0 != (attack & animComp.state))
        {
            cachedStr += " attack";
        }

        if (0 != (hit & animComp.state))
        {
            cachedStr += " hit";
        }

        if (0 != (crouch & animComp.state))
        {
            cachedStr += " crouch";
        }

        return(cachedStr);
    }
Example #2
0
    public static AnimKey GetAnimKey(AnimationFrameComponent inAnimComp)
    {
        // 우선 순위별
        if (HasState(inAnimComp, hit))
        {
            return(AnimKey.Hit);
        }

        if (HasState(inAnimComp, crouch))
        {
            return(AnimKey.Crouch);
        }

        if (HasState(inAnimComp, jump))
        {
            return(AnimKey.Jump);
        }

        if (HasState(inAnimComp, attack))
        {
            return(AnimKey.Attack);
        }

        if (HasState(inAnimComp, run))
        {
            return(AnimKey.Run);
        }

        return(AnimKey.Idle);
    }
Example #3
0
    public static bool IsLooping(AnimationFrameComponent inAnimComp)
    {
        if (inAnimComp.currentAnim == AnimKey.Run ||
            inAnimComp.currentAnim == AnimKey.Idle)
        {
            return(true);
        }

        return(false);
    }
Example #4
0
    public static bool IsChangeAnim(AnimationFrameComponent inAnimComp, int inState)
    {
        // 조건 정리
        if (0 != (run & inState))
        {
            if (AnimKey.Attack == inAnimComp.currentAnim ||
                AnimKey.Crouch == inAnimComp.currentAnim)
            {
                return(false);
            }
        }
        else if (0 != (crouch & inState))
        {
            if (AnimKey.Jump == inAnimComp.currentAnim ||
                AnimKey.Attack == inAnimComp.currentAnim)
            {
                return(false);
            }
        }
        else if (0 != (jump & inState))
        {
            if (AnimKey.Crouch == inAnimComp.currentAnim ||
                AnimKey.Attack == inAnimComp.currentAnim ||
                AnimKey.Jump == inAnimComp.currentAnim)
            {
                return(false);
            }
        }
        else
        {
            if (AnimKey.Attack == inAnimComp.currentAnim ||
                AnimKey.Hit == inAnimComp.currentAnim ||
                AnimKey.Jump == inAnimComp.currentAnim ||
                AnimKey.Crouch == inAnimComp.currentAnim)
            {
                return(false);
            }
        }

        return(true);
    }
Example #5
0
 public static bool HasState(AnimationFrameComponent inAnimComp, int insState)
 {
     return(0 != (inAnimComp.state & insState));
 }