private void Start() { gmInstance = GameManager.Instance; battleSceneController = FindObjectOfType <BattleSceneController>(); battleGUIManager = battleSceneController.battleGUIManager; characters = gmInstance.GetCharactersArrayAsPlayer(); if (!gmInstance.IsaCharacterAlive()) { var potionAmount = StoreData.Instance.PotionAmount; bool tostore = (potionAmount <= 0); // else to backpack var message = allDeadMessage + "\n" + ((potionAmount <= 0) ? storeMessage : backpackMessage); battleGUIManager.TextMessage(message); battleGUIManager.AllDead(tostore); } else if (gmInstance.SelectedEnemy.IsBoss) { battleGUIManager.TextMessage(bossMessage + "\n" + normalMessage); } else { battleGUIManager.TextMessage(normalMessage); } Begin(); }
public void Prepare(StatusData s, InputManager im, BattleGUIManager ho) { home = ho; float w = GetComponent <GUITexture> ().pixelInset.x; float h = GetComponent <GUITexture> ().pixelInset.y; float ww = Screen.width / 1280.0f; float hw = Screen.height / 720.0f; GUITexture itemFrame = CreateGUITexture("Item_Frame", "UI/battle/bmenu_item_frame", new Rect(w + 84 * ww, h + 15 * hw, 1072 * ww, 536 * hw)); itemFrame.transform.parent = transform; itemFrame.transform.localPosition = new Vector3(0.0f, 0.0f, 2.1f); status = s; int[][] lp = new int[2][] { new int[3] { 2, (int)(505 * ww), (int)(w + 134 * ww) }, new int[3] { status.itemList.Count / 2 + 1, (int)(-37 * hw), (int)(h + 450 * hw) } }; CreateItemList(status.itemList, transform, lp, home.KozMinPro_Bold); int[][] sp = new int[2][] { new int[3] { 2, (int)(505 * ww), (int)(w + 89 * ww) }, new int[3] { status.itemList.Count / 2 + 1, (int)(-37 * hw), (int)(h + 397 * hw) } }; cursor = CreateCursor(transform); cursor.Prepare(im, this, sp, status.itemList.Count); highLight = CreateHighLight(transform, new Vector2(cursor.cursorTexture.pixelInset.x + 45, cursor.cursorTexture.pixelInset.y + 26)); CreateItemPreview(w + 119 * ww, h + 63 * hw); }
//エンカントアニメーション IEnumerator EncountAnimation(GameObject mainCamera, GameObject battleCamera) { MotionBlur montionBule = mainCamera.GetComponent <MotionBlur> (); montionBule.enabled = true; montionBule.extraBlur = true; montionBule.blurAmount = 0.1f; float n = 0.0f; while (n < 1.0f) { n += 0.1f; montionBule.blurAmount = Mathf.Lerp(0.0f, 1.0f, n); yield return(0); } yield return(new WaitForSeconds(1.0f)); montionBule.enabled = false; mainCamera.GetComponent <Camera>().enabled = false; battleCamera.GetComponent <Camera>().enabled = true; mainCamera.GetComponent <FieldCameraFixation> ().enabled = false; GUITexture m; inputManager.enabled = true; if (encount == 0) { GameObject o = Instantiate(Resources.Load("Prefabs/UIPrefabs/Manual", typeof(GameObject)) as GameObject) as GameObject; m = o.GetComponent <GUITexture> (); m.texture = Resources.Load("UI/Manual/gBattle", typeof(Texture)) as Texture; while (true) { if (inputManager.ButtonB == 1) { Destroy(m.gameObject); break; } yield return(0); } } inputManager.ClearInput(); inputManager.enabled = false; GameObject um = Instantiate(Resources.Load("Prefabs/UIPrefabs/BattleUIObject", typeof(GameObject)) as GameObject) as GameObject; buiManager = um.AddComponent <BattleGUIManager> (); buiManager.Prepare(this, inputManager); foreach (ShinBattleController sp in playerList) { sp.enabled = true; } foreach (ShinBattleController se in enemyList) { se.enabled = true; } inputManager.enabled = true; soundManager.PlayBGM(3); }