private void SetUpViews() { UIOverViewGO = new GameObject(); UIOverViewGO = UIOverView.AddUIOverViewCompnent(UIOverViewGO, GameManager, Canvas); UIOverView = UIOverViewGO.GetComponent <UIOverView>(); UICityViewGO = new GameObject(); UICityViewGO = UICityView.AddUICityViewCompnent(UICityViewGO, GameManager, Canvas); UICityView = UICityViewGO.GetComponent <UICityView>(); UITurnViewGO = new GameObject(); UITurnViewGO = UITurnView.AddUITurnViewCompnent(UITurnViewGO, GameManager, Canvas); }
public static GameObject AddUITurnViewCompnent(GameObject objectAddingUITrunViewTo, GameManager gameManager, GameObject canvas) { objectAddingUITrunViewTo.SetActive(false); UITurnView uiOverView = objectAddingUITrunViewTo.AddComponent <UITurnView>() as UITurnView; uiOverView.GameManager = gameManager; uiOverView.Canvas = canvas; objectAddingUITrunViewTo.SetActive(true); return(objectAddingUITrunViewTo); }