void SetCurrentBackgroundInfo(GameObject setPrefab) { // clear current NgObject.RemoveAllChildObject(m_CurrentBackgroundRoot, true); if (m_CurrentBackgroundInfo != null) { DestroyImmediate(m_CurrentBackgroundInfo.gameObject); } if (setPrefab != null) { GameObject obj = NgAsset.LoadPrefab(setPrefab, m_CurrentBackgroundRoot); obj.name = obj.name.Replace("(Clone)", "(Original)"); m_CurrentBackgroundInfo = obj.GetComponent <FxmInfoBackground>(); m_CurrentBackgroundInfo.SetActive(); if (FXMakerMain.inst.IsLoadingProject() == false) { FXMakerAsset.SetPingObject(setPrefab, m_CurrentBackgroundInfo); } FXMakerMain.inst.GetFXMakerMouse().UpdateCamera(); } }
void SetCurrentBackgroundInfo(GameObject setPrefab) { // clear current NgObject.RemoveAllChildObject(m_CurrentBackgroundRoot, true); if (m_CurrentBackgroundInfo != null) DestroyImmediate(m_CurrentBackgroundInfo.gameObject); if (setPrefab != null) { GameObject obj = NgAsset.LoadPrefab(setPrefab, m_CurrentBackgroundRoot); obj.name = obj.name.Replace("(Clone)", "(Original)"); m_CurrentBackgroundInfo = obj.GetComponent<FxmInfoBackground>(); m_CurrentBackgroundInfo.SetActive(); if (FXMakerMain.inst.IsLoadingProject() == false) FXMakerAsset.SetPingObject(setPrefab, m_CurrentBackgroundInfo); FXMakerMain.inst.GetFXMakerMouse().UpdateCamera(); } }