//---------------------------------------------------------------------- // 更新 //---------------------------------------------------------------------- // @Param none // @Return none // @Date 2015/1/8 @Update 2015/1/8 @Author T.Kawashita //---------------------------------------------------------------------- void Update() { float gauge = 0.0f; switch (m_gaugePlayer) { case 1: gauge = CGaugeManager.m_p1Gauge; break; case 2: gauge = CGaugeManager.m_p2Gauge; break; case 3: gauge = CGaugeManager.m_p3Gauge; break; case 4: gauge = CGaugeManager.m_p4Gauge; break; } // ゲージのレベルによって画像を変える int level = CGaugeManager.GetLevel(gauge); if (m_gaugeLevel != level) { if (level == 3) { m_uiSprite.spriteName = "gage_3"; } else if (level == 2) { m_uiSprite.spriteName = "gage_2"; } else if (level == 1) { m_uiSprite.spriteName = "gage_1"; } else { m_uiSprite.spriteName = "gage_0"; } m_gaugeLevel = level; } }
//---------------------------------------------------------------------- // 更新 //---------------------------------------------------------------------- // @Param none // @Return none // @Date 2015/1/9 @Update 2015/1/9 @Author T.Kawashita //---------------------------------------------------------------------- void Update() { float gauge = 0.0f, upScale = 0.0f; // 現在のゲージ取得 switch (m_gaugePlayer) { case 1: gauge = CGaugeManager.m_p1Gauge; break; case 2: gauge = CGaugeManager.m_p2Gauge; break; case 3: gauge = CGaugeManager.m_p3Gauge; break; case 4: gauge = CGaugeManager.m_p4Gauge; break; } // ゲージのレベルによって画像を変える int level = CGaugeManager.GetLevel(gauge); // 前回までのレベルと違った場合 if (level != m_gaugeLevel) { if (level > m_gaugeLevel) { switch (this.name) { case "1PGauge": GameObject.Find("Player1").transform.FindChild("player").transform.GetComponent <CPlayer1> ().m_playerSE.PlaySE("charge_finish"); GameObject.Find("Player1").transform.FindChild("player").transform.FindChild("PlayerEffect").transform.GetComponent <CEffect>().PlayerGaugeUp(); break; case "2PGauge": GameObject.Find("Player2").transform.FindChild("player").transform.GetComponent <CPlayer2> ().m_playerSE.PlaySE("charge_finish"); GameObject.Find("Player2").transform.FindChild("player").transform.FindChild("PlayerEffect").transform.GetComponent <CEffect>().PlayerGaugeUp(); break; case "3PGauge": GameObject.Find("Player3").transform.FindChild("player").transform.GetComponent <CPlayer3> ().m_playerSE.PlaySE("charge_finish"); GameObject.Find("Player3").transform.FindChild("player").transform.FindChild("PlayerEffect").transform.GetComponent <CEffect>().PlayerGaugeUp(); break; case "4PGauge": GameObject.Find("Player4").transform.FindChild("player").transform.GetComponent <CPlayer4> ().m_playerSE.PlaySE("charge_finish"); GameObject.Find("Player4").transform.FindChild("player").transform.FindChild("PlayerEffect").transform.GetComponent <CEffect>().PlayerGaugeUp(); break; } } m_gaugeLevel = level; if (m_gaugeLevel == 0) { m_sprite.spriteName = "gage_00"; } else if (m_gaugeLevel == 1) { m_sprite.spriteName = "gage_01"; } else if (m_gaugeLevel == 2) { m_sprite.spriteName = "gage_02"; } else if (m_gaugeLevel == 3) { m_sprite.spriteName = "gage_03"; } } if (m_gaugeLevel == 0) { upScale = CGaugeManager.m_level1GaugeScaleUp; } else if (m_gaugeLevel == 1) { upScale = CGaugeManager.m_level2GaugeScaleUp; gauge -= CGaugeManager.m_levelBorder1; } else if (m_gaugeLevel == 2) { upScale = CGaugeManager.m_level3GaugeScaleUp; gauge -= CGaugeManager.m_levelBorder2; } else if (m_gaugeLevel == 3) { upScale = 1; gauge = 160.0f; } this.transform.localScale = new Vector3(upScale * gauge, 20.0f, 0.0f); }