public static void RemoveNodeFromBranch(IDynamicBranch branch, INode nodeToRemove) { branch.SetThisGroupsNode(BranchChildNodeUtil.RemoveNode(branch.ThisGroupsUiNodes, nodeToRemove)); if (branch.ThisGroupsUiNodes.Length == 0 && !branch.IsInGameBranch()) { EZService.Locator.LateGet <IHistoryTrack>().ReturnToNextHomeGroup(); return; } SetValuesToNextNode(branch, nodeToRemove); }
public static void AddNodeToBranch(IDynamicBranch branch) { var noNodes = branch.ThisGroupsUiNodes.Length == 0; branch.SetThisGroupsNode(BranchChildNodeUtil.GetChildNodes(branch.ThisBranch)); if (noNodes) { branch.DefaultStartOnThisNode = branch.ThisGroupsUiNodes.First(); branch.LastHighlighted = branch.DefaultStartOnThisNode; branch.LastSelected = branch.DefaultStartOnThisNode; } }
//Main private void Awake() { CheckForValidSetUp(); ThisGroupsUiNodes = BranchChildNodeUtil.GetChildNodes(this); MyCanvasGroup = GetComponent <CanvasGroup>(); MyCanvasGroup.blocksRaycasts = false; _uiTweener = GetComponent <UITweener>(); MyCanvas = GetComponent <Canvas>(); if (IsHomeScreenBranch() || IsInGameBranch()) { MyParentBranch = this; } AutoOpenCloseClass = EZInject.Class.WithParams <IAutoOpenClose>(this); _branchTypeBaseClass = BranchFactory.Factory.PassThisBranch(this).CreateType(_branchType); _branchTypeBaseClass.OnAwake(); }