void BoxPosition(GameObject bx, GameObject txt, GameObject desti, int d) { boxPos = (GameObject)Instantiate(bx, new Vector3(d + Screen.width / 415 * -1, Screen.height / 203 * -1.2f, 0), Quaternion.identity); Vector3 screenPos = Camera.main.WorldToScreenPoint(boxPos.transform.position); txt.GetComponent <GUIText>().pixelOffset = new Vector2(screenPos.x - 28, screenPos.y + 0.059f * Screen.height); GameObject des = (GameObject)Instantiate(desti, new Vector3(d + Screen.width / 415 * -1, Screen.height / 203 * -1.2f, 0), Quaternion.identity); select = gameObject.GetComponent <SelectScript>(); select.dest = des; }
// Use this for initialization void Start() { self = this; }