void ListenGameOver() { if (resultBoard != null) { Debug.LogWarning("Result board is existing already. Why?"); Destroy(resultBoard); } if (m_Def.resultBoardPrf != null) { var _obj = (GameObject)Instantiate(m_Def.resultBoardPrf, m_Def.resultBoardPosition, Quaternion.identity); resultBoard = _obj.GetComponent <HUDResultBoard>(); TransformHelper.SetParentLocal(resultBoard.gameObject, m_Def.hudRoot.gameObject); } }
public void Purge() { if (chatscreen != null) { Destroy(chatscreen); chatscreen = null; } if (scoreBoard != null) { Destroy(scoreBoard); scoreBoard = null; } if (resultBoard != null) { Destroy(resultBoard); resultBoard = null; } }
void ListenGameOver() { if (resultBoard != null) { Debug.LogWarning("Result board is existing alreay. Why?"); GameObject.Destroy(resultBoard); } if (resultBoardPrf != null) { var _obj = GameObject.Instantiate(resultBoardPrf, Vector3.zero, Quaternion.identity) as GameObject; resultBoard = _obj.GetComponent <HUDResultBoard>(); GameObject _parent = null; if (resultBoardParent != null) { _parent = resultBoardParent; } else { if (hudLayer == null) { Debug.Log("No hud layer exist!"); } else { _parent = hudLayer.gameObject; } } if (_parent != null) { var _scale = _obj.transform.localScale; _obj.transform.parent = _parent.transform; _obj.transform.localPosition = Vector3.zero; _obj.transform.localScale = _scale; } } }
void ListenGameOver() { if (resultBoard != null) { Debug.LogWarning("Result board is existing already. Why?"); Destroy(resultBoard); } if (m_Def.resultBoardPrf != null) { var _obj = (GameObject) Instantiate(m_Def.resultBoardPrf, m_Def.resultBoardPosition, Quaternion.identity); resultBoard = _obj.GetComponent<HUDResultBoard>(); TransformHelper.SetParentLocal(resultBoard.gameObject, m_Def.hudRoot.gameObject); } }
void ListenGameOver() { if (resultBoard != null) { Debug.LogWarning("Result board is existing alreay. Why?"); GameObject.Destroy(resultBoard); } if (resultBoardPrf != null) { var _obj = GameObject.Instantiate(resultBoardPrf, Vector3.zero, Quaternion.identity) as GameObject; resultBoard = _obj.GetComponent<HUDResultBoard>(); GameObject _parent = null; if (resultBoardParent != null) { _parent = resultBoardParent; } else { if (hudLayer == null) { Debug.Log("No hud layer exist!"); } else { _parent = hudLayer.gameObject; } } if (_parent != null) { var _scale = _obj.transform.localScale; _obj.transform.parent = _parent.transform; _obj.transform.localPosition = Vector3.zero; _obj.transform.localScale = _scale; } } }