//外部から呼び出し、ターゲットステータス表示モードへ public static void Setup_DrawTargetStatus(int mousex, int mousey, int damage, bool dexflag = false, float dex = 0, float rate = 0) { targetx = mousex; targety = mousey; predictdamage = damage; if (dexflag) { predictdex = dex; } if (dexflag) { predictrate = rate; } predictdexflag = dexflag; state = StatusPrinterState.TARGETSETUP; }
//敵キャラの移動範囲や攻撃範囲・スキル範囲を表示する、あるいは消去する //state : 0->消去 1->詳細表示 2->移動範囲 3->攻撃範囲 public static void Show_Enemy_Range(int showstate) { Delete_Enemy_Range(); switch (showstate) { case 0: state = StatusPrinterState.DETAILHIDE; break; case 1: state = StatusPrinterState.DETAILSETUP; break; case 2: state = StatusPrinterState.DETAILHIDE; commandText.text = "移動"; commandPanel.SetActive(true); CharaMove.Set_Movablelist(); CharaMove.Show_Movablelist(); break; case 3: commandText.text = "攻撃"; commandPanel.SetActive(true); CharaAttack.Set_Attackablelist(); CharaAttack.Show_Attackablelist(); break; default: //スキル Skill tempskill = BattleVal.selectedUnit.skills[showstate - 4]; //stateが3で0番目スキル commandText.text = tempskill.skillname; commandPanel.SetActive(true); CharaSkill.selectedskill = tempskill; CharaSkill.Set_Attackablelist(); CharaSkill.Show_Attackablelist(); break; } }
//ステータスアップデート登録 public static void StatusUpdate() { state = StatusPrinterState.STATUSUPDATE; }
// Update is called once per frame private void Update() { switch (state) { //非表示モード case StatusPrinterState.HIDE: //ステータス関連非表示処理 Hide_Status(); state = StatusPrinterState.IDLE; break; //通常のステータス表示・セットアップ case StatusPrinterState.SETUP: //初期化 animnowtime = 0; Hide_Status(true); //表示内容のセットアップ Setup_CharaStatusPrinter(); state = StatusPrinterState.ANIMATION; break; //攻撃・スキル使用時、対象のステータスを表示するセットアップ case StatusPrinterState.TARGETSETUP: //初期化 animnowtime = 0; Setup_TargetStatusPrinter(); state = StatusPrinterState.ANIMATION; break; //攻撃・スキル使用時の解除 case StatusPrinterState.TARGETHIDE: Hide_TaretStatus(); state = StatusPrinterState.IDLE; break; //キャラの詳細ステータス表示セットアップ case StatusPrinterState.DETAILSETUP: //初期化 animnowtime = 0; Setup_Detail(BattleVal.selectedUnit); state = StatusPrinterState.ANIMATION; break; //キャラの詳細ステータス表示セットアップ case StatusPrinterState.DETAILHIDE: Hide_Detail(); state = StatusPrinterState.IDLE; break; //アニメーションモード //AnimObjListに登録したGameObjectをアニメーションさせる case StatusPrinterState.ANIMATION: if (animnowtime >= animationtime) { Reset_AnimPos(); state = StatusPrinterState.IDLE; } else { foreach (GameObject obj in AnimObjList) { //obj.GetComponent<Image>().color += new Color(0, 0, 0, Time.deltaTime / animationtime); obj.GetComponent <CanvasGroup>().alpha += Time.deltaTime / animationtime; obj.transform.position += new Vector3(animvector[obj] * animationwidth * Time.deltaTime / animationtime, 0); } animnowtime += Time.deltaTime; } break; //待機状態 //BattleVal.menuflagを監視、メニューの瞬間表示を行う case StatusPrinterState.IDLE: //瞬間表示 if (BattleVal.menuflag) { Show_Menu(); } else { Hide_Button(); } break; //選択キャラステータスのアップデート //敵攻撃によって体力が変動した場合等 //StatusUpdate()呼出しでこの状態になる case StatusPrinterState.STATUSUPDATE: if (BattleVal.id2index.ContainsKey(string.Format("{0},{1}", BattleVal.selectX, BattleVal.selectY))) { Unitdata temp = BattleVal.id2index[string.Format("{0},{1}", BattleVal.selectX, BattleVal.selectY)]; unitNameText.text = string.Format("{0}", temp.charaname); unitStatusText.text = string.Format("Lv : {0}\nHP : {1}/{2}\nSTEP : {3} JUMP : {4}", temp.status.level, temp.hp, temp.status.maxhp, temp.status.step, temp.status.jump); } state = StatusPrinterState.IDLE; break; } //1手戻し可能か if (BattleVal.actions.Count != 0 && BattleVal.status == STATUS.PLAYER_UNIT_SELECT) { ResumeButton.gameObject.SetActive(true); } else { ResumeButton.gameObject.SetActive(false); } //選択マスの高さを表示 if (BattleVal.status != STATUS.GAMEOVER && BattleVal.status != STATUS.STAGECLEAR && BattleVal.status != STATUS.FADEOUT) { MapHeightPrinter(); } }
//外部から呼び出し、ターゲットステータス消去モードへ public static void HideTargetStatus() { state = StatusPrinterState.TARGETHIDE; }
//外部から呼び出し、メニュー系統を消す処理 public static void HideStatus() { state = StatusPrinterState.HIDE; }
//外部から呼び出し、IDLE状態からSETUP状態へ public static void SetUp_DrawStatus() { state = StatusPrinterState.SETUP; }