/// <summary> /// 按键检测 /// </summary> /// <param name="keyType"></param> /// <param name="rockValue"></param> private void Instance_KeyUpHandle(UIManager.KeyType keyType, Vector2 rockValue) { switch (keyType) { case UIManager.KeyType.A: if (synthesisItemTree.SelectNode.value == null) //展开或收起该节点 { synthesisItemTree.SelectNode.IsExpand = !synthesisItemTree.SelectNode.IsExpand; } else if (synthesisItemTree.SelectNode.value.GetType().Equals(typeof(SynthesisDataStruct))) { //合成物品 iSynthesisState.SynthesisGoods(synthesisItemTree.SelectNode.value as SynthesisDataStruct); } break; case UIManager.KeyType.B: //返回 this.gameObject.SetActive(false); break; case UIManager.KeyType.UP: synthesisItemTree.SelectUPTreeNode(); break; case UIManager.KeyType.DOWN: synthesisItemTree.SelectDownTreeNode(); break; } }
/// <summary> /// 按键检测(松开) /// </summary> /// <param name="keyType"></param> /// <param name="rockValue"></param> private void Instance_KeyUpHandle(UIManager.KeyType keyType, Vector2 rockValue) { switch (keyType) { case UIManager.KeyType.A: //展开或收起节点 if (uiTree.SelectNode != null) { uiTree.SelectNode.IsExpand = !uiTree.SelectNode.IsExpand; } break; case UIManager.KeyType.UP: if (uiTree.SelectNode) { uiTree.SelectUPTreeNode(); } else if (uiTree.Count > 0) { uiTree[0].IsSelect = true; } break; case UIManager.KeyType.DOWN: if (uiTree.SelectNode) { uiTree.SelectDownTreeNode(); } else if (uiTree.Count > 0) { uiTree[0].IsSelect = true; } break; } }