Beispiel #1
0
 void InitSoomlaEditorData()
 {
     editorData = new SoomlaEditorData();
     editorData.ReadFromJSONFile();
     editorData.updateSingleUseItems();
     inited = true;
 }
	void InitSoomlaEditorData()
	{
		editorData = new SoomlaEditorData ();
		editorData.ReadFromJSONFile ();
		editorData.updateSingleUseItems();
		inited = true;
	}
Beispiel #3
0
    void ShowGoods()
    {
        EditorGUILayout.BeginHorizontal();
        goodTypeIndex = EditorGUILayout.Popup(goodTypeIndex, goodTypeOptions, GUILayout.Width(100));

        if (goodTypeIndex > 0)
        {
            if (goodTypeIndex == 1)
            {
                editorData.AddGood(ZFGood.GoodType.SingleUseVG);
            }
            else if (goodTypeIndex == 2)
            {
                editorData.AddGood(ZFGood.GoodType.LifetimeVG);
            }
            else if (goodTypeIndex == 3)
            {
                editorData.AddGood(ZFGood.GoodType.EquippableVG);
            }

            /*else if (goodTypeIndex == 4) {
             *      editorData.AddGood(ZFGood.GoodType.UpgradeVG);
             * }*/
            else if (goodTypeIndex == 4)
            {
                editorData.AddGood(ZFGood.GoodType.SingleUsePackVG);
            }

            editorData.updateSingleUseItems();

            goodTypeIndex = 0;
        }

        addGenerateButton();


        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        addModesDisplaying(screens.goods);
        EditorGUILayout.EndHorizontal();

        scrollPos = GUILayout.BeginScrollView(scrollPos);

        for (int i = 0; i < editorData.goods.Count; i++)
        {
            EditorGUILayout.BeginVertical(GUI.skin.box);
            ShowGood(i);
            EditorGUILayout.EndVertical();
        }

        GUILayout.EndScrollView();

        EditorGUILayout.Space();
        EditorGUILayout.Space();
        EditorGUILayout.BeginHorizontal(GUI.skin.box);

        FileStream fs = new FileStream(Application.dataPath + @"/Soomla/Resources/soom_logo.png", FileMode.Open, FileAccess.Read);

        byte[] imageData = new byte[fs.Length];
        fs.Read(imageData, 0, (int)fs.Length);
        Texture2D soomlaLogoTexture = new Texture2D(300, 92);

        soomlaLogoTexture.LoadImage(imageData);

        GUIContent logoImgLabel = new GUIContent(soomlaLogoTexture);

        EditorGUILayout.LabelField(logoImgLabel, GUILayout.MaxHeight(70), GUILayout.ExpandWidth(true));
        EditorGUILayout.HelpBox("Basic Instructions: navigate throught the goods, currencies and currency packs tabs.  In each tab you may add new definitions of items in your virtual economy as well as edit or delete existing ones.  The economy model is documented in detail in the SOOMLA knowledge base: http://know.soom.la/unity/store/store_model/.  The economy builder is in beta, any feedback is appreciated and can be sent to [email protected].", MessageType.Info, true);
        GameObject.DestroyImmediate(soomlaLogoTexture);

        EditorGUILayout.EndHorizontal();
    }