Exemplo n.º 1
0
    void DrawLocalServerGUI()
    {
        GUILayout.Space(3);
        GUILayout.Label("-------------[AssetBundles Local Server]-------------");
        GUILayout.Space(3);

        GUILayout.BeginHorizontal();
        var  curSelected = (LocalServerType)EditorGUILayout.EnumPopup("Local Server Type : ", localServerType, GUILayout.Width(300));
        bool typeChanged = curSelected != localServerType;

        if (typeChanged)
        {
            PackageUtils.SaveLocalServerType(curSelected);

            localServerType = curSelected;
            localServerIP   = PackageUtils.GetLocalServerIP();
        }
        if (localServerType == LocalServerType.CurrentMachine)
        {
            GUILayout.Label(localServerIP);
        }
        else
        {
            localServerIP = GUILayout.TextField(localServerIP, GUILayout.Width(100));
            if (GUILayout.Button("Save", GUILayout.Width(200)))
            {
                PackageUtils.SaveLocalServerIP(localServerIP);
            }
        }
        GUILayout.EndHorizontal();
    }
Exemplo n.º 2
0
    public static string GetServerAddressByType(LocalServerType _type)
    {
        string addressStr = "";
        string defaultStr = _type == LocalServerType.CurrentMachine ? @":7888/Android/Android/" : ":444/pr1/ios/ios/";

        addressStr = EditorPrefs.GetString(_type.ToString(), defaultStr);
        return(addressStr);
    }
Exemplo n.º 3
0
    void OnEnable()
    {
        buildTarget = EditorUserBuildSettings.activeBuildTarget;
        channelType = PackageUtils.GetCurSelectedChannel();

        localServerType = PackageUtils.GetLocalServerType();
        localServerIP   = PackageUtils.GetLocalServerIP();
    }
Exemplo n.º 4
0
    void OnEnable()
    {
        buildTarget = EditorUserBuildSettings.activeBuildTarget;
        channelType = PackageUtils.GetCurSelectedChannel();

        ReadLocalVersionFile(buildTarget, channelType);

        localServerType = PackageUtils.GetLocalServerType();
        localServerIP   = PackageUtils.GetLocalServerIP();

        androidBuildABForPerChannel = PackageUtils.GetAndroidBuildABForPerChannelSetting();
        iosBuildABForPerChannel     = PackageUtils.GetIOSBuildABForPerChannelSetting();
    }
Exemplo n.º 5
0
    void OnEnable()
    {
        buildTarget = EditorUserBuildSettings.activeBuildTarget;
        channelType = PackageUtils.GetCurSelectedChannel();

        resVersion    = ReadResVersionConfig();
        bundleVersion = PlayerSettings.bundleVersion;

        localServerType = PackageUtils.GetLocalServerType();
        localServerIP   = PackageUtils.GetLocalServerIP();

        androidBuildABForPerChannel = PackageUtils.GetAndroidBuildABForPerChannelSetting();
        iosBuildABForPerChannel     = PackageUtils.GetIOSBuildABForPerChannelSetting();
    }
Exemplo n.º 6
0
    void DrawLocalServerGUI()
    {
        GUILayout.Space(3);
        GUILayout.Label("-------------[AssetBundles Local Server]-------------");
        GUILayout.Space(3);
        EditorGUI.BeginChangeCheck();
        useHTTPsServer = EditorGUILayout.ToggleLeft("Use HTTPs", useHTTPsServer);
        if (EditorGUI.EndChangeCheck())
        {
            PackageUtils.SetHTTPsServerUsage(useHTTPsServer);
        }

        GUILayout.BeginHorizontal();
        var  curSelected = (LocalServerType)EditorGUILayout.EnumPopup("Local Server Type : ", localServerType, GUILayout.Width(300));
        bool typeChanged = curSelected != localServerType;

        if (typeChanged)
        {
            PackageUtils.SaveLocalServerType(curSelected);

            localServerType    = curSelected;
            localServerIP      = PackageUtils.GetLocalServerIP();
            localServerAddress = PackageUtils.GetServerAddressByType(localServerType);
        }
        if (localServerType == LocalServerType.CurrentMachine)
        {
            GUILayout.Label(localServerIP, GUILayout.Width(100));

            localServerAddress = GUILayout.TextField(localServerAddress, GUILayout.Width(200));
            if (GUILayout.Button("Save", GUILayout.Width(200)))
            {
                PackageUtils.SaveServerAddressByType(localServerType, localServerAddress);
            }
        }
        else
        {
            localServerIP      = GUILayout.TextField(localServerIP, GUILayout.Width(100));
            localServerAddress = GUILayout.TextField(localServerAddress, GUILayout.Width(200));

            if (GUILayout.Button("Save", GUILayout.Width(200)))
            {
                PackageUtils.SaveLocalServerIP(localServerIP);
                PackageUtils.SaveServerAddressByType(localServerType, localServerAddress);
            }
        }

        GUILayout.EndHorizontal();
    }
Exemplo n.º 7
0
 public static void SaveLocalServerType(LocalServerType type)
 {
     EditorPrefs.SetInt(LocalServerPrefsKey, (int)type);
 }
Exemplo n.º 8
0
 public static void SaveServerAddressByType(LocalServerType type, string _address)
 {
     EditorPrefs.SetString(type.ToString(), _address);
 }