예제 #1
0
        private void HandleTargetChecked(ChainNode target, bool isChecked)
        {
            // This is setting actual targets in the state.

            if (isChecked && !SelectionState.Contains(target))
            {
                SelectionState.AddTarget(target);
            }

            else if (!isChecked && SelectionState.Contains(target))
            {
                SelectionState.RemoveTarget(target);
            }
        }
예제 #2
0
        private void CreateTargetCheckbox(ChainNode target)
        {
            var newTargetItemGo = Instantiate(TargetUiPrefab);
            var newTargetItem   = newTargetItemGo.GetComponent <StateRouterTargetCheckboxView>();

            newTargetItem.transform.SetParent(TargetItemRootTransform, false);

            if (SelectionState != null && SelectionState.Contains(target))
            {
                newTargetItem.Checked = true;
            }

            newTargetItem.CheckedChanged += isChecked => HandleTargetChecked(target, isChecked);

            TargetsToTargetCheckboxes.Add(target, newTargetItem);
        }