예제 #1
0
    //--------------------------------------------------------------------------------------------
    //
    //--------------------------------------------------------------------------------------------
    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);
    }
예제 #2
0
    //--------------------------------------------------------------------------------------------
    //
    //--------------------------------------------------------------------------------------------
    public void RemoveAssetByUnityObject(dfUnityObject uniObj)
    {
        List <dfUnityObject> lstObj;

        if (_assetListDictionary.TryGetValue(uniObj._name, out lstObj))
        {
            lstObj.Remove(uniObj);
        }
    }
예제 #3
0
    //--------------------------------------------------------------------------------------------
    //
    //--------------------------------------------------------------------------------------------
    public void SetActiveByGameObject(GameObject obj, bool isActive)
    {
        dfUnityObject dfUnityObj = obj.GetComponent <dfUnityObject>();

        if (dfUnityObj == null)
        {
            return;
        }

        SetActiveByUnityObject(dfUnityObj, isActive);
    }
예제 #4
0
    //--------------------------------------------------------------------------------------------
    //
    //--------------------------------------------------------------------------------------------
    public void RemoveAssetByGameObject(GameObject obj)
    {
        dfUnityObject dfUnityObj = obj.GetComponent <dfUnityObject>();

        if (dfUnityObj == null)
        {
            return;
        }

        RemoveAssetByUnityObject(dfUnityObj);
    }
예제 #5
0
    //--------------------------------------------------------------------------------------------
    //
    //--------------------------------------------------------------------------------------------
    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);
            }
        }
    }
예제 #6
0
    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);
    }
예제 #7
0
    //--------------------------------------------------------------------------------------------
    //
    //--------------------------------------------------------------------------------------------
    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);
        }
    }
예제 #8
0
    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);
    }
예제 #9
0
 public dfObject(dfUnityObject dfObj, string name)
 {
     _dfUnityObject = dfObj;
     _name          = name;
 }
예제 #10
0
 public dfMonster(dfUnityObject dfObj, string name) : base(dfObj, name)
 {
 }
예제 #11
0
 public dfCharacter(dfUnityObject dfObj, string name) : base(dfObj, name)
 {
 }
예제 #12
0
 public dfItem(dfUnityObject dfObj, string name) : base(dfObj, name)
 {
 }