Example #1
0
 public LStateTrigger(LState f, LState t, float ft, bool te, LSwitchCondition sc)
 {
     conditions   = new List <LSwitchCondition>();
     from         = f;
     to           = t;
     fadeTime     = ft;
     triggerOnEnd = te;
     conditions.Add(sc);
 }
Example #2
0
        public bool Match(LSwitchCondition c)
        {
            if (isLoop)
            {
                data++;
            }
            switch (c.c)
            {
            case Condition.EQUAL:
                if (data == (int)c.target)
                {
                    return(true);
                }
                break;

            case Condition.NOT_EQUAL:
                if (data != (int)c.target)
                {
                    return(true);
                }
                break;

            case Condition.LESS:
                if (data < (int)c.target)
                {
                    return(true);
                }
                break;

            case Condition.LESS_EQUAL:
                if (data <= (int)c.target)
                {
                    return(true);
                }
                break;

            case Condition.GREATER:
                if (data > (int)c.target)
                {
                    return(true);
                }
                break;

            case Condition.GREATER_EQUAL:
                if (data >= (int)c.target)
                {
                    return(true);
                }
                break;

            default:
                break;
            }
            return(false);
        }
Example #3
0
        public bool Match(LSwitchCondition c)
        {
            switch (c.c)
            {
            case Condition.EQUAL:
                if (data == (bool)c.target)
                {
                    return(true);
                }
                break;

            case Condition.NOT_EQUAL:
                if (data != (bool)c.target)
                {
                    return(true);
                }
                break;

            default:
                break;
            }
            return(false);
        }