bool CreateCurrentInstanceEffect(GameObject gameObj) { NgUtil.LogDevelop("CreateCurrentInstanceEffect() - gameObj - " + gameObj); GameObject parentObj = GetInstanceRoot(); // 이전거 삭제 NgObject.RemoveAllChildObject(parentObj, true); // 새로 생성 if (gameObj != null) { GameObject createObj = (GameObject)Instantiate(gameObj); NsEffectManager.PreloadResource(createObj); createObj.transform.parent = parentObj.transform; m_InstanceEffectObject = createObj; #if (UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_4_9) NgObject.SetActiveRecursively(createObj, true); #endif m_FXMakerControls.SetStartTime(); return(true); } m_InstanceEffectObject = null; return(false); }
public GameObject ClearCurrentEffectObject(GameObject effectRoot, bool bClearEventObject) { if (m_bApplicationQuit) { return(null); } if (bClearEventObject) { GameObject parentObj = GetInstanceRoot(); if (parentObj != null) { NgObject.RemoveAllChildObject(parentObj, true); } } NgObject.RemoveAllChildObject(effectRoot, true); if (m_OriginalEffectObject != null) { DestroyImmediate(m_OriginalEffectObject); } CreateCurrentInstanceEffect(null); if (GetFXMakerHierarchy() != null) { GetFXMakerHierarchy().ShowHierarchy(null); } GameObject backPrefab = m_OriginalEffectPrefab; m_OriginalEffectPrefab = null; return(backPrefab); }
public void ClearCurrentEffectObject(GameObject effectRoot, bool bClearEventObject) { if (bClearEventObject) { GameObject instanceRoot = this.GetInstanceRoot(); if (instanceRoot != null) { NgObject.RemoveAllChildObject(instanceRoot, true); } } NgObject.RemoveAllChildObject(effectRoot, true); this.m_OriginalEffectObject = null; this.CreateCurrentInstanceEffect(null); }
// Control Function ----------------------------------------------------------------- void InitCloneObject() { // Debug.Log("Duration.InitCloneObject"); if (m_ClonObject == null) { // clone ---------------- m_ClonObject = (GameObject)CreateGameObject(gameObject); // Cancel ActiveControl HideNcDelayActive(m_ClonObject); // Remove Dup NcDuplicator durCom = m_ClonObject.GetComponent <NcDuplicator>(); if (durCom != null) { DestroyImmediate(durCom); } // Remove NcDelayActive NcDelayActive delCom = m_ClonObject.GetComponent <NcDelayActive>(); if (delCom != null) { DestroyImmediate(delCom); } // this ---------------- // remove OtherComponent Component[] coms = transform.GetComponents <Component>(); for (int n = 0; n < coms.Length; n++) { if ((coms[n] is Transform) == false && (coms[n] is NcDuplicator) == false) { Destroy(coms[n]); } } // removeChild #if (UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_4_9) NgObject.RemoveAllChildObject(gameObject, false); #else NgObject.RemoveAllChildObject(gameObject, true); #endif } else { return; } }
public void ClearCurrentEffectObject(GameObject effectRoot, bool bClearEventObject) { if (bClearEventObject) { GameObject parentObj = GetInstanceRoot(); if (parentObj != null) { NgObject.RemoveAllChildObject(parentObj, true); } } NgObject.RemoveAllChildObject(effectRoot, true); m_OriginalEffectObject = null; CreateCurrentInstanceEffect(null); }
private bool CreateCurrentInstanceEffect(GameObject gameObj) { NgUtil.LogDevelop("CreateCurrentInstanceEffect() - gameObj - " + gameObj); GameObject instanceRoot = this.GetInstanceRoot(); NgObject.RemoveAllChildObject(instanceRoot, true); if (gameObj != null) { GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(gameObj); NcEffectBehaviour.PreloadTexture(gameObject); gameObject.transform.parent = instanceRoot.transform; this.m_InstanceEffectObject = gameObject; NgObject.SetActiveRecursively(gameObject, true); this.m_FXMakerControls.SetStartTime(); return(true); } this.m_InstanceEffectObject = null; return(false); }
// 특정폴더의 prefab을 로드해서 target 밑으로 생성한다. public static void LoadPrefabList(string strPrefabDir, GameObject targetObject) { #if UNITY_WEBPLAYER Debug.LogError("In WEB_PLAYER mode, you cannot run the FXMaker."); Debug.Break(); return; #else if (strPrefabDir[strPrefabDir.Length - 1] != '/' && strPrefabDir[strPrefabDir.Length - 1] != '\\') { strPrefabDir = strPrefabDir + "/"; } // load Current Group DirectoryInfo dir = new DirectoryInfo(strPrefabDir); // CheckDir if (dir.Exists == false) { Debug.LogError("Directory not found - " + strPrefabDir); } FileInfo[] info = dir.GetFiles(); NgUtil.LogDevelop("BuildPrefabList() - LoadDir - " + strPrefabDir); // Object[] objs = AssetDatabase.LoadAllAssetsAtPath(loaddir); // 기존것 모두 삭제 NgObject.RemoveAllChildObject(targetObject, true); // 선택된 그룹폴더 asset 로드 (project to Hierarchy) foreach (FileInfo fileInfo in info) { NgUtil.LogDevelop("BuildPrefabList() - FindFile - " + fileInfo.Name); GameObject prefab = (GameObject)AssetDatabase.LoadAssetAtPath(strPrefabDir + fileInfo.Name, typeof(GameObject)); NgUtil.LogDevelop("BuildPrefabList() - " + prefab.name); GameObject obj = NgObject.CreateGameObject(targetObject, prefab); NgObject.SetActiveRecursively(obj, false); } #endif }
bool CreateCurrentInstanceEffect(GameObject gameObj) { NgUtil.LogDevelop("CreateCurrentInstanceEffect() - gameObj - " + gameObj); GameObject parentObj = GetInstanceRoot(); m_bFrameCreateInstance = true; // 이전거 삭제 NgObject.RemoveAllChildObject(parentObj, true); // 순환 참조 prefab 검사 NcEffectBehaviour.PreloadTexture(gameObj); // 새로 생성 if (gameObj != null) { GameObject createObj = (GameObject)Instantiate(gameObj); createObj.transform.parent = parentObj.transform; FxmInfoIndexing.CreateInstanceIndexing(gameObj.transform, createObj.transform, false, false); m_InstanceEffectObject = createObj; RemoveInvaildComponent(createObj); // Grayscale GetFXMakerHierarchy().OnCreateInstanceEffect(m_InstanceEffectObject, true, null); #if (UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_4_9) NgObject.SetActiveRecursively(createObj, true); #endif m_FXMakerControls.SetStartTime(); return(true); } m_InstanceEffectObject = null; return(false); }
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(); } }
bool CreateCurrentInstanceEffect(GameObject gameObj) { NgUtil.LogDevelop("CreateCurrentInstanceEffect() - gameObj - " + gameObj); GameObject parentObj = GetInstanceRoot(); // 이전거 삭제 NgObject.RemoveAllChildObject(parentObj, true); // 새로 생성 if (gameObj != null) { GameObject createObj = (GameObject)Instantiate(gameObj); NcEffectBehaviour.PreloadTexture(createObj); createObj.transform.parent = parentObj.transform; m_InstanceEffectObject = createObj; m_FXMakerControls.SetStartTime(); return(true); } m_InstanceEffectObject = null; return(false); }