Exemple #1
0
 public static ValueIndex SetLastUsedTrigger(this ValueIndex index)
 {
     if (index != null)
     {
         index.TriggerIndexes = TriggerGroup.TryGetLastUsedTrigger();
     }
     return(index);
 }
Exemple #2
0
        public override bool Inspect()
        {
            if (!_name.IsNullOrEmpty())
            {
                _name.nl(PEGI_Styles.ListLabel);
            }

            var before = ConditionLogic.inspectedTarget;

            ConditionLogic.inspectedTarget = Values.global;

            var changed = false;

            if (_browsedBranch == -1)
            {
                if (_type.ToString().Click((_type == ConditionBranchType.And ? "All conditions and sub branches should be true" : "At least one condition OR sub branch should be true")))
                {
                    _type = (_type == ConditionBranchType.And ? ConditionBranchType.Or : ConditionBranchType.And);
                }

                (CheckConditions(ConditionLogic.inspectedTarget) ? icon.Active : icon.InActive).nl();

                var newC = "Conditions".edit_List(ref _conditions, ref _browsedCondition, ref changed);
                if (newC != null)
                {
                    newC.TriggerIndexes = TriggerGroup.TryGetLastUsedTrigger();
                }
            }

            pegi.line(Color.black);

            changed |= "Sub Branches".edit_List(ref _branches, ref _browsedBranch);


            ConditionLogic.inspectedTarget = before;

            return(changed);
        }