void Start() { combiManager = gameManager.GetComponent <CombiManager>(); VSHandler = gameManager.GetComponent <VSCombinationHandler>(); //if (main) //{ // GetComponent<RectTransform>().sizeDelta = new Vector2(Screen.width / combiManager.Size, Screen.width / combiManager.Size); // Position.x = Screen.width / combiManager.Size * pos - Screen.width / 2; // Position.y = 0 - (Screen.width / combiManager.Size) / 2; //} //if (player1) //{ // GetComponent<RectTransform>().sizeDelta = new Vector2(Screen.width / combiManager.Size / 2, Screen.width / combiManager.Size / 2); // Position.x = Screen.width / combiManager.Size * pos - Screen.width / 2 + (Screen.width / combiManager.Size / 4); // Position.y = 0 - (Screen.width / combiManager.Size); //} //if (player2) //{ // GetComponent<RectTransform>().sizeDelta = new Vector2(Screen.width / combiManager.Size / 2, Screen.width / combiManager.Size / 2); // Position.x = Screen.width / combiManager.Size * (combiManager.Size - 1 - pos) - Screen.width / 2 + (Screen.width / combiManager.Size / 4); // Position.y = 0 + (Screen.width / combiManager.Size) / 2; //} //GetComponent<RectTransform>().localPosition = Position; }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } startTime = Time.time; Combinations = GetComponent <VSCombinationHandler>(); combination = GetComponent <CombiManager>(); player_1_life = Life; player_2_life = Life; }
void Start() { combiManager = gameManager.GetComponent <CombiManager>(); GetComponent <RectTransform>().sizeDelta = new Vector2((Screen.width / 2) / combiManager.Size, (Screen.width / 2) / combiManager.Size); Position.x = Screen.width / combiManager.Size * pos - Screen.width / 2; Position.y = 0 - (Screen.width / 2) / combiManager.Size / 2; if (top) { Position.x = Screen.width / combiManager.Size * pos - Screen.width / 4; Position.y = Screen.height - Screen.height / 2; } if (bottom) { Position.x = Screen.width / combiManager.Size * pos - Screen.width / 2; Position.y = 0 - (Screen.width / combiManager.Size) / 2; } GetComponent <RectTransform>().localPosition = Position; }