public void RefreshUiWidth() { UiWidth = ViewRect.rect.width; float Ratio = UiWidth / 500f; TimingText.GetComponent <RectTransform>().anchoredPosition = new Vector2(10 * Ratio, 0); TimingText.GetComponent <RectTransform>().sizeDelta = new Vector2(160 * Ratio, 30); SpeedText.GetComponent <RectTransform>().anchoredPosition = new Vector2(200 * Ratio, 0); SpeedText.GetComponent <RectTransform>().sizeDelta = new Vector2(160 * Ratio, 30); }
void Start() { Instance = this; scoreText = ScoreText.GetComponent <Text>(); speedText = SpeedText.GetComponent <Text>(); Instantiate(playerPrefab, transform.position + Vector3.up, transform.rotation, transform); SpawnGround(groundForwardPrefab, this.transform); for (int i = 1; i < grounds.Length - 1; i++) { SpawnGround(GetRandomGround(), grounds[groundIndex].NextGround); } }
void ReleaseDesignerOutlets() { if (GameModeLabel != null) { GameModeLabel.Dispose(); GameModeLabel = null; } if (BGBox != null) { BGBox.Dispose(); BGBox = null; } if (TextArea != null) { TextArea.Dispose(); TextArea = null; } if (VerticalLine != null) { VerticalLine.Dispose(); VerticalLine = null; } if (HorizontalLine != null) { HorizontalLine.Dispose(); HorizontalLine = null; } if (AccuracyText != null) { AccuracyText.Dispose(); AccuracyText = null; } if (SpeedText != null) { SpeedText.Dispose(); SpeedText = null; } if (DurationText != null) { DurationText.Dispose(); DurationText = null; } if (AccuracyNum != null) { AccuracyNum.Dispose(); AccuracyNum = null; } if (SpeedNum != null) { SpeedNum.Dispose(); SpeedNum = null; } if (DurationNum != null) { DurationNum.Dispose(); DurationNum = null; } if (BGBoxWhite != null) { BGBoxWhite.Dispose(); BGBoxWhite = null; } if (InputBox != null) { InputBox.Dispose(); InputBox = null; } }