Exemplo n.º 1
0
        Vector2 DrawEffectConfigurator(float startX, float startY, Effect item)
        {
            float maxX = startX;

            startY = TDE.DrawBasicInfo(startX, startY, item);

            spaceX += 12;

            TDE.Label(startX, startY += spaceY, width, height, "Stackable:", "Check if the effect can stack if apply on a same unit with repeatably");
            item.stackable            = EditorGUI.Toggle(new Rect(startX + spaceX, startY, widthS, height), item.stackable);

            TDE.Label(startX, startY += spaceY, width, height, "Duration:", "The long the effect will last (in second)");
            item.duration             = EditorGUI.FloatField(new Rect(startX + spaceX, startY, widthS, height), item.duration);

            startY += 10;

            TDE.Label(startX, startY += spaceY, width, height, "Effect Attributes:", "", TDE.headerS);        startX += 12;     spaceX -= 12;

            if (GUI.Button(new Rect(startX + spaceX, startY, widthS * 2, height), "Reset"))
            {
                item.Reset();
            }

            TDE.Label(startX, startY += spaceY, width, height, "Stun Target:", "Check if the effect effect will stun its target");
            item.stun = EditorGUI.Toggle(new Rect(startX + spaceX, startY, widthS, height), item.stun);

            startY += 10;     startX -= 12;     spaceX -= 12;

            int type = (int)item.effType;             contL = TDE.SetupContL(effTypeLabel, effTypeTooltip);

            TDE.Label(startX + 12, startY += spaceY, width, height, "Effect Type:", "", TDE.headerS);
            type         = EditorGUI.Popup(new Rect(startX + spaceX + 23, startY, 2 * widthS + 3, height), new GUIContent(""), type, contL);
            item.effType = (Effect._EffType)type;

            if (GUI.Button(new Rect(startX + spaceX + 23 + 2 * widthS + 5, startY, widthS * 2 - 12, height), "Reset"))
            {
                item.Reset();
            }

            //TDE.Label(startX, startY+=spaceY, width, height, "Multipliers:", "", TDE.headerS);
            startY = DrawStats(startX, startY += spaceY, item.stats, _EType.Effect);

            startY += spaceY;

            GUIStyle style = new GUIStyle("TextArea");        style.wordWrap = true;

            cont = new GUIContent("Unit description (for runtime and editor): ", "");
            EditorGUI.LabelField(new Rect(startX, startY, 400, height), cont);
            item.desp = EditorGUI.TextArea(new Rect(startX, startY + spaceY - 3, 270, 150), item.desp, style);

            return(new Vector2(maxX, startY + 170));
        }
Exemplo n.º 2
0
        private int _NewItem(int idx = -1)
        {
            Effect item = null;

            if (idx < 0)
            {
                item = new Effect(); item.Reset();
            }
            if (idx >= 0)
            {
                item = EffectDB.GetList()[idx].Clone();
            }

            item.prefabID = TDE.GenerateNewID(EffectDB.GetPrefabIDList());

            EffectDB.GetList().Add(item);
            EffectDB.UpdateLabel();

            return(EffectDB.GetList().Count - 1);
        }