public static EditorCollectibleList LoadCollectible()
    {
        GameObject obj=Resources.Load("PrefabList/CollectibleListPrefab", typeof(GameObject)) as GameObject;
        if(obj==null) obj=CreatePrefab();

        CollectibleListPrefab prefab=obj.GetComponent<CollectibleListPrefab>();
        if(prefab==null) prefab=obj.AddComponent<CollectibleListPrefab>();

        for(int i=0; i<prefab.collectibleList.Count; i++){
            if(prefab.collectibleList[i]==null){
                prefab.collectibleList.RemoveAt(i);
                i-=1;
            }
        }

        string[] nameList=new string[prefab.collectibleList.Count];
        for(int i=0; i<prefab.collectibleList.Count; i++){
            if(prefab.collectibleList[i]!=null){
                nameList[i]=prefab.collectibleList[i].collectibleName;
            }
        }

        EditorCollectibleList eCollectibleList=new EditorCollectibleList();
        eCollectibleList.prefab=prefab;
        eCollectibleList.nameList=nameList;

        return eCollectibleList;
    }
Exemplo n.º 2
0
    void LoadCollectible()
    {
        EditorCollectibleList eCollectibleList = CollectibleManagerWindow.LoadCollectible();
        CollectibleListPrefab prefab           = eCollectibleList.prefab;

        //~ CollectibleListPrefab prefab=CollectibleManagerWindow.LoadCollectible();

        collectibleList     = new List <CollectibleTB>();
        collectibleNameList = new string[prefab.collectibleList.Count];

        for (int i = 0; i < prefab.collectibleList.Count; i++)
        {
            collectibleList.Add(prefab.collectibleList[i]);
            collectibleNameList[i] = prefab.collectibleList[i].collectibleName;
        }
    }
Exemplo n.º 3
0
    public static void Init()
    {
        // Get existing open window or if none, make a new one:
        window         = (CollectibleEditorWindow)EditorWindow.GetWindow(typeof(CollectibleEditorWindow));
        window.minSize = new Vector2(615, 250);
        window.maxSize = new Vector2(615, 251);

        EditorCollectibleList eCollectibleList = CollectibleManagerWindow.LoadCollectible();

        prefab          = eCollectibleList.prefab;
        collectibleList = prefab.collectibleList;
        nameList        = eCollectibleList.nameList;

        int enumLength = Enum.GetValues(typeof(_EffectAttrType)).Length;

        effectTypeLabel   = new string[enumLength];
        effectTypeTooltip = new string[enumLength];
        for (int i = 0; i < enumLength; i++)
        {
            effectTypeLabel[i] = ((_EffectAttrType)i).ToString();
        }
        for (int i = 0; i < enumLength; i++)
        {
            effectTypeTooltip[i] = "";
        }

        effectTypeTooltip[0]  = "Reduce target's HP";
        effectTypeTooltip[1]  = "Restore target's HP";
        effectTypeTooltip[2]  = "Reduce target's AP";
        effectTypeTooltip[3]  = "Restore target's AP";
        effectTypeTooltip[4]  = "Increase/decrease target's damage";
        effectTypeTooltip[5]  = "Increase/decrease target's movement range";
        effectTypeTooltip[6]  = "Increase/decrease target's attack range";
        effectTypeTooltip[7]  = "Increase/decrease target's speed";
        effectTypeTooltip[8]  = "Increase/decrease target's attack";
        effectTypeTooltip[9]  = "Increase/decrease target's defend";
        effectTypeTooltip[10] = "Increase/decrease target's critical chance";
        effectTypeTooltip[11] = "Increase/decrease target's critical immunity";
        effectTypeTooltip[12] = "Increase/decrease target's attack per turn";
        effectTypeTooltip[13] = "Increase/decrease target's counter attack limit ";
        effectTypeTooltip[14] = "Stun target, stop target from doing anything";
        effectTypeTooltip[15] = "Prevent target from attack";
        effectTypeTooltip[16] = "Prevent target from moving";
        effectTypeTooltip[17] = "Prevent target from using ability";
        effectTypeTooltip[18] = "Faction gain points";
    }
Exemplo n.º 4
0
    public static void Init()
    {
        // Get existing open window or if none, make a new one:
        window         = (CollectibleManagerWindow)EditorWindow.GetWindow(typeof(CollectibleManagerWindow));
        window.minSize = new Vector2(375, 449);
        window.maxSize = new Vector2(375, 800);

        EditorCollectibleList eCollectibleList = LoadCollectible();

        prefab          = eCollectibleList.prefab;
        collectibleList = prefab.collectibleList;

        foreach (CollectibleTB collectible in collectibleList)
        {
            collectibleIDList.Add(collectible.prefabID);
        }
    }
Exemplo n.º 5
0
    public static EditorCollectibleList LoadCollectible()
    {
        GameObject obj = Resources.Load("PrefabList/CollectibleListPrefab", typeof(GameObject)) as GameObject;

        if (obj == null)
        {
            obj = CreatePrefab();
        }

        CollectibleListPrefab prefab = obj.GetComponent <CollectibleListPrefab>();

        if (prefab == null)
        {
            prefab = obj.AddComponent <CollectibleListPrefab>();
        }

        for (int i = 0; i < prefab.collectibleList.Count; i++)
        {
            if (prefab.collectibleList[i] == null)
            {
                prefab.collectibleList.RemoveAt(i);
                i -= 1;
            }
        }

        string[] nameList = new string[prefab.collectibleList.Count];
        for (int i = 0; i < prefab.collectibleList.Count; i++)
        {
            if (prefab.collectibleList[i] != null)
            {
                nameList[i] = prefab.collectibleList[i].collectibleName;
            }
        }

        EditorCollectibleList eCollectibleList = new EditorCollectibleList();

        eCollectibleList.prefab   = prefab;
        eCollectibleList.nameList = nameList;

        return(eCollectibleList);
    }