コード例 #1
0
        public static ConditionalComponent CreateFromData(Loading.ConditionalData data)
        {
            ConditionalComponent newConditional = null;

            // TODO - Keep conditionals up to date
            switch (data.mType)
            {
            case "HasStatus":
                newConditional = new HasStatusConditional(data);
                break;

            case "NoStatus":
                newConditional = new NoStatusConditional(data);
                break;

            case "OrderNotUsed":
                newConditional = new OrderNotUsedConditional(data);
                break;

            default:
                UnityEngine.Debug.Log("Unhandled conditional type: " + data.mType);
                UnityEngine.Debug.DebugBreak();
                break;
            }
            return(newConditional);
        }
コード例 #2
0
 public ConditionChecker(List <Loading.ConditionalData> conditions)
 {
     if (conditions != null &&
         conditions.Count > 0)
     {
         mConditions = new List <ConditionalComponent>();
         foreach (Loading.ConditionalData data in conditions)
         {
             mConditions.Add(ConditionalComponent.CreateFromData(data));
         }
     }
     else
     {
         mConditions = null;
     }
 }