Hi,
I need help with my script, so it reads the changes to the text position when the specified levels are loaded. Right now it does not apply any changes at all.
Here is my script:
using UnityEngine;
using System.Collections;
public class Score : MonoBehaviour {
public static int score = 0;
void Start () {
guiText.text = " " + score.ToString();
guiText.material.color = Color.black;
guiText.alignment = TextAlignment.Left;
guiText.anchor = TextAnchor.UpperRight;
guiText.transform.position = new Vector3(0.85f,0.1f,5.181322f);
}
void OnLevelWasLoaded(int level) {
if (level == 8 || level == 503 || level == 504 || level == 505) {
GameObject.Find ("Score").guiText.text = " " + score.ToString();
guiText.material.color = Color.black;
guiText.alignment = TextAlignment.Left;
guiText.anchor = TextAnchor.UpperRight;
guiText.transform.position = new Vector3(1.85f,1.1f,5.181322f);
}
}
}
Any assistance is greatly appreciated.
Thanks.