コード例 #1
0
        private int?EvaluateIndex(User user, IFeatureStore store)
        {
            // Check to see if targets match
            foreach (var target in Targets)
            {
                foreach (var v in target.Values)
                {
                    if (v.Equals(user.Key))
                    {
                        return(target.Variation);
                    }
                }
            }

            // Now walk through the rules and see if any match
            foreach (Rule rule in Rules)
            {
                if (rule.MatchesUser(user, store))
                {
                    return(rule.VariationIndexForUser(user, Key, Salt));
                }
            }

            // Walk through the fallthrough and see if it matches
            return(Fallthrough.VariationIndexForUser(user, Key, Salt));
        }
コード例 #2
0
ファイル: PlayerController.cs プロジェクト: neroes/Platformer
 // Use this for initialization
 void Start()
 {
     rb          = GetComponent <Rigidbody2D>();
     ac          = GetComponent <Animator>();
     fallthrough = GetComponent <Fallthrough>();
 }