Ejemplo n.º 1
0
        /** 执行方法 */
        public void pack(BuildTarget target, bool isAll, bool isReleasePack, bool isNewApp, bool isAppNeedUpdate, bool isResourceNeedUpdate, Func <int, int, int, int, string> versionFunc)
        {
            _selectTarget = target;
            _targetName   = _targetMap.get(target);

            _isAll                = isAll;
            _isReleasePack        = isReleasePack;
            _isNewApp             = isNewApp;
            _isAppNeedUpdate      = isAppNeedUpdate;
            _isResourceNeedUpdate = isResourceNeedUpdate;
            _versionFunc          = versionFunc;

            doPack();
        }
Ejemplo n.º 2
0
    /// <summary>
    /// 获取影响组
    /// </summary>
    public static bool[] getInfluenceSet(int[] arr)
    {
        string key = countKey(arr);

        bool[] re;
        if ((re = _resultDic.get(key)) == null)
        {
            re = new bool[SkillInfluenceType.size];
            Array.Copy(_sample, 0, re, 0, re.Length);

            foreach (int v in arr)
            {
                if (v > 0)
                {
                    re[v] = true;
                }
                else
                {
                    re[-v] = false;
                }
            }

            _resultDic.put(key, re);
        }

        return(re);
    }
Ejemplo n.º 3
0
        /** 写信息到文件 */
        public void write()
        {
            XML xml = new XML();

            xml.name = "infoBase";
            xml.setProperty("version", _version);

            foreach (string k in _dic.getSortedMapKeys())
            {
                FileRecordData data = _dic.get(k);

                XML xl = new XML();
                xl.name = "info";
                xl.setProperty("path", k);
                xl.setProperty("lastModified", Convert.ToString(data.lastModified));
                xl.setProperty("length", Convert.ToString(data.length));
                xl.setProperty("md5", data.md5);
                xl.setProperty("ex", data.ex);
                xl.setProperty("ex2", data.ex2);
                xl.setProperty("ex3", data.ex3);
                xl.setProperty("ex4", data.ex4);

                xml.appendChild(xl);
            }

            FileUtils.writeFileForXML(_path, xml);
        }
Ejemplo n.º 4
0
    /** 执行gm */
    public void execute(string cmd)
    {
        if (ShineSetting.isOfficial)
        {
            GameC.player.warnLog("正式服,依然有gm访问");
            return;
        }

        if (cmd.isEmpty())
        {
            return;
        }

        string[] args = cmd.Split(' ');

        Obj obj = _cmdDic.get(args[0]);

        if (obj == null)
        {
            //错误的指令
            GameC.info.showInfoCode(InfoCodeType.ClientGMFailed);
            return;
        }

        int len = args.Length - 1;

        int[]    ints = new int[len];
        string[] strs = new string[len];

        for (int i = 0; i < len; ++i)
        {
            strs[i] = args[i + 1];

            try
            {
                ints[i] = int.Parse(args[i + 1]);
            }
            catch (Exception e)
            {
            }
        }

        if (obj.call(ints, strs))
        {
            GameC.info.showInfoCode(InfoCodeType.ClientGMSuccess);
        }
    }
Ejemplo n.º 5
0
    protected virtual SceneElementEditorData toFindSceneElementEditorDataByGameObject(GameObject gameObject)
    {
        //是临时数据
        if (_tempData != null && _tempData.gameObject == gameObject)
        {
            return(_tempData);
        }

        SceneElementEditorData eData = _elementDicByObj.get(gameObject);

        if (eData != null)
        {
            return(eData);
        }

        return(null);
    }
Ejemplo n.º 6
0
    protected override SceneElementEditorData toFindSceneElementEditorDataByGameObject(GameObject gameObject)
    {
        SceneElementEditorData re = base.toFindSceneElementEditorDataByGameObject(gameObject);

        if (re != null)
        {
            return(re);
        }

        re = _gridShowsDicByObj.get(gameObject);

        if (re != null)
        {
            return(re);
        }

        return(null);
    }
Ejemplo n.º 7
0
        private static void writeBytes()
        {
            BytesWriteStream stream = new BytesWriteStream();

            stream.writeLen(_uiElementDic.size());

            foreach (string name in _uiElementDic.getSortedMapKeys())
            {
                _uiElementDic.get(name).writeBytesSimple(stream);
            }

            stream.writeLen(_uiModelDic.size());

            foreach (string name in _uiModelDic.getSortedMapKeys())
            {
                _uiModelDic.get(name).writeBytesSimple(stream);
            }

            FileUtils.writeFileForBytes(ShineToolGlobal.clientTempPath + "/uiInfo.bin", stream);
        }
Ejemplo n.º 8
0
 /// <summary>
 /// 获取
 /// </summary>
 public static MarkResourceConfig get(string url)
 {
     return(_dic.get(url));
 }
Ejemplo n.º 9
0
        private void OnSceneGUI()
        {
            if (editingCollider)
            {
                //开始绘制UI
                Handles.BeginGUI();
                GUILayout.BeginArea(new Rect(20, 20, 300, 300));
                using (var bg = new BgColor(Color.green))
                {
                    GUIStyle tmpStyle = new GUIStyle(GUI.skin.box);
                    tmpStyle.fontSize         = 15;
                    tmpStyle.normal.textColor = Color.white;
                    GUILayout.Box("当前动画:" + animationName.stringValue, tmpStyle, GUILayout.MinWidth(300));
                }

                GUILayout.Label("总帧数:" + _frames.get(animationName.stringValue));
                GUILayout.BeginHorizontal();
                GUIStyle btStyle1 = new GUIStyle(GUI.skin.button);
                btStyle1.fontSize = 15;
                if (GUILayout.Button("-", btStyle1, GUILayout.MinHeight(26)))
                {
                    prevFrame();
                }
                using (var bg = new BgColor(Color.yellow))
                {
                    GUIStyle tmpStyle = new GUIStyle(GUI.skin.box);
                    tmpStyle.fontSize         = 15;
                    tmpStyle.normal.textColor = Color.white;
                    GUILayout.Box(_curFrameIndex.ToString(), tmpStyle, GUILayout.MinWidth(200));
                }
                if (GUILayout.Button("+", btStyle1, GUILayout.MinHeight(26)))
                {
                    nextFrame();
                }
                GUILayout.EndHorizontal();

                GUILayout.Space(10);


                GUILayout.BeginHorizontal();
                using (var bg = new BgColor(Color.yellow))
                {
                    using (var cont = new ContentColor(Color.green))
                    {
                        if (GUILayout.Button("复制矩形"))
                        {
                            StringBuilder sb = new StringBuilder();
                            sb.Append(_target.offset.x);
                            sb.Append(",");
                            sb.Append(_target.offset.y);
                            sb.Append(",");
                            sb.Append(_target.size.x);
                            sb.Append(",");
                            sb.Append(_target.size.y);

                            TextEditor te = new TextEditor();
                            te.text = sb.ToString();
                            te.OnFocus();
                            te.Copy();
                        }
                    }
                }
                using (var bg = new BgColor(Color.yellow))
                {
                    if (GUILayout.Button("复制动作矩形"))
                    {
                        StringBuilder sb = new StringBuilder(animationName.stringValue);
                        sb.Append(":");
                        sb.Append(_target.offset.x);
                        sb.Append(",");
                        sb.Append(_target.offset.y);
                        sb.Append(",");
                        sb.Append(_target.size.x);
                        sb.Append(",");
                        sb.Append(_target.size.y);

                        TextEditor te = new TextEditor();
                        te.text = sb.ToString();
                        te.OnFocus();
                        te.Copy();
                    }
                }
                GUILayout.EndHorizontal();

                GUILayout.EndArea();
                Handles.EndGUI();

                //开始编辑矩形
                Matrix4x4 localToWorldMatrix = _target.transform.localToWorldMatrix;
                localToWorldMatrix.SetRow(0, Vector4.Scale(localToWorldMatrix.GetRow(0), new Vector4(1f, 1f, 0f, 1f)));
                localToWorldMatrix.SetRow(1, Vector4.Scale(localToWorldMatrix.GetRow(1), new Vector4(1f, 1f, 0f, 1f)));
                localToWorldMatrix.SetRow(2, new Vector4(0f, 0f, 1f, _target.transform.position.z));
                using (new Handles.DrawingScope(localToWorldMatrix))
                {
                    this.m_BoundsHandle.center = _target.offset;
                    this.m_BoundsHandle.size   = _target.size;
                    this.m_BoundsHandle.SetColor(Color.red);
                    EditorGUI.BeginChangeCheck();
                    this.m_BoundsHandle.DrawHandle();
                    if (EditorGUI.EndChangeCheck())
                    {
                        Undo.RecordObject(_target, string.Format("Modify {0}", ObjectNames.NicifyVariableName(base.target.GetType().Name)));
                        Vector2 size = _target.size;
                        _target.size = this.m_BoundsHandle.size;
                        if (_target.size != size)
                        {
                            _target.offset = this.m_BoundsHandle.center;
                        }
                    }
                }
            }
        }
Ejemplo n.º 10
0
        private static void makeOneNode(UIObjectData data, Transform tf)
        {
            //先prefab
            if (PrefabUtility.IsAnyPrefabInstanceRoot(tf.gameObject))
            {
                string prefabPath = PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot(tf.gameObject);

                // Ctrl.print("element",prefabPath);

                if (_elementDic.contains(prefabPath))
                {
                    data.type  = UIElementType.Element;
                    data.style = _elementDic.get(prefabPath);

                    if (data.style == null)
                    {
                        data.style = "";
                    }
                }
                else
                {
                    makeContainer(data, tf);
                }
            }
            else
            {
                //控件
                if (tf.GetComponent <CanvasRenderer>() != null)
                {
                    if (tf.GetComponent <SContainer>() != null)
                    {
                        makeContainer(data, tf);
                    }
                    else if (tf.GetComponent <Button>() != null)
                    {
                        data.type = UIElementType.Button;
                    }
                    else if (tf.GetComponent <ImageFrameContainer>() != null)
                    {
                        data.type = UIElementType.ImageFrameContainer;
                    }
                    else if (tf.GetComponent <SScrollViewFake3D>() != null)
                    {
                        data.type = UIElementType.SScrollViewFake3D;
                        SScrollViewFake3D sScrollView = tf.GetComponent <SScrollViewFake3D>();
                        data.strArgs    = new string[1];
                        data.strArgs[0] = sScrollView.gridElement;
                    }
                    else if (tf.GetComponent <SScrollView>() != null)
                    {
                        data.type = UIElementType.SScrollView;
                        SScrollView sScrollView = tf.GetComponent <SScrollView>();
                        data.strArgs    = new string[1];
                        data.strArgs[0] = sScrollView.gridElement;
                    }
                    else if (tf.GetComponent <SPageView>() != null)
                    {
                        data.type = UIElementType.SPageView;
                        SPageView sPageView = tf.GetComponent <SPageView>();
                        data.strArgs    = new string[1];
                        data.strArgs[0] = sPageView.gridElement;
                    }
                    else if (tf.GetComponent <RawImageLoader>() != null)
                    {
                        data.type = UIElementType.RawImageLoader;
                    }
                    else if (tf.GetComponent <RawImage>() != null)
                    {
                        data.type = UIElementType.RawImage;
                    }
                    else if (tf.GetComponent <AdvancedText>() != null)
                    {
                        data.type = UIElementType.TextField;
                    }
                    else if (tf.GetComponent <InputField>() != null)
                    {
                        data.type = UIElementType.InputField;
                    }
                    else if (tf.GetComponent <BloodBar>() != null)
                    {
                        data.type = UIElementType.BloodBar;
                    }
                    else if (tf.GetComponent <Scrollbar>() != null)
                    {
                        data.type = UIElementType.ScrollBar;
                    }
                    else if (tf.GetComponent <Dropdown>() != null)
                    {
                        data.type = UIElementType.Dropdown;
                    }
                    else if (tf.GetComponent <Toggle>() != null)
                    {
                        data.type = UIElementType.Toggle;
                    }
                    else if (tf.GetComponent <Slider>() != null)
                    {
                        data.type = UIElementType.Slider;
                    }
                    else if (tf.GetComponent <ImageLoader>() != null)
                    {
                        data.type = UIElementType.ImageLoader;
                    }
                    else if (tf.GetComponent <Image>() != null)
                    {
                        data.type = UIElementType.Image;
                    }
                    else if (tf.GetComponent <I18NText>() != null)
                    {
                        data.type = UIElementType.I18NText;
                    }
                    else if (tf.GetComponent <Text>() != null)
                    {
                        data.type = UIElementType.Text;
                    }
                    else if (tf.GetComponent <SkeletonGraphicLoader>() != null)
                    {
                        data.type = UIElementType.SkeletonGraphicLoader;
                    }
                    else if (tf.GetComponent <SkeletonGraphic>() != null)
                    {
                        data.type = UIElementType.SkeletonGraphic;
                    }
                    else if (tf.GetComponent <GuideMask>() != null)
                    {
                        data.type = UIElementType.GuideMask;
                    }
                    else                     //其他脚本
                    {
                        makeContainer(data, tf);
                    }
                }
                else
                {
                    if (tf.GetComponent <Toggle>() != null)
                    {
                        data.type = UIElementType.Toggle;
                    }
                    else if (tf.GetComponent <Slider>() != null)
                    {
                        data.type = UIElementType.Slider;
                    }
                    else                     //什么都没有
                    {
                        makeContainer(data, tf);
                    }
                }
            }
        }
Ejemplo n.º 11
0
 /// <summary>
 /// 获取
 /// </summary>
 public static TextConfig get(string key)
 {
     return(_dic.get(key));
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 获取
 /// </summary>
 public static LanguageConfig get(string key)
 {
     return(_dic.get(key));
 }
Ejemplo n.º 13
0
        private void doVersion()
        {
            AssetBundle ab = AssetBundle.LoadFromFile(ShineToolGlobal.bundleTempPath + "/" + _targetName + "/" + _targetName);

            _manifest = ab.LoadAsset <AssetBundleManifest>("AssetBundleManifest");

            _newVersion = new VersionSaveExData();

            _newVersion.appVersion           = _isNewApp ? _lastTargetVersion.appVersion + 1 : _lastTargetVersion.appVersion;
            _newVersion.leastAppVersion      = _isAppNeedUpdate ? _newVersion.appVersion : _lastTargetVersion.appVersion;
            _newVersion.resourceVersion      = _lastTargetVersion.resourceVersion + 1;
            _newVersion.leastResourceVersion = _isResourceNeedUpdate ? _newVersion.resourceVersion : _lastTargetVersion.leastResourceVersion;

            if (_versionFunc == null)
            {
                _newVersion.version = EditorPrefs.GetString("AssetBundleWindow_version");
            }
            else
            {
                //版本显示
                _newVersion.version = _versionFunc.Invoke(_newVersion.appVersion, _newVersion.leastAppVersion, _newVersion.resourceVersion, _newVersion.leastResourceVersion);
            }

            _newVersion.isRelease = _isReleasePack;

            //bundle部分
            foreach (BundleInfoData v in LoadControl.getBundleInfoDic())
            {
                string name = LoadControl.getResourceNameByID(v.id);

                int type = _signedResourceSaveDic.get(name);

                if (type <= 0)
                {
                    type = _defaultSaveType;
                }

                doBundleSaveOne(name, type);
            }

            //common部分
            SList <string> list = FileUtils.getDeepFileListForIgnore(ShineToolGlobal.sourceCommonPath, _ignoreEx);

            foreach (string fName in list)
            {
                String name = fName.Substring(ShineToolGlobal.sourceCommonPath.Length + 1);

                int type = _signedResourceSaveDic.get(name);

                if (type <= 0)
                {
                    type = _defaultSaveType;
                }

                if (type != ResourceSaveType.OnlyStreamingAsset)
                {
                    doFileSaveData(ShineToolGlobal.sourceCommonPath, name, type);
                }
            }

            //bundleInfo.bin
            doFileSaveData(getTargetSourcePath(), ShineGlobal.bundleInfoPath, ResourceSaveType.InStreamingAsset);

            //其余额外部分
        }
Ejemplo n.º 14
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        KeepSaveData mData = (KeepSaveData)data;

        if (mData.booleanDic != null)
        {
            if (this.booleanDic == null)
            {
                return(false);
            }
            if (this.booleanDic.size() != mData.booleanDic.size())
            {
                return(false);
            }
            IntBooleanMap booleanDicR = mData.booleanDic;
            if (!this.booleanDic.isEmpty())
            {
                int    booleanDicKFreeValue = this.booleanDic.getFreeValue();
                int[]  booleanDicKKeys      = this.booleanDic.getKeys();
                bool[] booleanDicVValues    = this.booleanDic.getValues();
                for (int booleanDicKI = booleanDicKKeys.Length - 1; booleanDicKI >= 0; --booleanDicKI)
                {
                    int booleanDicK = booleanDicKKeys[booleanDicKI];
                    if (booleanDicK != booleanDicKFreeValue)
                    {
                        bool booleanDicV = booleanDicVValues[booleanDicKI];
                        bool booleanDicU = booleanDicR.get(booleanDicK);
                        if (booleanDicV != booleanDicU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.booleanDic != null)
            {
                return(false);
            }
        }

        if (mData.intDic != null)
        {
            if (this.intDic == null)
            {
                return(false);
            }
            if (this.intDic.size() != mData.intDic.size())
            {
                return(false);
            }
            IntIntMap intDicR = mData.intDic;
            if (!this.intDic.isEmpty())
            {
                int   intDicKFreeValue = this.intDic.getFreeValue();
                int[] intDicKKeys      = this.intDic.getKeys();
                int[] intDicVValues    = this.intDic.getValues();
                for (int intDicKI = intDicKKeys.Length - 1; intDicKI >= 0; --intDicKI)
                {
                    int intDicK = intDicKKeys[intDicKI];
                    if (intDicK != intDicKFreeValue)
                    {
                        int intDicV = intDicVValues[intDicKI];
                        int intDicU = intDicR.get(intDicK);
                        if (intDicV != intDicU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.intDic != null)
            {
                return(false);
            }
        }

        if (mData.longDic != null)
        {
            if (this.longDic == null)
            {
                return(false);
            }
            if (this.longDic.size() != mData.longDic.size())
            {
                return(false);
            }
            IntLongMap longDicR = mData.longDic;
            if (!this.longDic.isEmpty())
            {
                int    longDicKFreeValue = this.longDic.getFreeValue();
                int[]  longDicKKeys      = this.longDic.getKeys();
                long[] longDicVValues    = this.longDic.getValues();
                for (int longDicKI = longDicKKeys.Length - 1; longDicKI >= 0; --longDicKI)
                {
                    int longDicK = longDicKKeys[longDicKI];
                    if (longDicK != longDicKFreeValue)
                    {
                        long longDicV = longDicVValues[longDicKI];
                        long longDicU = longDicR.get(longDicK);
                        if (longDicV != longDicU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.longDic != null)
            {
                return(false);
            }
        }

        if (mData.stringDic != null)
        {
            if (this.stringDic == null)
            {
                return(false);
            }
            if (this.stringDic.size() != mData.stringDic.size())
            {
                return(false);
            }
            SMap <string, string> stringDicR = mData.stringDic;
            if (!this.stringDic.isEmpty())
            {
                string[] stringDicKKeys   = this.stringDic.getKeys();
                string[] stringDicVValues = this.stringDic.getValues();
                for (int stringDicKI = stringDicKKeys.Length - 1; stringDicKI >= 0; --stringDicKI)
                {
                    string stringDicK = stringDicKKeys[stringDicKI];
                    if (stringDicK != null)
                    {
                        string stringDicV = stringDicVValues[stringDicKI];
                        string stringDicU = stringDicR.get(stringDicK);
                        if (stringDicV != stringDicU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.stringDic != null)
            {
                return(false);
            }
        }

        return(true);
    }
Ejemplo n.º 15
0
 /// <summary>
 /// 获取
 /// </summary>
 public static PlatformConfig get(string id)
 {
     return(_dic.get(id));
 }
Ejemplo n.º 16
0
 /** 获取子项 */
 public UIObject getChild(string name)
 {
     return(_childrenDic.get(name));
 }
Ejemplo n.º 17
0
 /// <summary>
 /// 获取
 /// </summary>
 public static InternationalResourceConfig get(string key)
 {
     return(_dic.get(key));
 }