public GameObject GenerateEffect(EffectIndexName effect, Vector3 position) { int index = (int)effect; if (index < 0 || (int)index >= effectFiles.Length) { Debug.LogError("GenerateEffect : out of range! index = " + index); return(null); } string filePath = effectFiles[index].filePath; //해당 filePath로 EffectCacheSystem에서 캐시를 가져옴 GameObject go = SystemManager.Instance.GetCurrentSceneMain <InGameSceneMain>().EffectCacheSystem.Archive(filePath); if (!go) //생성 실패 { Debug.LogError("GenerateEffect error!"); return(null); } go.transform.position = position; AutoCachableEffect autoCachableEffect = go.GetComponent <AutoCachableEffect>(); autoCachableEffect.FilePath = filePath; return(go); }
public bool RemoveEffect(AutoCachableEffect effect) { SystemManager .Instance .GetCurrentSceneMain <InGameSceneMain>() .EffectCacheSystem .Restore(effect.FilePath, effect.gameObject); return(true); }
public GameObject GenerateEffect(int index, Vector3 position) { if (index < 0 || index >= effectFiles.Length) { Debug.LogError("GenerateEffect error! out of range! index = " + index); return(null); } string filePath = effectFiles[index].filePath; GameObject go = SystemManager.Instance.GetCurrentSceneMain <InGameSceneMain>().EffectCacheSystem.Archive(filePath, position); AutoCachableEffect effect = go.GetComponent <AutoCachableEffect>(); effect.FilePath = filePath; return(go); }
public GameObject GenerateEffect(int index, Vector3 position) { if (index < 0 || index >= effectFiles.Length) { Debug.LogError("GenerateEffect error! out of range! index = " + index); return(null); } // // Quaternion.identity : 회전하지 않은 // GameObject go = Instantiate<GameObject>(effectPreFabs[index], position, Quaternion.identity); string filePath = effectFiles[index].filePath; GameObject go = SystemManager.Instance.GetCurrentSceneMain <InGameSceneMain>().EffectCacheSystem.Archive(filePath, position); // go.transform.position = position; AutoCachableEffect effect = go.GetComponent <AutoCachableEffect>(); effect.FilePath = filePath; return(go); }