//更新可进入的节点 private void UpdateCanEnterNode() { MapNodeBase lastEnterNode = MapModel.Inst.enterNode; List <int> lstCanEnterIndex; if (lastEnterNode == null) //如果还没有进入过节点 { lstCanEnterIndex = new List <int>() { 1 } } ; else { lstCanEnterIndex = GetNextCanEnterIndexList(lastEnterNode.nodeIndex); } SetAllNodeNotEnter(); foreach (int canEnterIndex in lstCanEnterIndex) { MapNodeCom nodeCom = GetNodeCom(canEnterIndex); if (nodeCom == null) { Debug.LogError("can't find note:" + canEnterIndex); continue; } nodeCom.SetCanEnter(true); } }
//设置所有节点为不可进入状态 private void SetAllNodeNotEnter() { GComponent mapBlock = MapModel.Inst.GetCurrentBlockCom(); foreach (var child in mapBlock.GetChildren()) { MapNodeCom childNode = child as MapNodeCom; if (childNode != null) { childNode.SetCanEnter(false); } } }