thrownewException("Panel could not be opened - can't find global GUI object!!");
GameObjectuiPanelTemplate=GetTemplatePanel();
DynamicPanel=GameObject.Instantiate(uiPanelTemplate,uiPanelTemplate.transform.position,Quaternion.identity,globalGUI.transform);// 4'th arg allow set object as child
DynamicPanel.transform.localPosition=uiPanelTemplate.transform.position;// prevent overwritten position by... environment???
DynamicPanel.name=uiPanelTemplate.name;
SetupPanel();
returntrue;
}
publicvirtualboolClosePanel()
{
Console.WriteLine("Panel closed");
try
{
Destroy(DynamicPanel);
returntrue;
}
catch(Exceptionex){Debug.LogError(ex.Message);}
returntrue;
}
publicvirtualvoidSetupPanel()
{
if(!DynamicPanel)
thrownewException("Panel not found - UIBaseManager don't have UI Panel instance!!");