Ejemplo n.º 1
0
    public void HitAndStop(int ani = -1, bool shake = false)
    {
        bool flag = this.m_aniTrack != null;

        if (flag)
        {
            this.m_aniTrack.speed = 0f;
        }
        bool flag2 = this.m_aniFx != null;

        if (flag2)
        {
            bool flag3 = ani == -1;
            if (flag3)
            {
                this.m_aniFx.SetTrigger(EnumAni.ANI_T_FXDEAD);
            }
            else
            {
                this.m_aniFx.SetTrigger(ani);
            }
        }
        if (shake)
        {
            SceneCamera.cameraShake(0.4f, 20, 0.5f);
        }
    }
Ejemplo n.º 2
0
 public void shake(string pram)
 {
     string[] arr = pram.Split(new char[] { ',' });
     if (arr.Length < 3)
     {
         return;
     }
     SceneCamera.cameraShake(float.Parse(arr[0]), int.Parse(arr[1]), float.Parse(arr[2]));
 }
Ejemplo n.º 3
0
    public void shake(string pram)
    {
        string[] array = pram.Split(new char[]
        {
            ','
        });
        bool flag = array.Length < 3;

        if (!flag)
        {
            SceneCamera.cameraShake(float.Parse(array[0]), int.Parse(array[1]), float.Parse(array[2]));
        }
    }
Ejemplo n.º 4
0
    public void onShake(string param)
    {
        bool flag = this.m_monRole == null;

        if (!flag)
        {
            string[] array = param.Split(new char[]
            {
                ','
            });
            bool flag2 = array.Length < 3;
            if (!flag2)
            {
                SceneCamera.cameraShake(float.Parse(array[0]), int.Parse(array[1]), float.Parse(array[2]));
            }
        }
    }
Ejemplo n.º 5
0
    public void onShake(string param)
    {
        if (m_monRole == null)
        {
            return;
        }
        //if (!m_monRole.isBoos)
        //    return;

        string[] arr = param.Split(',');
        if (arr.Length < 3)
        {
            return;
        }

        SceneCamera.cameraShake(float.Parse(arr[0]), int.Parse(arr[1]), float.Parse(arr[2]));
    }
    public void onShake(string param)
    {
        if (m_linkProfessionRole != null)
        {
            if (!m_linkProfessionRole.m_isMain)
            {
                return;
            }
        }

        string[] arr = param.Split(',');
        if (arr.Length < 3)
        {
            return;
        }

        SceneCamera.cameraShake(float.Parse(arr[0]), int.Parse(arr[1]), float.Parse(arr[2]));
    }
Ejemplo n.º 7
0
    public void onShake(string param)
    {
        bool flag = this.m_linkProfessionRole != null;

        if (flag)
        {
            bool flag2 = !this.m_linkProfessionRole.m_isMain;
            if (flag2)
            {
                return;
            }
        }
        string[] array = param.Split(new char[]
        {
            ','
        });
        bool flag3 = array.Length < 3;

        if (!flag3)
        {
            SceneCamera.cameraShake(float.Parse(array[0]), int.Parse(array[1]), float.Parse(array[2]));
        }
    }
Ejemplo n.º 8
0
    //命中后特效轨迹停顿
    public void HitAndStop(int ani = -1, bool shake = false)
    {
        if (m_aniTrack != null)
        {
            m_aniTrack.speed = 0;
        }

        if (m_aniFx != null)
        {
            if (ani == -1)
            {
                m_aniFx.SetTrigger(EnumAni.ANI_T_FXDEAD);
            }
            else
            {
                m_aniFx.SetTrigger(ani);
            }
        }
        if (shake)
        {
            SceneCamera.cameraShake(0.4f, 20, 0.5f);
        }
    }
Ejemplo n.º 9
0
        public virtual void onTriggerHanlde()
        {
            bool flag = this.type == 1;

            if (flag)
            {
                bool flag2 = this.paramInts.Count == 0;
                if (!flag2)
                {
                    MonsterMgr._inst.AddMonster(this.paramInts[0], base.transform.position, 0u, base.transform.localEulerAngles.y, 0, 0, null);
                }
            }
            else
            {
                bool flag3 = this.type == 2;
                if (flag3)
                {
                    bool flag4 = this.paramGo.Count == 0;
                    if (!flag4)
                    {
                        foreach (GameObject current in this.paramGo)
                        {
                            current.SetActive(true);
                        }
                    }
                }
                else
                {
                    bool flag5 = this.type == 3;
                    if (flag5)
                    {
                        bool flag6 = this.paramGo.Count == 0;
                        if (!flag6)
                        {
                            foreach (GameObject current2 in this.paramGo)
                            {
                                HiddenItem component = current2.GetComponent <HiddenItem>();
                                bool       flag7     = component != null;
                                if (flag7)
                                {
                                    component.hide();
                                }
                                else
                                {
                                    current2.SetActive(false);
                                }
                            }
                        }
                    }
                    else
                    {
                        bool flag8 = this.type == 4;
                        if (flag8)
                        {
                            bool flag9 = this.paramInts.Count == 0;
                            if (!flag9)
                            {
                                int num = 0;
                                for (int i = 0; i < this.paramInts.Count; i++)
                                {
                                    num += NavmeshUtils.listARE[this.paramInts[i]];
                                }
                                bool flag10 = num == 0;
                                if (!flag10)
                                {
                                    SelfRole._inst.setNavLay(num);
                                }
                            }
                        }
                        else
                        {
                            bool flag11 = this.type == 5;
                            if (flag11)
                            {
                                bool flag12 = this.paramGo.Count == 0;
                                if (!flag12)
                                {
                                    Transform transform = this.paramGo[0].transform;
                                    for (int j = 0; j < transform.childCount; j++)
                                    {
                                        GameObject gameObject = transform.GetChild(j).gameObject;
                                        gameObject.AddComponent <BrokenIten>();
                                    }
                                }
                            }
                            else
                            {
                                bool flag13 = this.type == 6;
                                if (flag13)
                                {
                                    bool flag14 = this.paramGo.Count == 0;
                                    if (!flag14)
                                    {
                                        bool flag15 = this.paramFloat.Count == 0;
                                        if (!flag15)
                                        {
                                            bool flag16 = this.paramBool;
                                            if (flag16)
                                            {
                                                InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_HIDE_ALL);
                                                joystick.instance.stopDrag();
                                            }
                                            this.paramGo[1].SetActive(true);
                                            SceneCamera.changeAniCamera(this.paramGo[0], this.paramFloat[0]);
                                        }
                                    }
                                }
                                else
                                {
                                    bool flag17 = this.type == 8;
                                    if (flag17)
                                    {
                                        bool flag18 = this.paramGo.Count == 0;
                                        if (!flag18)
                                        {
                                            this.paramGo[0].SetActive(true);
                                            HiddenItem component2 = this.paramGo[0].GetComponent <HiddenItem>();
                                            bool       flag19     = component2 != null;
                                            if (flag19)
                                            {
                                                component2.hide();
                                            }
                                            else
                                            {
                                                this.paramGo[0].SetActive(false);
                                            }
                                        }
                                    }
                                    else
                                    {
                                        bool flag20 = this.type == 9;
                                        if (flag20)
                                        {
                                            bool flag21 = this.paramFloat.Count < 2;
                                            if (!flag21)
                                            {
                                                bool flag22 = this.paramInts.Count < 1;
                                                if (!flag22)
                                                {
                                                    SceneCamera.cameraShake(this.paramFloat[0], this.paramInts[0], this.paramFloat[1]);
                                                }
                                            }
                                        }
                                        else
                                        {
                                            bool flag23 = this.type == 10;
                                            if (flag23)
                                            {
                                                bool flag24 = this.paramFloat.Count < 1;
                                                if (!flag24)
                                                {
                                                    bool flag25 = this.paramGo.Count < 1;
                                                    if (!flag25)
                                                    {
                                                        GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(this.paramGo[0]);
                                                        gameObject2.transform.SetParent(SelfRole._inst.m_curModel, false);
                                                        UnityEngine.Object.Destroy(gameObject2, this.paramFloat[0]);
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                bool flag26 = this.type == 11;
                                                if (flag26)
                                                {
                                                    bool flag27 = this.paramStr.Count < 1;
                                                    if (!flag27)
                                                    {
                                                        List <string> ldialog = this.paramStr;
                                                        NpcRole       npc     = null;
                                                        bool          flag28  = this.paramGo != null && this.paramGo.Count > 0 && this.paramGo[0] != null;
                                                        if (flag28)
                                                        {
                                                            npc = this.paramGo[0].GetComponent <NpcRole>();
                                                        }
                                                        DoAfterMgr.instacne.addAfterRender(delegate
                                                        {
                                                            dialog.showTalk(ldialog, null, npc, false);
                                                        });
                                                    }
                                                }
                                                else
                                                {
                                                    bool flag29 = this.type == 12;
                                                    if (flag29)
                                                    {
                                                        bool flag30 = this.paramStr.Count < 1;
                                                        if (!flag30)
                                                        {
                                                            bool flag31 = this.paramGo == null || this.paramGo.Count == 0 || this.paramGo[0] == null;
                                                            if (flag31)
                                                            {
                                                                SelfRole._inst.m_curAni.SetTrigger(this.paramStr[0]);
                                                            }
                                                            else
                                                            {
                                                                Animator component3 = this.paramGo[0].GetComponent <Animator>();
                                                                bool     flag32     = component3 != null;
                                                                if (flag32)
                                                                {
                                                                    component3.SetTrigger(this.paramStr[0]);
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        bool flag33 = this.type == 13;
                                                        if (flag33)
                                                        {
                                                            bool flag34 = this.paramStr.Count < 1;
                                                            if (!flag34)
                                                            {
                                                                NewbieTeachMgr.getInstance().add(this.paramStr, -1);
                                                            }
                                                        }
                                                        else
                                                        {
                                                            bool flag35 = this.type == 14;
                                                            if (flag35)
                                                            {
                                                                bool flag36 = !this.paramBool;
                                                                if (flag36)
                                                                {
                                                                    InterfaceMgr.getInstance().floatUI.transform.localScale = Vector3.zero;
                                                                    bool flag37 = joystick.instance != null;
                                                                    if (flag37)
                                                                    {
                                                                        joystick.instance.OnDragOut(null);
                                                                    }
                                                                }
                                                                else
                                                                {
                                                                    InterfaceMgr.getInstance().floatUI.transform.localScale = Vector3.one;
                                                                }
                                                            }
                                                            else
                                                            {
                                                                bool flag38 = this.type == 15;
                                                                if (flag38)
                                                                {
                                                                    TriggerHanldePoint.lGo = this.paramGo;
                                                                }
                                                                else
                                                                {
                                                                    bool flag39 = this.type == 16;
                                                                    if (flag39)
                                                                    {
                                                                        bool flag40 = this.paramGo.Count == 0;
                                                                        if (!flag40)
                                                                        {
                                                                            foreach (GameObject current3 in this.paramGo)
                                                                            {
                                                                                TriggerHanldePoint component4 = current3.GetComponent <TriggerHanldePoint>();
                                                                                bool flag41 = component4 != null;
                                                                                if (flag41)
                                                                                {
                                                                                    component4.onTriggerHanlde();
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                    else
                                                                    {
                                                                        bool flag42 = this.type == 17;
                                                                        if (flag42)
                                                                        {
                                                                            bool flag43 = maploading.instance != null;
                                                                            if (flag43)
                                                                            {
                                                                                maploading.instance.closeLoadWait(0.5f);
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 10
0
        virtual public void onTriggerHanlde()
        {
            //  MonsterMgr._inst.AddMonster(transform);

            if (type == 1)
            {
                if (paramInts.Count == 0)
                {
                    return;
                }


                MonsterMgr._inst.AddMonster(paramInts[0], transform.position, 0, transform.localEulerAngles.y);
            }
            else if (type == 2)//enable
            {
                if (paramGo.Count == 0)
                {
                    return;
                }

                foreach (GameObject go in paramGo)
                {
                    go.SetActive(true);
                }
            }
            else if (type == 3)//unenable
            {
                if (paramGo.Count == 0)
                {
                    return;
                }

                foreach (GameObject go in paramGo)
                {
                    HiddenItem hideitem = go.GetComponent <HiddenItem>();
                    if (hideitem != null)
                    {
                        hideitem.hide();
                    }
                    else
                    {
                        go.SetActive(false);
                    }
                }
            }
            else if (type == 4)//nav
            {
                if (paramInts.Count == 0)
                {
                    return;
                }

                int idx = 0;
                for (int i = 0; i < paramInts.Count; i++)
                {
                    idx += NavmeshUtils.listARE[paramInts[i]];
                }

                if (idx == 0)
                {
                    return;
                }

                SelfRole._inst.setNavLay(idx);
            }
            else if (type == 5)
            {
                if (paramGo.Count == 0)
                {
                    return;
                }

                Transform con = paramGo[0].transform;
                for (int i = 0; i < con.childCount; i++)
                {
                    GameObject tempgi = con.GetChild(i).gameObject;
                    tempgi.AddComponent <BrokenIten>();
                }
            }
            else if (type == 6)
            {
                if (paramGo.Count == 0)
                {
                    return;
                }

                if (paramFloat.Count == 0)
                {
                    return;
                }

                if (paramBool)
                {
                    InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_HIDE_ALL);
                    a1_gamejoy.inst_joystick.stopDrag();
                }

                paramGo[1].SetActive(true);
                SceneCamera.changeAniCamera(paramGo[0], paramFloat[0]);
            }

            else if (type == 8)
            {
                if (paramGo.Count == 0)
                {
                    return;
                }

                paramGo[0].SetActive(true);

                HiddenItem hideitem = paramGo[0].GetComponent <HiddenItem>();
                if (hideitem != null)
                {
                    hideitem.hide();
                }
                else
                {
                    paramGo[0].SetActive(false);
                }
            }
            else if (type == 9)
            {
                if (paramFloat.Count < 2)
                {
                    return;
                }
                if (paramInts.Count < 1)
                {
                    return;
                }

                SceneCamera.cameraShake(paramFloat[0], paramInts[0], paramFloat[1]);
            }
            else if (type == 10)//eff
            {
                if (paramFloat.Count < 1)
                {
                    return;
                }
                if (paramGo.Count < 1)
                {
                    return;
                }
                GameObject tempGo = GameObject.Instantiate(paramGo[0]) as GameObject;

                tempGo.transform.SetParent(SelfRole._inst.m_curModel, false);
                Destroy(tempGo, paramFloat[0]);
            }
            else if (type == 11)//dialog
            {
                if (dialogid <= 0)
                {
                    return;
                }
                SXML          ncpxml = XMLMgr.instance.GetSXML("dialog");
                SXML          xml    = ncpxml.GetNode("dialog", "id==" + dialogid);
                List <string> lstr   = new List <string>();
                if (xml != null)
                {
                    List <SXML> l = new List <SXML>();
                    l = xml.GetNodeList("log");
                    foreach (SXML s in l)
                    {
                        lstr.Add(s.getString("value"));
                    }
                }
                List <string> ldialog = lstr;

                NpcRole npc = null;
                if (paramGo != null && paramGo.Count > 0 && paramGo[0] != null)
                {
                    npc = paramGo[0].GetComponent <NpcRole>();
                }

                DoAfterMgr.instacne.addAfterRender(() =>
                {
                    dialog.showTalk(ldialog, null, npc);
                });
            }
            else if (type == 12)//act
            {
                if (paramStr.Count < 1)
                {
                    return;
                }

                if (paramGo == null || paramGo.Count == 0 || paramGo[0] == null)
                {
                    SelfRole._inst.m_curAni.SetTrigger(paramStr[0]);
                }
                else
                {
                    Animator anim = paramGo[0].GetComponent <Animator>();
                    if (anim != null)
                    {
                        anim.SetTrigger(paramStr[0]);
                    }
                }
            }
            else if (type == 13)//newbiecode
            {
                if (waitCodesid == 0)
                {
                    return;
                }


                NewbieTeachMgr.getInstance().add(1, waitCodesid, -1);
            }
            else if (type == 14)//floatui
            {
                if (!paramBool)
                {
                    //InterfaceMgr.getInstance().floatUI.transform.localScale = Vector3.zero;
                    InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_STORY);
                    if (a1_gamejoy.inst_joystick != null)
                    {
                        a1_gamejoy.inst_joystick.OnDragOut();
                    }
                }
                else
                {
                    InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_NORMAL);
                    //InterfaceMgr.getInstance().floatUI.transform.localScale = Vector3.one;
                }
            }
            else if (type == 15)//gos
            {
                lGo = paramGo;
            }
            else if (type == 16)//group
            {
                if (paramGo.Count == 0)
                {
                    return;
                }

                foreach (GameObject go in paramGo)
                {
                    TriggerHanldePoint tri = go.GetComponent <TriggerHanldePoint>();
                    if (tri != null)
                    {
                        tri.onTriggerHanlde();
                    }
                }
            }
            else if (type == 17)
            {
                //延迟0.5秒关闭loading界面。解决avatar一闪和一些初始化的东西卡住的问题
                if (maploading.instance != null)
                {
                    maploading.instance.closeLoadWait(0.5f);
                }
            }
        }