using UnityEngine.UI;
public GameObject pin; public int maxPin; [HideInInspector] public int totalPin; [HideInInspector] public int limitPin; private Text countText; void Awake(){ totalPin = maxPin; } // Use this for initialization void Start () { InitializeSpawnVariables (); } // Update is called once per frame void Update () { } void InitializeSpawnVariables(){ limitPin = 4; }; for (int i = 0; i < limitPin; i++) { if(maxPin != 0){ GameObject newPin = Instantiate (pin, pinPosition [i], Quaternion.identity) as GameObject; if (i == 0) newPin.transform.GetComponent<Pin> ().isPrepareToShoot = true; countText = newPin.transform.GetChild (1).gameObject.transform.GetChild (0).gameObject.GetComponent<Text> (); countText.text = maxPin.ToString (); maxPin--; } } } public void IsPrepareToFire(){ int index = 0; }; GameObject[] nextPin = GameObject.FindGameObjectsWithTag("Pin"); foreach(GameObject newPin in nextPin){ if(!newPin.transform.GetComponent<Pin>().hasMove){ newPin.transform.position = Vector3.Lerp (newPin.transform.position, pinPosition [index], Time.time); if(index == 0){ newPin.transform.GetComponent<Pin> ().isPrepareToShoot = true; } index++; } } if(maxPin != 0){ countText = newPin.transform.GetChild (1).gameObject.transform.GetChild (0).gameObject.GetComponent<Text>(); countText.text = maxPin.ToString (); maxPin--; } }
Score UI
Score Text
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.