void CreateOpenGameButton(int gameId)
{
GameObject g = null;
GameObject randomOpponentButton = GameObject.Find("Button_RandomOpponent");
Vector3 gPos
= new Vector3
(randomOpponentButton
.transform.localPosition.x,
randomOpponentButton.transform.localPosition.y,
randomOpponentButton.transform.localPosition.z);
GameObject draggablePanel = GameObject.Find("Child");
GameObject newButton = NGUITools.AddChild(draggablePanel, mButtonPrefab);
newButton.GetComponent<RejoinGameButton>().setMultiplayerRef(this);
newButton.GetComponent<RejoinGameButton>().setGameId(gamePlanId);
newButton.name ="Button_ResumeGame_"+ gamePlanId.ToString();
newButton
.transform.localScale = new Vector3
(0
.5f, 0
.5f,
0);
mRejoinButtons.Add(newButton);
if (mRejoinButtons.Count > 1)
{
g = mRejoinButtons[mRejoinButtons.Count -2]; //reference to the penultimate button
gPos.x = g.transform.localPosition.x;
gPos.y = g.transform.localPosition.y;
gPos.z = g.transform.localPosition.z;
}
newButton
.transform.localPosition = new Vector3
(gPos
.x, gPos
.y -70, gPos
.z)
}