//-------------------------------------------------------------------------------------------- // //-------------------------------------------------------------------------------------------- public dfUnityObject PushAsset(string name, GameObject obj, bool isOnly, bool isActive) { if (isOnly) { dfUnityObject[] uniObj = FindAsset(name); if ((uniObj != null) && (uniObj.Length > 0)) { return(uniObj[0]); } } GameObject unityObj = GameObject.Instantiate(obj, Vector3.zero, Quaternion.identity) as GameObject; dfUnityObject dfUnityObj = unityObj.GetComponent <dfUnityObject>(); if (dfUnityObj == null) { dfUnityObj._name = name; unityObj.AddComponent <dfUnityObject>(); } AddAsset(name, dfUnityObj, isOnly); dfUnityObj.SetActive(isActive); return(dfUnityObj); }
//-------------------------------------------------------------------------------------------- // //-------------------------------------------------------------------------------------------- public void RemoveAssetByUnityObject(dfUnityObject uniObj) { List <dfUnityObject> lstObj; if (_assetListDictionary.TryGetValue(uniObj._name, out lstObj)) { lstObj.Remove(uniObj); } }
//-------------------------------------------------------------------------------------------- // //-------------------------------------------------------------------------------------------- public void SetActiveByGameObject(GameObject obj, bool isActive) { dfUnityObject dfUnityObj = obj.GetComponent <dfUnityObject>(); if (dfUnityObj == null) { return; } SetActiveByUnityObject(dfUnityObj, isActive); }
//-------------------------------------------------------------------------------------------- // //-------------------------------------------------------------------------------------------- public void RemoveAssetByGameObject(GameObject obj) { dfUnityObject dfUnityObj = obj.GetComponent <dfUnityObject>(); if (dfUnityObj == null) { return; } RemoveAssetByUnityObject(dfUnityObj); }
//-------------------------------------------------------------------------------------------- // //-------------------------------------------------------------------------------------------- public void SetActiveByUnityObject(dfUnityObject uniObj, bool isActive) { List <dfUnityObject> lstObj; if (_assetListDictionary.TryGetValue(uniObj._name, out lstObj)) { foreach (dfUnityObject obj in lstObj) { obj.SetActive(isActive); } } }
public dfCharacter GetCharacterProperty(string name, dfUnityObject obj) { dfCharacter value; if (_characterDictionary.TryGetValue(name, out value)) { return(value); } value = new dfCharacter(obj, obj.name); _characterDictionary.Add(name, value); return(value); }
//-------------------------------------------------------------------------------------------- // //-------------------------------------------------------------------------------------------- protected void AddAsset(string name, dfUnityObject obj, bool isOnly) { List <dfUnityObject> lstObj; if (_assetListDictionary.TryGetValue(name, out lstObj) == false) { lstObj = new List <dfUnityObject>(); _assetListDictionary.Add(name, lstObj); } if (isOnly == false) { lstObj.Add(obj); } }
public dfMonster GetMonsterProperty(string name, dfUnityObject obj) { dfCharacter value; if (_characterDictionary.TryGetValue(name, out value)) { //출력 - 중복된 오브젝트 이름이 있습니다. return((dfMonster)value); } value = new dfMonster(obj, obj.name); _characterDictionary.Add(name, value); return((dfMonster)value); }
public dfObject(dfUnityObject dfObj, string name) { _dfUnityObject = dfObj; _name = name; }
public dfMonster(dfUnityObject dfObj, string name) : base(dfObj, name) { }
public dfCharacter(dfUnityObject dfObj, string name) : base(dfObj, name) { }
public dfItem(dfUnityObject dfObj, string name) : base(dfObj, name) { }