/// <summary> /// 显示效果选择面板 /// </summary> public void ShowEffectSelectPanel(CardBase card, List <string> effectList, ActionIndex finishAction) { if (effectList.Count < 1) { Debug.LogError("需要进行选择的效果数量不足!"); return; } effectSelectPanel.SetActive(true); GameObject selectButtonPanel = effectSelectPanel.transform.Find("BackPanel").Find("SelectButtonPanel").gameObject; Text effectInfoText = effectSelectPanel.transform.Find("BackPanel").Find("EffectInfoPanel").Find("EffectInfoText").GetComponent <Text>(); GameManager.CleanPanelContent(selectButtonPanel.transform); for (int i = 0; i < effectList.Count; i++) { int selectIndex = i; GameObject buttonObject = Instantiate(buttonPrefab, selectButtonPanel.transform); buttonObject.GetComponent <Button>().onClick.AddListener(() => { effectSelectPanel.SetActive(false); finishAction(card, selectIndex); }); EventTrigger.Entry entry = new EventTrigger.Entry(); entry.eventID = EventTriggerType.PointerEnter; entry.callback.AddListener((baseEventData) => { effectInfoText.text = effectList[selectIndex]; }); buttonObject.GetComponent <EventTrigger>().triggers.Add(entry); buttonObject.transform.Find("Text").GetComponent <Text>().text = "效果" + (i + 1); } effectSelectPanel.transform.Find("BackPanel").Find("EffectInfoPanel").Find("EffectInfoText").GetComponent <Text>().text = effectList[0]; }
void SetActionTooltip(ActionIndex actionIndex, string content) { if (actionTooltipObjects[(int)actionIndex].activeSelf != (content != "")) { actionTooltipObjects[(int)actionIndex].SetActive(content != ""); } actionTooltipTextfields[(int)actionIndex].text = content; }
public override int GetHashCode() { int res = ParameterIndex.GetHashCode() ^ ActionIndex.GetHashCode(); if (Constant != null) { if (Constant.Value != null) { res ^= Constant.Value.GetHashCode(); } } return res; }
public override string ToString() { if (IsAction) { return "Action" + ActionIndex.ToString(); } else if (IsParameter) { return "Parameter" + ParameterIndex.ToString(); } else { object value = Constant.Value; if (value == null) { return "(null)"; } return value.ToString(); } }
public void CancelCurrentAction() { if (CurrentAct == ActionIndex.Plan) { Var.PlanMems.Remove(this); } else if (CurrentAct == ActionIndex.Programming) { Var.ProgramMems.Remove(this); } else if (CurrentAct == ActionIndex.Draw) { Var.DrawMems.Remove(this); } else if (CurrentAct == ActionIndex.Compose) { Var.ComposeMems.Remove(this); } else if (CurrentAct == ActionIndex.BdGm) { Var.BdGmMems.Remove(this); } else if (CurrentAct == ActionIndex.Watch) { Var.WatchMems.Remove(this); } else if (CurrentAct == ActionIndex.Game) { Var.GameMems.Remove(this); } else if (CurrentAct == ActionIndex.Book) { Var.BookMems.Remove(this); } else if (CurrentAct == ActionIndex.Cook) { Var.CookMems.Remove(this); } else if (CurrentAct == ActionIndex.Piano) { Var.PiaMems.Remove(this); } Balloon.enabled = false; CurrentAct = ActionIndex.None; }
public ThrowDiceEffectProcess(CardBase launchEffectCard, ActionIndex throwDiceCallBack, Player ownerPlayer) : base(ownerPlayer, "掷骰子") { this.launchEffectCard = launchEffectCard; this.throwDiceCallBack = throwDiceCallBack; }
/// <summary> /// 显示效果选择面板 /// </summary> /// <param name="effectList"></param> /// <param name="finishAction"></param> public void ShowEffectSelectPanel(CardBase card, List <string> effectList, ActionIndex finishAction) { duelSceneScript.ShowEffectSelectPanel(card, effectList, finishAction); }
void SetCurrentAction() { RaycastHit2D[] HitObjects = Physics2D.RaycastAll(transform.position, transform.forward); foreach (RaycastHit2D HitObject in HitObjects) { if (HitObject.collider.gameObject.tag == "Game" && Var.GameMems.Count < 2) { Var.Mng.AudioSources[3].Play(); Debug.Log("Drag on Game"); Balloon.enabled = true; CurrentAct = ActionIndex.Game; Var.GameMems.Add(this); } else if (HitObject.collider.gameObject.tag == "Computer" && Var.ProgramMems.Count < 2) { Var.Mng.AudioSources[3].Play(); Debug.Log("Drag on Computer"); CurrentAct = ActionIndex.Programming; Balloon.enabled = true; Var.ProgramMems.Add(this); } else if (HitObject.collider.gameObject.tag == "BoardGame" && Var.BdGmMems.Count < 2) { Var.Mng.AudioSources[3].Play(); Debug.Log("Drag on BoardGame"); CurrentAct = ActionIndex.BdGm; Balloon.enabled = true; Var.BdGmMems.Add(this); } else if (HitObject.collider.gameObject.tag == "Easel" && Var.DrawMems.Count < 2) { Var.Mng.AudioSources[3].Play(); Debug.Log("Drag on SketchBook"); if (Chief == true) { if (Var.Mng.Tutorial.Page == 28) { Var.Mng.Tutorial.Page += 1; Var.Mng.Tutorial.Collider.enabled = true; } } else { CurrentAct = ActionIndex.Draw; Var.DrawMems.Add(this); } Balloon.enabled = true; } else if (HitObject.collider.gameObject.tag == "Composer" && Var.ComposeMems.Count < 2) { Var.Mng.AudioSources[3].Play(); Debug.Log("Drag on Composer"); CurrentAct = ActionIndex.Compose; Balloon.enabled = true; Var.ComposeMems.Add(this); } else if (HitObject.collider.gameObject.tag == "Book" && Var.BookMems.Count < 2) { Var.Mng.AudioSources[3].Play(); Debug.Log("Drag on Book"); CurrentAct = ActionIndex.Book; Balloon.enabled = true; Var.BookMems.Add(this); } else if (HitObject.collider.gameObject.tag == "TV" && Var.WatchMems.Count < 2) { Var.Mng.AudioSources[3].Play(); Debug.Log("Drag on TV"); CurrentAct = ActionIndex.Watch; Balloon.enabled = true; Var.WatchMems.Add(this); } else if (HitObject.collider.gameObject.tag == "WhiteBoard" && Var.PlanMems.Count < 2) { Var.Mng.AudioSources[3].Play(); Debug.Log("Drag on WhiteBoard"); if (Chief == true) { if (Var.Mng.Tutorial.Page == 20) { Var.Mng.Tutorial.Page += 1; Var.Mng.Tutorial.Collider.enabled = true; } } else { if (Var.OnTutorial == true && Var.Mng.Tutorial.Page == 22) { Var.Mng.Tutorial.Page += 1; Var.Mng.Tutorial.Collider.enabled = true; } else { CurrentAct = ActionIndex.Plan; Var.PlanMems.Add(this); } } Balloon.enabled = true; } else if (HitObject.collider.gameObject.tag == "Cook" && Var.CookMems.Count < 2) { Var.Mng.AudioSources[3].Play(); Debug.Log("Drag on Cook"); CurrentAct = ActionIndex.Cook; Balloon.enabled = true; Var.CookMems.Add(this); } else if (HitObject.collider.gameObject.tag == "Piano" && Var.PiaMems.Count < 2) { Var.Mng.AudioSources[3].Play(); Debug.Log("Drag on Piano"); CurrentAct = ActionIndex.Piano; Balloon.enabled = true; Var.PiaMems.Add(this); } } }
public void PerformAction(ActionIndex index, Unit destination) { // TODO SB add checking _actions[(byte)index].PerformAction(this, destination); }
public void SetAction(ActionIndex index, IBehavior behavior) { // TODO SB add checking _actions[(byte)index] = behavior; }
public bool IsEnemyDestination(ActionIndex index) { return(_actions[(byte)index] is IEnemyDestination); }
public SelectItemEffectProcess(CardBase launchEffectCard, Type type, ActionIndex selectItemCallBack, Player ownerPlayer) : base(ownerPlayer, "选择项") { this.launchEffectCard = launchEffectCard; this.type = type; this.selectItemCallBack = selectItemCallBack; }