public override void OnInspectorGUI() { BonusManager manager = (BonusManager)target; manager.bonusLength = EditorGUILayout.FloatField("Bonus Lenght", manager.bonusLength); ProgressBar(manager.bonusTimer / manager.bonusLength, "BonusTime: " + TimeCover.tostring(manager.bonusTimer)); if (GUILayout.Button("StartBonus")) { ScoreStat.XpBonus(); } EditorGUILayout.Space(); if (GUILayout.Button("ResetScore")) { ScoreStat.Score = 0; ScoreStat.HighScore = 0; } EditorGUILayout.LabelField("Score: " + ScoreStat.Score.ToString()); EditorGUILayout.LabelField("Highscore: " + ScoreStat.HighScore.ToString()); if (GUILayout.Button("AddScore")) { ScoreStat.AddScore(scoreToAdd); } scoreToAdd = EditorGUILayout.IntField("ScoreTo Add", scoreToAdd); EditorGUILayout.Space(); EditorGUILayout.LabelField("ScoreMulti: " + ScoreStat.baseMulti.ToString()); ScoreStat.diff = (ScoreStat.diffLevels)EditorGUILayout.EnumPopup("difficulty level", ScoreStat.diff); if (GUILayout.Button("SetDifficulty")) { ScoreStat.SetDifficulty(); } }
void CreateScoreInfo(Fleet fleet) { GameObject scoreInfoObj = (GameObject)UnityEngine.GameObject.Instantiate(Resources.Load("ScoreInfo")); RectTransform rt = scoreInfoObj.GetComponent <RectTransform> (); rt.SetParent(transform); rt.localScale = Vector3.one; ScoreStat scoreStat = scoreInfoObj.GetComponent <ScoreStat>(); scoreStat.teamColor.color = fleet.team.color; scoreStat.fleetColor.color = fleet.color; scoreStat.fleetName.text = fleet.name; scoreStat.KillCountEnemyShip.text = GetKillEnemyCount(fleet).ToString(); scoreStat.DamagePointEnemyShip.text = GetDamagePointEnemy(fleet).ToString(); scoreStat.KillCountAllyShip.text = GetKillAllyCount(fleet).ToString(); scoreStat.DamagePointAllyShip.text = GetDamagePointAlly(fleet).ToString(); scoreStat.TotalDamagePoint.text = GetDamagePointTotal(fleet).ToString(); RawImage ri = scoreInfoObj.GetComponent <RawImage> (); if (IsGameWin(fleet)) { ri.color = winColor; scoreStat.Result.text = "Win"; } else { ri.color = loseColor; scoreStat.Result.text = "Lose"; } // return teamStat; }
void Start() { instance = this; m_score = 0; }