// Use this for initialization void Awake() { myLabel = GetComponent <TextMesh>(); JSFGameManager gm = JSFUtils.gm; myLabel.text = "123456"; Bounds bounds = JSFUtils.findObjectBounds(gameObject); // simulate 6 chars spacing showSize = new Vector3(Mathf.Clamp(gm.size / bounds.size.x, 0.0000001f, float.MaxValue), gm.size / Mathf.Clamp(bounds.size.x, 0.0000001f, float.MaxValue), gm.size / Mathf.Clamp(bounds.size.z, 0.0000001f, float.MaxValue)); transform.localScale = hideSize; // initially hidden }
public JSFBoard(JSFGameManager gameManager, int[] boardPosition, Vector3 pos) { gm = gameManager; arrayRef = boardPosition; // to help it remember it's position in the array localPos = pos; position = gm.transform.TransformPoint(pos); // scoreHUD display setup if (JSFUtils.vm.scoreHUD != null) { GameObject scoreHUDObj = (GameObject)Object.Instantiate(JSFUtils.vm.scoreHUD); scoreHUDObj.transform.parent = gm.gameObject.transform; scoreHUDObj.transform.position = position; scoreHUD = scoreHUDObj.GetComponent <JSFHUDPopUp>(); if (scoreHUD == null) { Debug.Log("scoreHUD 'HUDPopUp' script missing from prefab~!!"); // tell developers the problem } } else { Debug.Log("No scoreHUD prefab detected..."); // tell developers the problem } }