Beispiel #1
0
    public static Texture2D CopyTextureQuad(Texture2D srcTexture, Texture2D tarQuadTexture)
    {
        if (srcTexture.get_width() != tarQuadTexture.get_width() * 4)
        {
            Debuger.Error("size error", new object[0]);
        }
        if (srcTexture.get_height() != tarQuadTexture.get_height() * 4)
        {
            Debuger.Error("size error", new object[0]);
        }
        Color[] pixels = srcTexture.GetPixels();
        Color[] array  = new Color[pixels.Length / 16];
        int     width  = tarQuadTexture.get_width();
        int     height = tarQuadTexture.get_height();
        int     num    = 0;
        int     num2   = 4;
        int     num3   = num2 * 4;

        for (int i = 0; i < height; i++)
        {
            int j = 0;
            while (j < width)
            {
                array[num] = Color.Lerp(Color.Lerp(Color.Lerp(Color.Lerp(pixels[i * width * num3 + j * num2], pixels[i * width * num3 + j * num2 + 1], 0.5f), Color.Lerp(pixels[i * width * num3 + width * num2 + j * num2], pixels[i * width * num3 + width * num2 + j * num2 + 1], 0.5f), 0.5f), Color.Lerp(Color.Lerp(pixels[i * width * num3 + j * num2 + 2], pixels[i * width * num3 + j * num2 + 3], 0.5f), Color.Lerp(pixels[i * width * num3 + width * num2 + j * num2 + 2], pixels[i * width * num3 + width * num2 + j * num2 + 3], 0.5f), 0.5f), 0.5f), Color.Lerp(Color.Lerp(Color.Lerp(pixels[i * width * num3 + width * num2 * 2 + j * num2], pixels[i * width * num3 + width * num2 * 2 + j * num2 + 1], 0.5f), Color.Lerp(pixels[i * width * num3 + width * num2 * 3 + j * num2], pixels[i * width * num3 + width * num2 * 3 + j * num2 + 1], 0.5f), 0.5f), Color.Lerp(Color.Lerp(pixels[i * width * num3 + width * num2 * 2 + j * num2 + 2], pixels[i * width * num3 + width * num2 * 2 + j * num2 + 3], 0.5f), Color.Lerp(pixels[i * width * num3 + width * num2 * 3 + j * num2 + 2], pixels[i * width * num3 + width * num2 * 3 + j * num2 + 3], 0.5f), 0.5f), 0.5f), 0.5f);
                j++;
                num++;
            }
        }
        tarQuadTexture.SetPixels(array);
        tarQuadTexture.Apply(false);
        return(tarQuadTexture);
    }
 private void OnGetChapterAwardDataRes(short state, GetChapterAwardDataRes down)
 {
     if (state != 0)
     {
         StateManager.Instance.StateShow(state, 0);
         return;
     }
     if (down == null)
     {
         Debuger.Error("down == null OnGetChapterAwardChangeNty", new object[0]);
         return;
     }
     for (int i = 0; i < down.chapterAwards.get_Count(); i++)
     {
         if (this.m_mapChapterAwards.ContainsKey(down.chapterAwards.get_Item(i).chapterAwardId))
         {
             this.m_mapChapterAwards[down.chapterAwards.get_Item(i).chapterAwardId] = down.chapterAwards.get_Item(i);
         }
         else
         {
             this.m_mapChapterAwards.Add(down.chapterAwards.get_Item(i).chapterAwardId, down.chapterAwards.get_Item(i));
         }
     }
     if (this.getChapterAwardDataCallback != null)
     {
         this.getChapterAwardDataCallback.Invoke();
     }
 }
 private void OnGetChapterAwardChangeNty(short state, ChapterAwardChangeNty down)
 {
     if (state != 0)
     {
         StateManager.Instance.StateShow(state, 0);
         return;
     }
     if (down == null)
     {
         Debuger.Error("down == null OnGetChapterAwardChangeNty", new object[0]);
         return;
     }
     if (this.m_mapChapterAwards.Count == 0)
     {
         return;
     }
     for (int i = 0; i < down.chapterAwards.get_Count(); i++)
     {
         if (this.m_mapChapterAwards.ContainsKey(down.chapterAwards.get_Item(i).chapterAwardId))
         {
             this.m_mapChapterAwards[down.chapterAwards.get_Item(i).chapterAwardId] = down.chapterAwards.get_Item(i);
         }
         else
         {
             this.m_mapChapterAwards.Add(down.chapterAwards.get_Item(i).chapterAwardId, down.chapterAwards.get_Item(i));
         }
     }
     EventDispatcher.Broadcast(EventNames.OnGetChapterAwardChangeNty);
 }
Beispiel #4
0
        /// <summary>
        /// 执行多条SQL语句并启用数据库事务
        /// </summary>
        /// <param name="SQLStringList"></param>
        public bool ExecSqlTran(List <String> SQLStringList)
        {
            this.Open();
            MySqlTransaction trans = conn.BeginTransaction();

            cmd.Transaction = trans;
            try
            {
                for (int n = 0; n < SQLStringList.Count; n++)
                {
                    cmd.CommandText = SQLStringList[n];
                    cmd.CommandType = CommandType.Text;
                    cmd.ExecuteNonQuery();
                }
                cmd.Parameters.Clear();
                trans.Commit();
                return(true);
            }
            catch (Exception ex)
            {
                Debuger.Error(ex.Message);
                trans.Rollback();
                return(false);
            }
            finally
            {
                this.Close();
            }
        }
Beispiel #5
0
 private void OnGetEnergyLoginPush(short state, EnergyLoginPush down)
 {
     if (state == 0)
     {
         if (down != null)
         {
             this.maxBuyTimes     = down.buyInfo.maxBuyTimes;
             this.currentBuyTimes = down.buyInfo.buyTimes;
             Debuger.Error(string.Concat(new object[]
             {
                 "OnGetEnergyLoginPush  down.buyInfo.maxBuyTimes  ",
                 down.buyInfo.maxBuyTimes,
                 "  down.buyInfo.buyTimes  ",
                 down.buyInfo.buyTimes
             }), new object[0]);
         }
         else
         {
             Debuger.Error("down == null OnGetEnergyLoginPush", new object[0]);
         }
     }
     else
     {
         StateManager.Instance.StateShow(state, 0);
     }
 }
Beispiel #6
0
    private void SliderUpdate(int addNum)
    {
        this.riseNum += addNum;
        Debuger.Error(string.Concat(new object[]
        {
            "riseNum:",
            this.riseNum,
            "addNum:",
            addNum
        }), new object[0]);
        int experience = CharacterManager.Instance.GetRiseDataTpl().experience;

        this.sliderShow.set_text(string.Format("{0}/{1}", this.riseNum, experience));
        if (this.riseNum < 0)
        {
            this.riseNum = 0;
            Debuger.Error("num is overflow", new object[0]);
        }
        this.slider.set_fillAmount((float)this.riseNum / (float)experience);
        if (this.slider.get_fillAmount() >= 1f)
        {
            EventDispatcher.Broadcast <bool>(EventNames.SliderOverflow, true);
        }
        else
        {
            EventDispatcher.Broadcast <bool>(EventNames.SliderOverflow, false);
        }
        this.gold.set_text(string.Format("金币消耗:{0}", this.price * (float)(this.riseNum - CharacterManager.Instance.CurExp)));
    }
Beispiel #7
0
 private void OnGetElementChangedNty(short state, ElementChangedNty down)
 {
     if (state == 0)
     {
         if (down != null)
         {
             Debuger.Error("OnGetElementChangedNty", new object[0]);
             for (int i = 0; i < down.elems.get_Count(); i++)
             {
                 ElementInfo elementInfo = down.elems.get_Item(i);
                 for (int j = 0; j < this.elementInfos.get_Count(); j++)
                 {
                     ElementInfo elementInfo2 = this.elementInfos.get_Item(j);
                     if (elementInfo.elemId == elementInfo2.elemId)
                     {
                         if (elementInfo2.elemLv != elementInfo.elemLv)
                         {
                             KeyValuePair <int, int> keyValuePair = this.ParseElementID(elementInfo.elemId);
                             EventDispatcher.Broadcast <int, int>(EventNames.ElementUpgrade, keyValuePair.get_Key(), keyValuePair.get_Value());
                             Debuger.Error(string.Concat(new object[]
                             {
                                 "ParseElementID ",
                                 keyValuePair.get_Key(),
                                 "  ",
                                 keyValuePair.get_Value()
                             }), new object[0]);
                         }
                         if (elementInfo2.upgradable != elementInfo.upgradable)
                         {
                             KeyValuePair <int, int> keyValuePair2 = this.ParseElementID(elementInfo.elemId);
                             if (elementInfo.elemLv == 0)
                             {
                                 EventDispatcher.Broadcast <int, int>(EventNames.ElementUnLock, keyValuePair2.get_Key(), keyValuePair2.get_Value());
                             }
                             Debuger.Error(string.Concat(new object[]
                             {
                                 "ParseElementID ",
                                 keyValuePair2.get_Key(),
                                 "  ",
                                 keyValuePair2.get_Value()
                             }), new object[0]);
                         }
                         elementInfo2.elemLv     = elementInfo.elemLv;
                         elementInfo2.upgradable = elementInfo.upgradable;
                         break;
                     }
                 }
             }
         }
         else
         {
             Debuger.Error("down == null OnGetElementChangedNty", new object[0]);
         }
     }
     else
     {
         StateManager.Instance.StateShow(state, 0);
     }
 }
 public void OnBtnCommitUp()
 {
     Debuger.Error("OnBtnCommitUp", new object[0]);
     if (this.Action2Callback != null)
     {
         this.Action2Callback.Invoke();
     }
 }
Beispiel #9
0
        public void Command(string memberName, object paramater)
        {
            MemberInfo memberInfo = Enumerable.FirstOrDefault <MemberInfo>(this._myType.GetMember(memberName));

            if (memberInfo == null)
            {
                Debuger.Error(string.Concat(new object[]
                {
                    "Member not found ! ",
                    memberName,
                    " ",
                    this._myType
                }), new object[0]);
                return;
            }
            object obj = ConverterHelper.ConvertTo(memberInfo.GetParamaterType(), paramater);

            if (memberInfo is MethodInfo)
            {
                MethodInfo methodInfo = memberInfo as MethodInfo;
                if (methodInfo.get_ReturnType() == typeof(IEnumerator))
                {
                    if (this._insanceBehaviour)
                    {
                        if (!this._insanceBehaviour.get_gameObject().get_activeSelf())
                        {
                            Debuger.Error("Behaviour is inactive !", new object[0]);
                        }
                        if (obj == null)
                        {
                            this._insanceBehaviour.StartCoroutine(methodInfo.get_Name());
                        }
                        else
                        {
                            this._insanceBehaviour.StartCoroutine(methodInfo.get_Name(), obj);
                        }
                    }
                    else
                    {
                        MethodBase arg_107_0 = methodInfo;
                        object     arg_107_1 = this._instance;
                        object     arg_107_2;
                        if (obj == null)
                        {
                            arg_107_2 = null;
                        }
                        else
                        {
                            (arg_107_2 = new object[1])[0] = obj;
                        }
                        object obj2 = arg_107_0.Invoke(arg_107_1, arg_107_2);
                        TaskManager.StartRoutine((IEnumerator)obj2);
                    }
                    return;
                }
            }
            memberInfo.SetMemberValue(this._instance, obj);
        }
 public static bool CheckSupport()
 {
     if (!SystemInfo.get_supportsImageEffects() || !SystemInfo.get_supportsRenderTextures())
     {
         Debuger.Error("Initialization failed. Requires support for Image Effects and Render Textures.", new object[0]);
         return(false);
     }
     return(true);
 }
Beispiel #11
0
 public void SendMineInfoReq(Action action)
 {
     if (this.actionOnGetMineInfoRes != null)
     {
         return;
     }
     Debuger.Error("--------------------SendMineInfoReq", new object[0]);
     this.actionOnGetMineInfoRes = action;
     NetworkManager.Send(new MineInfoReq(), ServerType.Data);
 }
Beispiel #12
0
 private void OnClickBtnCancel(GameObject sender)
 {
     Debuger.Error("OnClickBtnCancel", new object[0]);
     this.Cancel();
     GangFightManager.Instance.CancelGangFighting();
     if (GangFightManager.Instance.gangFightBattleResult != null && GangFightManager.Instance.gangFightBattleResult.winnerId == EntityWorld.Instance.EntSelf.ID)
     {
         GangFightManager.Instance.SendExitFromGangFightFieldReq();
     }
 }
Beispiel #13
0
    public void OnCloseBtnUp()
    {
        Debuger.Error("OnCloseBtnUp", new object[0]);
        AccessChannelUIView component = base.GetComponent <AccessChannelUIView>();

        component.Show(false);
        if (this._ActionClose != null)
        {
            this._ActionClose.Invoke();
        }
    }
Beispiel #14
0
 private void InitBeginning()
 {
     if (SystemInfo.get_graphicsDeviceVersion().StartsWith("Metal"))
     {
         Debuger.Error("==>Metal Initialized", new object[0]);
     }
     else
     {
         Debuger.Error(SystemInfo.get_graphicsDeviceVersion(), new object[0]);
     }
     this.isShowFightLog = false;
 }
Beispiel #15
0
 private void OnGetDungeonMiscChangedNty(short state, DungeonMiscChangedNty down = null)
 {
     if (state == 0)
     {
         Debuger.Error("----------------------down.usedFreeMopUpTimes  " + down.usedFreeMopUpTimes, new object[0]);
         this.usedFreeMopUpTimes = down.usedFreeMopUpTimes;
         EventDispatcher.Broadcast(EventNames.UsedFreeMopUpTimesChange);
     }
     else
     {
         StateManager.Instance.StateShow(state, 0);
     }
 }
Beispiel #16
0
 public void SendElementUpReq(int elemTypeParm, int subElemTypeParm)
 {
     Debuger.Error(string.Concat(new object[]
     {
         "SendElementUpReq elemTypeParm  ",
         elemTypeParm,
         "  subElemTypeParm  ",
         subElemTypeParm
     }), new object[0]);
     NetworkManager.Send(new ElementUpReq
     {
         elemId = this.MakeElementID(elemTypeParm, subElemTypeParm)
     }, ServerType.Data);
 }
Beispiel #17
0
    public static WWW OpenURL(string url)
    {
        WWW result = null;

        try
        {
            result = new WWW(url);
        }
        catch (Exception ex)
        {
            Debuger.Error(ex.get_Message(), new object[0]);
        }
        return(result);
    }
Beispiel #18
0
 private void Start()
 {
     if (!Liquidum.Instance)
     {
         Debuger.Error("WARNING:Liquidum Main Script not found!\nPlease Drag&Drop Liquidum_Effect.prefab under your camera/player/character controller gameobject.\nFound it in /LIQUIDUM main directory\n", new object[0]);
         return;
     }
     this.TrailDropPrefab.GetComponent <Renderer>().set_material(this.DefaultTrialMaterial);
     if (!this.ChangeMaterialAtRunTime)
     {
         TrailRenderer component = this.TrailDropPrefab.GetComponent <TrailRenderer>();
         this.SetShaderAttribute(component);
     }
 }
Beispiel #19
0
 private void ResetPosition2Particle()
 {
     if (this.FXParticle == null)
     {
         Debuger.Error("FX is null", new object[0]);
         return;
     }
     if (string.IsNullOrEmpty(this.CurrentUI))
     {
         Debuger.Error("CurrentUI is null", new object[0]);
         return;
     }
     FXNodeTool.ResetPosition(this.FXParticle, this.GetParentNode(), false);
 }
Beispiel #20
0
    public override void EnterPlatform(Collider other)
    {
        ActorParent componentInChildren = other.get_transform().get_root().GetComponentInChildren <ActorParent>();

        if (componentInChildren == null || this.passengers.Contains(componentInChildren))
        {
            return;
        }
        Debuger.Error("add", new object[0]);
        this.passengers.Add(componentInChildren);
        componentInChildren.EnterPlatformArea();
        base.AddStartPlatformEvent(new Action(componentInChildren.StartPlatformTrip));
        base.AddEndPlatformEvent(new Action(componentInChildren.FinishPlatformTrip));
    }
 public static bool CheckMaterialAndShader(Material material, string name)
 {
     if (material == null || material.get_shader() == null)
     {
         Debuger.Error("Error creating material : " + name, new object[0]);
         return(false);
     }
     if (!material.get_shader().get_isSupported())
     {
         Debuger.Error("Shader not supported on this platform : " + name, new object[0]);
         return(false);
     }
     material.set_hideFlags(52);
     return(true);
 }
Beispiel #22
0
 private void OnGetElementUpRes(short state, ElementUpRes down)
 {
     if (state == 0)
     {
         EventDispatcher.Broadcast(EventNames.OnGetElementChangedNty);
         if (down == null)
         {
             Debuger.Error("down == null OnGetElementUpRes", new object[0]);
         }
     }
     else
     {
         StateManager.Instance.StateShow(state, 0);
     }
 }
Beispiel #23
0
        /// <summary>
        /// 执行实体类集合插入并启用数据库事务
        /// </summary>
        /// <param name="listModel">实体类集合</param>
        /// <returns></returns>
        public bool ExecModelTran(List <Object> listModel)
        {
            this.Open();
            MySqlTransaction trans = conn.BeginTransaction();

            cmd.Transaction = trans;
            try
            {
                for (int n = 0; n < listModel.Count; n++)
                {
                    Type           T          = listModel[n].GetType();
                    PropertyInfo[] propert    = T.GetProperties();
                    string         fields     = string.Empty;
                    string         fieldValue = string.Empty;
                    string         Sql        = string.Empty;
                    for (int i = 0; i < propert.Length; i++)
                    {
                        if (propert[i].PropertyType.Name == "Nullable`1" && propert[i].GetValue(listModel[n], null) == null) //可空类型判断,主要针对DateTime类型
                        {
                            AddParam("?" + propert[i].Name, DBNull.Value);
                        }
                        else
                        {
                            AddParam("?" + propert[i].Name, propert[i].GetValue(listModel[n], null) == null ? DBNull.Value : propert[i].GetValue(listModel[n], null)); //将实体类的属性进行参数转换
                        }
                        fields     += propert[i].Name + ",";
                        fieldValue += "?" + propert[i].Name + ",";
                    }
                    Sql             = "INSERT INTO " + T.Name + "(" + fields.TrimEnd(',') + ") VALUES(" + fieldValue.TrimEnd(',') + ")";
                    cmd.CommandText = Sql;
                    cmd.CommandType = CommandType.Text;
                    cmd.ExecuteNonQuery();
                    cmd.Parameters.Clear();
                }
                trans.Commit();
                return(true);
            }
            catch (Exception ex)
            {
                Debuger.Error(ex.Message);
                trans.Rollback();
                return(false);
            }
            finally
            {
                this.Close();
            }
        }
    public static Shader FindShader(string name)
    {
        Shader shader = ShaderManager.Find(name);

        if (shader == null)
        {
            Debuger.Error("Error find shader : " + name, new object[0]);
            return(null);
        }
        if (!shader.get_isSupported())
        {
            Debuger.Error("Shader not supported on this platform : " + name, new object[0]);
            return(null);
        }
        return(shader);
    }
Beispiel #25
0
 private void UpdateSprite(object arg)
 {
     if (this.Target != null && arg != null)
     {
         if (arg is SpriteRenderer)
         {
             SpriteRenderer spriteRenderer = arg as SpriteRenderer;
             ResourceManager.SetSprite(this.Target, (SpriteRenderer)arg);
             if (this.SetNativeSize)
             {
                 this.Target.SetNativeSize();
             }
             if (this.RefreshLayout)
             {
                 LayoutElement component = base.get_transform().GetComponent <LayoutElement>();
                 if (component != null)
                 {
                     component.set_preferredWidth(-1f);
                 }
             }
             if (this.SetLayoutIgnoreWhenEmpty)
             {
                 LayoutElement component2 = base.get_transform().GetComponent <LayoutElement>();
                 if (component2 != null)
                 {
                     if (spriteRenderer != null && spriteRenderer.get_sprite() != null && spriteRenderer.get_sprite().get_name().Equals("Empty"))
                     {
                         component2.set_ignoreLayout(true);
                     }
                     else if ((Sprite)arg == null)
                     {
                         component2.set_ignoreLayout(true);
                     }
                     else
                     {
                         component2.set_ignoreLayout(false);
                     }
                 }
             }
         }
         else
         {
             Debuger.Error("===arg invalid, it need arg is sprite.", new object[0]);
         }
     }
 }
Beispiel #26
0
 protected void OnTriggerExit(Collider other)
 {
     Debuger.Error("OnTriggerExit", new object[0]);
     if (other.get_gameObject().get_layer() == LayerSystem.NameToLayer(LayerSystem.GetGameObjectLayerName(EntityWorld.Instance.EntSelf.Camp, EntityWorld.Instance.EntSelf.LayerEntityNumber, 1)))
     {
         this.isTrigger = false;
         if (this.lastPosition == base.get_transform().get_position())
         {
             this.isUp = !this.isUp;
         }
         this.lastPosition  = Vector3.get_zero();
         this.firstPosition = Vector3.get_zero();
         this.LeavePlatform(other);
         this.startMove = null;
         this.endMove   = null;
     }
 }
Beispiel #27
0
 protected void OnTriggerEnter(Collider other)
 {
     Debuger.Error("OnTriggerEnter", new object[0]);
     if (other.get_gameObject().get_layer() == LayerSystem.NameToLayer(LayerSystem.GetGameObjectLayerName(EntityWorld.Instance.EntSelf.Camp, EntityWorld.Instance.EntSelf.LayerEntityNumber, 1)))
     {
         this.firstPosition = base.get_transform().get_position();
         if (this.isUp)
         {
             this.lastPosition = this.endPoint.get_position();
         }
         else
         {
             this.lastPosition = this.startPoint.get_position();
         }
         this.EnterPlatform(other);
     }
 }
Beispiel #28
0
    public void Init(ListView.ListViewScrollStyle scrollStyle)
    {
        if (this.m_isInited)
        {
            return;
        }
        this.m_isInited = true;
        if (this.manager == null)
        {
            Debuger.Error("Init()  err : manager == null  && return", new object[0]);
            return;
        }
        this.m_contentView = new GameObject();
        this.m_contentView.set_name("ContentView");
        this.m_contentView.AddComponent <RectTransform>();
        base.set_content(this.m_contentView.GetComponent <RectTransform>());
        this.m_contentView.get_transform().SetParent(base.get_transform());
        this.m_contentView.GetComponent <RectTransform>().set_localScale(Vector3.get_one());
        this.SetScrollStyle(scrollStyle);
        Vector3 zero = Vector3.get_zero();

        if (scrollStyle == ListView.ListViewScrollStyle.Up)
        {
            zero.y = base.GetComponent <RectTransform>().get_sizeDelta().y / 2f;
        }
        else if (scrollStyle == ListView.ListViewScrollStyle.Down)
        {
            zero.y = 0f - base.GetComponent <RectTransform>().get_sizeDelta().y / 2f;
        }
        else if (scrollStyle == ListView.ListViewScrollStyle.Left)
        {
            zero.x = 0f - base.GetComponent <RectTransform>().get_sizeDelta().x / 2f;
        }
        else if (scrollStyle == ListView.ListViewScrollStyle.Right)
        {
            zero.x = base.GetComponent <RectTransform>().get_sizeDelta().x / 2f;
        }
        this.m_contentView.GetComponent <RectTransform>().set_localPosition(zero);
        Image image = this.m_contentView.AddComponent <Image>();

        image.set_enabled(false);
        base.get_gameObject().AddMissingComponent <Image>();
        Mask mask = base.get_gameObject().AddMissingComponent <Mask>();

        mask.set_showMaskGraphic(false);
    }
Beispiel #29
0
        public override void OnFXEvent(FXEventCmd cmd)
        {
            AnimationEvent args         = cmd.args;
            int            intParameter = args.get_intParameter();

            if (intParameter <= 0)
            {
                string text = "播放特效失败, 特效ID不合法";
                UIManagerControl.Instance.ShowToastText(text);
                Debuger.Error(text, new object[0]);
            }
            CommandCenter.ExecuteCommand(base.get_transform(), new PlayActionFXCmd
            {
                fxID  = intParameter,
                scale = DataReader <AvatarModel> .Get(this.resGUID).scale
            });
        }
Beispiel #30
0
    public static void LoadXML(string fileName)
    {
        TextAsset textAsset = AssetLoader.LoadAssetNow("BT/BT" + fileName, typeof(Object)) as TextAsset;

        if (textAsset == null)
        {
            return;
        }
        BTNode bTNode = BTLoader.TreeLoader(textAsset.get_text());

        BTLoader.container.Add(fileName, bTNode);
        AssetLoader.UnloadAsset("BT/BT" + fileName, null);
        if (bTNode == null)
        {
            Debuger.Error("创建BTree失败 " + fileName, new object[0]);
        }
    }