public float rankYPosOffset = -20f; //ランクによるy座標のずれ #region 関数 /// <summary> /// 有効化 /// </summary> public void Activate(int playerNo, Color color, int rank, ToolBox.PlayerScore playerScore, ToolBox.ShipData shipData) { //表示 Indicate(true); //値の設定 playerNoLabel.text = "Player" + playerNo; if (rankLabel) { rankLabel.text = rank.ToString(); } if (scoreLabel) { scoreLabel.text = playerScore.score.ToString(); } if (killLabel) { killLabel.text = playerScore.kill.ToString(); } if (deadLabel) { deadLabel.text = playerScore.dead.ToString(); } //Mesh mf.mesh = shipData.GetConnectedMesh(); meshCamera.orthographicSize = mf.mesh.bounds.size.y; //色 colorSetter.SetColor(color); //順位によって位置を変更(下位の順位ほど画面上で下へ) float yPos = (rank - 1) * rankYPosOffset; Vector3 pos = transform.localPosition; pos.y += yPos; transform.localPosition = pos; }
protected override void Start() { base.Start(); gui = ShipSelectGUIManager.Instance; enabled = false; //機体情報は非表示 shipDataIndicator.Indicate(false); //プレイヤー番号 playerNoLabel.text = "Player" + (int)index; //ゲームパッド if (gamepadInput) { gamepadInput.target = gameObject; gamepadInput.index = index; } //色 if (colorSetter) { colorSetter.SetColor(gm.playerColor[((int)index) - 1]); } //プレイモードによって選べるカテゴリを限定する List <string> categoryList = new List <string>(); switch (gm.playMode) { case ToolBox.PlayMode.Battle: categoryList.Add("Player"); break; case ToolBox.PlayMode.VsEnemy: categoryList.Add("VsEnemy"); break; } SetCategoryList(categoryList); }
public override void OnInspectorGUI() { DrawDefaultInspector(); UIColorSetter t = target as UIColorSetter; //色を設定 if (GUILayout.Button("Set Color")) { //押したときの処理 t.SetColor(t.setColor); } }
/// <summary> /// 表示対象のプレイヤーを設定 /// </summary> public void SetPlayer(Player player) { if (gm == null) { gm = GameManager.Instance; } if (gm == null) { return; } this.ship = player.ship; this.player = player; player.indicator = this; //色 int playerNo = ((int)player.playerNo); colorSetter.SetColor(gm.playerColor[playerNo - 1]); //プレイヤー番号 playerNoLabel.text = "Player" + playerNo; //HP UpdateHp(); //エネルギー UpdateEnergy(); //ランチャー normal.Set("None", 0f); normal.shotEffectTween.Play(true); missile.Set("None", 0f); normal.shotEffectTween.Play(true); optical.Set("None", 0f); normal.shotEffectTween.Play(true); UpdateLauncher(); //ロック lockButtonEffectTween.Play(true); //ダメージエフェクト damageEffect.Play(true); //アイテム itemList.SetItemNum(4); //addStatus addHP.gameObject.SetActive(false); addNormal.gameObject.SetActive(false); addMissile.gameObject.SetActive(false); addOptical.gameObject.SetActive(false); //移動UI moveLabel.text = playerNo + "P"; lockObjectDirection.gameObject.SetActive(false); shipMarker.gameObject.SetActive(false); breakLabel.gameObject.SetActive(false); lvUpLabel.gameObject.SetActive(false); }
/// <summary> /// プレイヤーを設定して有効化 /// </summary> public void Activate(Player player) { //表示 Indicate(true); this.player = player; this.playerShip = player.ship; //自身を設定 //this.player.indicator = this; //カメラ playerCamera.mainTarget = player.gameObject; playerCamera.minSize = playerShip.collisionRadius * playerCameraScale; //色 colorSetter.SetColor(playerShip.symbolColor); //左側 Activate_Left(); //右側 Activate_Right(); //中央 Activate_Center(); //フラグ flagActivate = true; }