// Use this for initialization void Start() { ispaused = false; Timer = 0; ScorePanel.SetActive(true); isActive = true; countEnemyScore = 0; countSpider = 0; lifeNum = 5; score = 0; textCurrentScore.enabled = true; switch (LevelController.levelName) { case "BtnZen": levelName = "Zen"; break; case "BtnClassic": levelName = "Classic"; break; case "BtnInsane": levelName = "Insane"; break; case "BtnTimeAttack": levelName = "TimeAttack"; break; default: levelName = "Insane"; break; } spawner = Instantiate(SpawnerObject, SpawnerObject.transform.position, Quaternion.identity); }
/// <summary> /// When the disconnect button is clicked, we return back to the start screen /// You are only allowed to disconnect from a server once /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Disconnect_Click(object sender, EventArgs e) { serverAddr.Visible = true; ServerLabel.Visible = true; NameLabel.Visible = true; nameTextBox.Visible = true; Connect.Visible = true; gamecontroller.Disconnect(); drawingPanel.BackColor = SystemColors.Control; drawingPanel.Visible = false; ClientSize = new Size(625, 200); Connect.Enabled = true; serverAddr.Enabled = true; nameTextBox.Enabled = true; Disconnect.Visible = false; disconnect++; scorePanel.Visible = false; scorePanel = null; Form1 newForm = new Form1(); newForm.Show(); this.Close(); }
public void showGameOverPanel() { if (MainAudioSource.isPlaying && MainAudioSource.clip != bgGameOverClip) { MainAudioSource.Stop(); audioSource.PlayOneShot(gameoverClip); MainAudioSource.clip = bgGameOverClip; MainAudioSource.Play(); } //MainAudioSource.clip = backgroundGameOver; GameOverPanel.SetActive(true); textScoreLast.text = score.ToString(); if (score > highscore) { highscore = score; } textScoreBest.text = highscore.ToString(); PlayerPrefs.SetInt("highscore", highscore); pauseButton.SetActive(false); continueButton.SetActive(false); textCurrentScore.enabled = false; ScorePanel.SetActive(false); }
public NoteEditCMenu(ScorePanel scorePanel, Position clickPosition) { var b = Status.IsCopyAvailable; stripItems = new ToolStripMenuItem[] { new ToolStripMenuItem("切り取り", null, (s, e) => scorePanel.CutNotes()) { Enabled = b }, new ToolStripMenuItem("コピー", null, (s, e) => scorePanel.CopyNotes()) { Enabled = b }, new ToolStripMenuItem("削除", null, (s, e) => scorePanel.ClearAreaNotes()) { Enabled = b }, new ToolStripMenuItem("左右反転", null, (s, e) => scorePanel.ReverseNotes()) { Enabled = b } }; Items.AddRange(stripItems); }
public void TestShowStatisticsAndClickOtherPanel() { TestResultsScreen screen = null; AddStep("load results", () => Child = new TestResultsContainer(screen = createResultsScreen())); AddUntilStep("wait for load", () => this.ChildrenOfType <ScorePanelList>().Single().AllPanelsVisible); ScorePanel expandedPanel = null; ScorePanel contractedPanel = null; AddStep("click expanded panel then contracted panel", () => { expandedPanel = this.ChildrenOfType <ScorePanel>().Single(p => p.State == PanelState.Expanded); InputManager.MoveMouseTo(expandedPanel); InputManager.Click(MouseButton.Left); contractedPanel = this.ChildrenOfType <ScorePanel>().First(p => p.State == PanelState.Contracted && p.ScreenSpaceDrawQuad.TopLeft.X > screen.ScreenSpaceDrawQuad.TopLeft.X); InputManager.MoveMouseTo(contractedPanel); InputManager.Click(MouseButton.Left); }); AddAssert("statistics shown", () => this.ChildrenOfType <StatisticsPanel>().Single().State.Value == Visibility.Visible); AddAssert("contracted panel still contracted", () => contractedPanel.State == PanelState.Contracted); AddAssert("expanded panel still expanded", () => expandedPanel.State == PanelState.Expanded); }
void Awake() { if (Instance == null) { Instance = this; } }
private void Import_Click(object sender, EventArgs e) { ScorePanel selectedPanel = (tabScore.SelectedTab as TabPageEx).ScorePanel; selectedPanel.Import(); UpdateTextOfTabAndForm(false); }
public void SetValues(int id, string name, bool isMainPlayer, Color myColor) { print("Score Panel Checked Values - " + playerid); playerName = name; UpdateId(id); myImage.color = myColor; if (!isMainPlayer) { if (mainPlayer != null) { mainPlayer.GetComponent <RectTransform> ().SetAsLastSibling(); } //GameObject.Find ("PowerUps").GetComponent<RectTransform>().SetAsFirstSibling(); } else { /*gameObject.GetComponent<LayoutElement> ().minHeight = bigSize;*/ gameObject.GetComponent <RectTransform> ().SetAsLastSibling(); //GameObject.Find ("PowerUps").GetComponent<RectTransform>().SetAsFirstSibling(); gameObject.gameObject.name = "Score Panel Main Player"; mainPlayer = this; } Invoke("UpdateGfxAgain", 0.5f); }
void PopulateScores() { int maxRecords; if (PlayerPrefs.HasKey("noOfRecords")) { maxRecords = PlayerPrefs.GetInt("noOfRecords"); for (int i = 0; i <= maxRecords; i++) { GameObject a = Instantiate(childPanel); //GameObject a=Instantiate(childPanel, new Vector3(childPanel.transform.position.x, childPanel.position.y+146, 0), Quaternion.identity); a.transform.SetParent(parentPanel.transform, false); ScorePanel b = childPanel.GetComponent <ScorePanel> (); b.nameT.text = PlayerPrefs.GetString("RecordName" + i.ToString()); b.scoreT.text = PlayerPrefs.GetInt("RecordScore" + i.ToString()).ToString(); if (PlayerPrefs.HasKey("RecordTime" + i.ToString())) { b.dateT.text = PlayerPrefs.GetString("RecordTime" + i.ToString()); } int reason = PlayerPrefs.GetInt("RecordGoReason" + i.ToString()); if (reason == 1) { b.reasonT.text = "Dead"; } else { b.reasonT.text = "Escaped"; } } } }
void Update() { if (countDown <= 0 && stop == false && making == false) { StartCoroutine(SpawnBlock(round)); countDown = timeBetweenWaves; } if (waveStart != GameObject.Find("UserData").GetComponent <PlayerStats>().waveIndex&& stop == true && enemies.Count == 0) { Debug.Log("Cambiando de juego"); //changeScene = true; StartCoroutine(ChangeScene()); } countDown -= Time.deltaTime; countDown = Mathf.Clamp(countDown, 0f, Mathf.Infinity); roundPanel.GetComponent <Text>().text = GameObject.Find("UserData").GetComponent <PlayerStats>().waveIndex.ToString(); healthPanel.GetComponent <Text>().text = PlayerStats.life.ToString(); MoneyPanel.GetComponent <Text>().text = PlayerStats.money.ToString(); ScorePanel.GetComponent <Text>().text = PlayerStats.score.ToString(); }
private void Redo_Click(object sender, EventArgs e) { ScorePanel selectedPanel = (tabScore.SelectedTab as TabPageEx).ScorePanel; selectedPanel.Redo(); selectedPanel.Refresh(); }
public IEnumerator CoroutineFillGlobalRankingScore() { int indexChild = 0; foreach (Transform child in this.GlobalRankingScrollContent.transform) { if (indexChild != 0) { //DO NOT DESTROY THE HEADER Destroy(child.gameObject); } indexChild++; } int position = 1; foreach (ModelScore oneScore in this.globalScores) { GameObject myScore = Instantiate(this.PrefabScore); myScore.transform.SetParent(this.GlobalRankingScrollContent.transform); ScorePanel scorePanel = myScore.GetComponent <ScorePanel>(); scorePanel.score = oneScore.score.ToString(); scorePanel.username = oneScore.name; scorePanel.position = position.ToString(); scorePanel.InitText(); position++; } this.scrollbarGlobalRanking.value = 1; this.loader.SetActive(false); yield return(null); }
private void ScoreTextBox_LostFocus(object sender, EventArgs e) { try { TextBox scoreTextBox = (TextBox)sender; string str = scoreTextBox.Text.Replace(" ", ""); str = str.Replace("\r", ""); str = str.Replace("\n", ""); if (str != "") { ScorePanel scorePanel = (ScorePanel)scoreTextBox.Parent; ExamSubQuestionPanel examSubQuestionPanel = (ExamSubQuestionPanel)scorePanel.Parent; int index = Find_shortCutButton_index(examSubQuestionPanel); int problem_score = int.Parse(examSubQuestionPanel.ExamScorePanel.ScoreTextBox.Text); int score = int.Parse(scoreTextBox.Text); if (score > problem_score) { MessageBox.Show("문제의 최고 점수보다 높게 점수를 부여할 수 없습니다.", "점수 오류", MessageBoxButtons.OK, MessageBoxIcon.Error); examSubQuestionPanel.StudentScorePanel.ScoreTextBox.Text = "0"; return; } setScore(index, false); } } catch (Exception error) { Console.WriteLine(error); } }
public void Init() { _uiManager = Core.Instance.GetService <UIManager>(); Assert.AreNotEqual(null, _uiManager); _eventWindow = _uiManager.GetWindow(UIWindowEnum.EVENT) as EventWindow; _mainScreenStateManager = _uiManager.Get_MainScreenStateManager(); Assert.AreNotEqual(null, _mainScreenStateManager); _playerManager = Core.Instance.GetService <PlayerManager>(); Assert.AreNotEqual(null, _playerManager); _uiAnimatorManager = Core.Instance.GetService <UIAnimatorManager>(); Assert.AreNotEqual(null, _uiAnimatorManager); _audioService = Core.Instance.GetService <AudioService>(); Assert.AreNotEqual(null, _audioService); _header = _uiManager.GetWindow(UIWindowEnum.HEADER) as Header; _scorePanel = _uiManager.GetWindow(UIWindowEnum.SCORE) as ScorePanel; InitEvents(); _scorePanel.FillShop(); }
//MENU BUTTON CODE public void StartGame() { Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; playerObj.transform.position = PlayerInitialPosition; SetCameraParent("Player"); Countdown.StartAnimation(); MainMenuPanel.SetActive(false); ScorePanel.SetActive(true); PulsePanel.SetActive(true); for (int i = 0; i < GameObject.FindGameObjectsWithTag("wall").Length; i++) { Destroy(GameObject.FindGameObjectsWithTag("wall") [i].gameObject); } for (int i = 0; i < GameObject.FindGameObjectsWithTag("Point").Length; i++) { Destroy(GameObject.FindGameObjectsWithTag("Point") [i].gameObject); } SpawnController.SpawnPointSphere(); }
private void New_Click(object sender, EventArgs e) { ScorePanel selectedPanel = (tabScore.SelectedTab as TabPageEx).ScorePanel; if (selectedPanel.IsEdited) { DialogResult dialogResult = MessageBox.Show( "ファイルは変更されています。保存しますか?", "新規作成", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); if (dialogResult == DialogResult.Yes) { selectedPanel.Save(); } else if (dialogResult == DialogResult.No) { SetNewPanel(); } else if (dialogResult == DialogResult.Cancel) { } } else { SetNewPanel(); } }
public void SpawnScorePanel(int s, bool end = false) { var player = FindObjectOfType <PlayerController>(); // Compute distance float distToTravelPanel = startHeight; float timeToTravel = distToTravelPanel / panelsSpeed; // seconds float distToTravelPlayer = timeToTravel * player.speedForce; // Random Z float newZ = player.transform.position.z + zOffset; // Compute initial position Vector3 sharkPos = new Vector3(0f, startHeight, distToTravelPlayer + newZ); // Spawn GameObject prefab = panelPrefab; if (end) { prefab = endPanelPrefab; } GameObject panelObj = GameObject.Instantiate(prefab, sharkPos, Quaternion.identity); ScorePanel panel = panelObj.GetComponent <ScorePanel>(); panel.speed = panelsSpeed; panel.SetScore(s); if (!end) { float a = 15; panelObj.transform.rotation = Quaternion.Euler(Random.Range(-a, a), Random.Range(-a, a), Random.Range(-a, a)); } }
/// <summary> /// Creates the scene. /// </summary> /// <remarks> /// This method is called before all <see cref="T:WaveEngine.Framework.Entity" /> instances in this instance are initialized. /// </remarks> protected override void CreateScene() { var camera2D = new FixedCamera2D("Camera2D") { ClearFlags = ClearFlags.DepthAndStencil }; EntityManager.Add(camera2D); //RenderManager.BackgroundColor = new Color(0 / 255f, 31 / 255f, 39 / 255f); //Backscene this.backScene = WaveServices.ScreenContextManager.FindContextByName("BackContext") .FindScene <BackgroundScene>(); // Side black panels Entity rightBlackpanel = new Entity() .AddComponent(new Transform2D() { DrawOrder = 1f, X = WaveServices.ViewportManager.LeftEdge }) .AddComponent(new ImageControl( Color.Black, (int)-WaveServices.ViewportManager.LeftEdge, (int)WaveServices.ViewportManager.VirtualHeight)) .AddComponent(new ImageControlRenderer(DefaultLayers.GUI)); EntityManager.Add(rightBlackpanel); Entity leftBlackpanel = new Entity() .AddComponent(new Transform2D() { DrawOrder = 1f, X = WaveServices.ViewportManager.VirtualWidth }) .AddComponent(new ImageControl( Color.Black, (int)-WaveServices.ViewportManager.LeftEdge, (int)WaveServices.ViewportManager.VirtualHeight)) .AddComponent(new ImageControlRenderer(DefaultLayers.GUI)); EntityManager.Add(leftBlackpanel); // Squid this.squid = new Squid(WaveServices.ViewportManager.VirtualHeight - 300); EntityManager.Add(this.squid); // Rocks this.blockBuilder = new BlockBuilder(); EntityManager.Add(this.blockBuilder); // ScorePanel this.scorePanel = new ScorePanel(); EntityManager.Add(scorePanel); // Scene Behaviors this.AddSceneBehavior(new DebugSceneBehavior(), SceneBehavior.Order.PostUpdate); }
public PlayerScore() { id = 0; score = 0; material = null; panel = null; scorePanel = null; }
public static ScorePanel Instance(ScorePanel temp = null) { if(temp != null) { instance = temp; } return instance; }
private void FillPlayerList() { GetComponent <Canvas>().enabled = true; foreach (Player player in TurnManager.Instance.players) { ScorePanel panel = Instantiate(panelPrefab, panelGroup.transform) as ScorePanel; panel.Init(player); } }
private void addPanelStep(ScoreInfo score) => AddStep("add panel", () => { Child = new ScorePanel(score) { Anchor = Anchor.Centre, Origin = Anchor.Centre, State = PanelState.Expanded }; });
public void CalculateScores() { string answer = gameState.currentQuestions.CurrentQuestion().answer; int maxDistance = answer.Length; int numPlayers = players.NumPlayers(); int j = 0; Player speakingPlayer = players.CurrentPlayer(); ScorePanel speakingScorePanel = null; int pointsForSpeaker = 0; for (int i = 0; i < numPlayers; i++) { Player player = players.GetPlayerAt(i); int score = 0; ScorePanel newPanel = Instantiate <ScorePanel>(scorePanel, scoreBoardContainer); if (player == speakingPlayer && numPlayers > 1) { speakingScorePanel = newPanel; } else { int playerDistance = round.guesses[j].LevenshteinDistance(answer); float percent = Mathf.Clamp01((1f - (1f * playerDistance / maxDistance))); score = Mathf.RoundToInt(percent * 100); player.score += score; if (score >= 50) { pointsForSpeaker += settings.speakerPointBonus; } j += 1; } newPanel.charImg.sprite = player.character.charSprite; newPanel.playerName.text = player.name; newPanel.scoreThisRound.text = score.ToString(); newPanel.totalScore.text = player.score.ToString(); } if (speakingScorePanel != null) { speakingPlayer.score += pointsForSpeaker; speakingScorePanel.background.color = settings.speakerPanelColor; speakingScorePanel.scoreThisRound.text = pointsForSpeaker.ToString(); speakingScorePanel.totalScore.text = speakingPlayer.score.ToString(); } }
private void Awake() { _instance = this; AddListeners(); var corutine = LateInit(0.01f); StartCoroutine(corutine); }
public void BackToMainMenu() { ScorePanel.SetActive(false); InfoPanel.SetActive(false); WinnerPanel.SetActive(false); PausePanel.SetActive(false); MenuCam.CameraMode = 1; OpenMainMenu(); Main.PrepareBackground(); }
public void getScrollEntrys() { //Destroy Objects that exists, because of a possible Call before foreach (Transform childTransform in ScrollContain.transform) { Destroy(childTransform.gameObject); } int j = 1; for (int i = 0; i < LeaderboardController.Instance.onlineHighscore.Length - 1; i++) { GameObject ScorePanel; ScorePanel = Instantiate(ScrollEntry) as GameObject; ScorePanel.transform.parent = ScrollContain.transform; ScorePanel.transform.localScale = ScrollContain.transform.localScale; Transform ThisScoreName = ScorePanel.transform.Find("ScoreText"); Text ScoreName = ThisScoreName.GetComponent <Text> (); // Transform ThisScorePoints = ScorePanel.transform.Find("ScorePoints"); Text ScorePoints = ThisScorePoints.GetComponent <Text> (); // Transform ThisScorePosition = ScorePanel.transform.Find("ScorePosition"); Text ScorePosition = ThisScorePosition.GetComponent <Text> (); //first position is green if (j == 1) { ScorePanel.GetComponent <Image> ().color = new Color32(0xFF, 0xFF, 0xFF, 0xE0); Color32 c = new Color32(0x4C, 0x47, 0x47, 0xFF); ScoreName.color = c; ScorePoints.color = c; ScorePosition.color = c; } ScorePosition.text = j + ". "; string helpString = ""; helpString = helpString + LeaderboardController.Instance.onlineHighscore [i] + " "; i++; ScoreName.text = helpString; // ScorePoints.text = LeaderboardController.Instance.onlineHighscore [i]; if (LeaderboardController.Instance.onlineHighscore [i] == "9999") { ScoreName.color = Color.red; ScorePoints.color = Color.red; ScorePosition.color = Color.red; yourPosition = j; } j++; } }
private void StudentFunctionForm_Load(object sender, EventArgs e) { ViewHelper.MdiChildrenAutoSize(this); this.Dock = DockStyle.Fill; CommonPanel.Show(); paperPanel.Hide(); ScorePanel.Hide(); ////创建一个答题对话框的实例 //dialog = new AnswerDialog(); //dialog.Owner = this; }
// Use this for initialization void Start() { rankPanel = data.GetComponentInChildren <RankPanel>(); namePanel = data.GetComponentInChildren <NamePanel>(); scorePanel = data.GetComponentInChildren <ScorePanel>(); GameControl.instance.Leaderboardfilter = 1; updateTitleHeaderFields(); LoadTopScores(); }
public void SetControls() { Font = new Font(ScoreTracker.config["font"], Int32.Parse(ScoreTracker.config["font_size"]), FontStyle.Bold); BackColor = ScoreTracker.colors["background_color"]; topScoreName.ForeColor = ScoreTracker.colors["text_color_total"]; sobScoreName.ForeColor = ScoreTracker.colors["text_color_total"]; topScore.ForeColor = ScoreTracker.colors["text_color_total"]; sobScore.ForeColor = ScoreTracker.colors["text_color_total"]; totals.Controls.Clear(); levels.Controls.Clear(); panels.Clear(); Controls.Clear(); TrackerData run = ScoreTracker.Data; try { foreach (ScoreEntry entry in run.GetScoreSet()) { ScorePanel newScore = new ScorePanel(entry); levels.Controls.Add(newScore); panels.Add(newScore); } if (ScoreTracker.config["layout"] == "1") { totals.Controls.Add(currentScoreName); } totals.Controls.Add(currentScore); totals.Controls.Add(topScoreName); totals.Controls.Add(topScore); totals.Controls.Add(sobScoreName); totals.Controls.Add(sobScore); if (ScoreTracker.config["sums_horizontal_alignment"] == "1" && ScoreTracker.config["layout"] == "0") { Controls.Add(totals); Controls.Add(levels); } else { Controls.Add(levels); Controls.Add(totals); } UpdateScores(); } catch (Exception e) { Console.WriteLine("Error: " + e.Message); } DoLayout(); }
public void UpdateScoreBoard() { GameObject spawnedScorePanelPrefab = Instantiate(scorePanelPrefab, sectionScoreBoardPanelParent.transform); ScorePanel instantiatedScorePanelScript = spawnedScorePanelPrefab.GetComponent <ScorePanel>(); instantiatedScorePanelScript.scorePanelText.text = theStationManager.currentStation.stationScriptableObject.stationName + " - " + theStationManager.nextStation.stationScriptableObject.stationName + " SCORE: " + theScoreManager.currentSectionScore; GameObject spawnedScorePanelPrefab_2 = Instantiate(scorePanelPrefab, finalScoreBoardPanelParent.transform); ScorePanel instantiatedScorePanelScript_2 = spawnedScorePanelPrefab_2.GetComponent <ScorePanel>(); instantiatedScorePanelScript_2.scorePanelText.text = theStationManager.currentStation.stationScriptableObject.stationName + " - " + theStationManager.nextStation.stationScriptableObject.stationName + " SCORE: " + theScoreManager.currentSectionScore; }
private void Open_Click(object sender, EventArgs e) { //現在開かれているタブを判別してそれにたいしてロードするようにする ScorePanel selectedPanel = (tabScore.SelectedTab as TabPageEx).ScorePanel; if (selectedPanel.Load()) { UpdateTextOfTabAndForm(false); tabScore.SelectedTab.Controls[0].Refresh(); } return; }
private void Awake() { scorePanel = GetComponent<ScorePanel>(); }
private void Awake() { instance = this; //HideScorePanel(); posToChangePag = quantToSlideScores; }