Esempio n. 1
0
 public override void onShowed()
 {
     combo_txt.showed   = true;
     combo_txt.comboNum = 1;
     this.lastNum       = -1;
     (CrossApp.singleton.getPlugin("processManager") as processManager).addProcess(this.process, false);
     InterfaceMgr.setUntouchable(base.gameObject);
 }
Esempio n. 2
0
        static public void play1(String id, Vector3 pos, int num, bool criatk = false, int type = -1)
        {
            if (offsetPos == null)
            {
                offsetPos = new List <Vector3>();
                Vector3 v;
                for (int i = 0; i < 20; i++)
                {
                    v = new Vector3(ConfigUtil.getRandom(-30, 30), ConfigUtil.getRandom(-30, 10), 0);
                    offsetPos.Add(v);
                }
            }
            if (instacne == null)
            {
                instacne = GameObject.Find("fightText").transform;
                process  = new TickItem(onUpdate);
                TickMgr.instance.addTick(process);

                mousePointCon = GameObject.Find("mouseTouchAni").transform;
                InterfaceMgr.setUntouchable(mousePointCon.gameObject);
            }
            GameObject      root;
            FightTextTempSC sc;
            GameObject      commonUIPrefab = GAMEAPI.ABUI_LoadPrefab(id);

            root = GameObject.Instantiate(commonUIPrefab) as GameObject;
            if (type != -1)
            {
                Sprite icon_Image = GAMEAPI.ABUI_LoadSprite("icon_rune_fight_" + type);
                if (icon_Image != null)
                {
                    root.transform.FindChild("Text/Image").GetComponent <Image>().sprite = icon_Image;
                }
            }
            sc = root.GetComponent <FightTextTempSC>();
            if (sc == null)
            {
                sc = root.AddComponent <FightTextTempSC>();
            }
            if (id == MOUSE_POINT || id == MISS_TEXT)
            {
                // root.transform.SetParent(mousePointCon, false);
                root.transform.SetParent(instacne, false);
                sc.init(FightTextTempSC.TYPE_ANI);
            }
            else
            {
                root.transform.SetParent(instacne, false);
                sc.init(FightTextTempSC.TYPE_TEXT);
            }
            sc.play(pos + (id == MOUSE_POINT ? Vector3.zero : offsetPos[posIdx]), num, criatk);
            posIdx++;
            if (posIdx >= 20)
            {
                posIdx = 0;
            }
        }
Esempio n. 3
0
        public void QSMY_OPEN_PRELAB_id_path(string parm)
        {
            string[] array = parm.Split(new char[]
            {
                ','
            });
            bool flag = array.Length != 2;

            if (!flag)
            {
                GameObject gameObject = U3DAPI.U3DResLoad <GameObject>(array[1]);
                bool       flag2      = gameObject == null;
                if (!flag2)
                {
                    GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(gameObject);
                    gameObject2.transform.SetParent(InterfaceMgr.getInstance().winLayer, false);
                    InterfaceMgr.setUntouchable(gameObject2);
                    this.dPreLab[array[0]] = gameObject2;
                }
            }
        }
Esempio n. 4
0
        public override void onShowed()
        {
            bool flag = joystick.instance != null;

            if (flag)
            {
                joystick.instance.OnDragOut(null);
            }
            dialog.instance = this;
            bool flag2 = dialog.fake_npc != null;

            if (flag2)
            {
                InterfaceMgr.setUntouchable(this.bg);
                this.initAvatar();
                dialog.curDesc = dialog.fake_desc;
                this.OnShowAvatar(true);
                InterfaceMgr.getInstance().open(InterfaceMgr.NPC_TALK, null, false);
            }
            else
            {
                bool flag3 = !dialog.continuedo;
                if (flag3)
                {
                    this.curIdx = 0;
                }
                dialog.continuedo = false;
                InterfaceMgr.setUntouchable(this.bg);
                this.initAvatar();
                this.doNext();
            }
            base.onShowed();
            InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_STORY);
            bool flag4 = a3_chapter_hint.instance != null && npctalk.instance != null;

            if (flag4)
            {
                npctalk.instance.MinOrMax(false);
            }
        }
Esempio n. 5
0
        public override void onShowed()
        {
            if (a1_gamejoy.inst_joystick != null)
            {
                a1_gamejoy.inst_joystick.OnDragOut();
            }
            instance = this;
            if (fake_npc != null)
            {
                InterfaceMgr.setUntouchable(bg);
                initAvatar();
                curDesc = fake_desc;
                OnShowAvatar(true);
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.NPC_TALK);
            }
            else
            {
                if (!continuedo)
                {
                    curIdx = 0;
                }
                continuedo = false;

                InterfaceMgr.setUntouchable(bg);
                initAvatar();
                // EventTriggerListener.Get(gameObject).onClick = onCLick;
                doNext();
            }


            base.onShowed();
            InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_STORY);
            if (a3_chapter_hint.instance != null && npctalk.instance != null)
            {
                npctalk.instance.MinOrMax(false);
            }
        }
Esempio n. 6
0
 public override void onShowed()
 {
     InterfaceMgr.setUntouchable(this.rect.gameObject);
     (CrossApp.singleton.getPlugin("processManager") as processManager).addProcess(this.process, false);
     base.onShowed();
 }
Esempio n. 7
0
        static public void play(String id, Vector3 pos, int num, bool criatk = false, int type = -1, string skill = null, INameObj avatar = null)
        {
            //战斗飘字高度在头顶位置的基础上提高屏幕的10分之1
            pos.y = pos.y + Screen.height / 10;
            //return;

            //if (id == HERO_TEXT)
            //{
            //    debug.Log("aa");
            //}

            //if (offsetPos == null)
            //{
            //    offsetPos = new List<Vector3>();
            //    Vector3 v;
            //    for (int i = 0; i < 20; i++)
            //    {
            //        v = new Vector3(ConfigUtil.getRandom(-30, 30), ConfigUtil.getRandom(-30, 10), 0);
            //        offsetPos.Add(v);
            //    }
            //}


            if (instacne == null)
            {
                instacne = GameObject.Find("fightText").transform;
                process  = new TickItem(onUpdate);
                TickMgr.instance.addTick(process);

                mousePointCon = GameObject.Find("mouseTouchAni").transform;
                InterfaceMgr.setUntouchable(mousePointCon.gameObject);
            }


            if (!normalFightTextPool.ContainsKey(id + type))
            {
                normalFightTextPool[id + type] = new List <FightTextTempSC>();
            }

            List <FightTextTempSC> l = normalFightTextPool[id + type];
            GameObject             root;
            FightTextTempSC        sc;

            if (l.Count == 0)
            {
                GameObject commonUIPrefab = GAMEAPI.ABUI_LoadPrefab(id);

                root = GameObject.Instantiate(commonUIPrefab) as GameObject;
                if (type != -1)
                {
                    Sprite icon_Image = GAMEAPI.ABUI_LoadSprite("icon_rune_fight_" + type);
                    if (icon_Image != null && U3DAPI.DEF_SPRITE != icon_Image)
                    {
                        root.transform.FindChild("Text/Image").GetComponent <Image>().sprite = icon_Image;
                    }
                    else
                    {
                        GameObject.Destroy(root);
                        return;
                    }
                }
                sc = root.GetComponent <FightTextTempSC>();
                if (sc == null)
                {
                    sc = root.AddComponent <FightTextTempSC>();
                }

                if (id == MOUSE_POINT || id == MISS_TEXT)
                {
                    // root.transform.SetParent(mousePointCon, false);
                    root.transform.SetParent(instacne, false);
                    sc.init(FightTextTempSC.TYPE_ANI);
                }
                else
                {
                    root.transform.SetParent(instacne, false);
                    sc.init(FightTextTempSC.TYPE_TEXT);
                }
                sc.pool        = l;
                sc.playingPool = playingPool;
            }
            else
            {
                sc = l[0];
                sc.setActive(true);
                l.RemoveAt(0);
            }
            sc.timer = Time.time;
            playingPool.Add(sc);
            //Vec3 v = imgnum.changePot(m_char.pos + new Vec3(0, 1.8f, 0));
            //imgnum.x = v.x;
            //imgnum.y = 720 - v.y;
            //imgnum.num = num + "";
            //  Camera.main.WorldToScreenPoint(v3)
            if (skill != null)
            {//飘技能字
                sc.transform.FindChild("Text/skill").GetComponent <Text>().text = skill;
            }
            Vector2 offsetByHit = Vector2.one;

            if (CurrentCauseRole != null)
            {
                Vector3 originPos;
                try {
                    originPos = GRMap.GAME_CAM_CAMERA.WorldToScreenPoint(CurrentCauseRole.m_curModel.position);
                }
                catch (Exception) { // --此异常通常由分辨率突然变更引起
                    return;
                }
                offsetByHit = new Vector2(
                    x: (originPos.x - pos.x) > 0 ? 1 : -1,
                    y: (originPos.y - pos.y) > 0 ? 1 : -1
                    );
            }
            sc.ani.SetFloat("HorizontalValue", offsetByHit.x);
            sc.ani.SetFloat("VerticalValue", offsetByHit.y);
            if (avatar != null)
            {
                sc._avatar = avatar;
            }
            sc.play(pos, num, criatk);

            //sc.play(pos + (id == MOUSE_POINT ? Vector3.zero : offsetPos[posIdx]), num, criatk);

            posIdx++;
            if (posIdx >= 20)
            {
                posIdx = 0;
            }
        }
Esempio n. 8
0
        public static void play(string id, Vector3 pos, int num, bool criatk = false, int type = -1)
        {
            bool flag = FightText.instacne == null;

            if (flag)
            {
                FightText.instacne = GameObject.Find("fightText").transform;
                FightText.process  = new TickItem(new Action <float>(FightText.onUpdate));
                TickMgr.instance.addTick(FightText.process);
                FightText.mousePointCon = GameObject.Find("mouseTouchAni").transform;
                InterfaceMgr.setUntouchable(FightText.mousePointCon.gameObject);
            }
            bool flag2 = !FightText.normalFightTextPool.ContainsKey(id + type);

            if (flag2)
            {
                FightText.normalFightTextPool[id + type] = new List <FightTextTempSC>();
            }
            List <FightTextTempSC> list = FightText.normalFightTextPool[id + type];
            bool            flag3       = list.Count == 0;
            FightTextTempSC fightTextTempSC;

            if (flag3)
            {
                GameObject original   = Resources.Load(id) as GameObject;
                GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original);
                bool       flag4      = type != -1;
                if (flag4)
                {
                    Sprite sprite = Resources.Load("icon/rune_fight/" + type, typeof(Sprite)) as Sprite;
                    bool   flag5  = sprite != null;
                    if (!flag5)
                    {
                        UnityEngine.Object.Destroy(gameObject);
                        return;
                    }
                    gameObject.transform.FindChild("Text/Image").GetComponent <Image>().sprite = sprite;
                }
                fightTextTempSC = gameObject.GetComponent <FightTextTempSC>();
                bool flag6 = fightTextTempSC == null;
                if (flag6)
                {
                    fightTextTempSC = gameObject.AddComponent <FightTextTempSC>();
                }
                bool flag7 = id == FightText.MOUSE_POINT || id == FightText.MISS_TEXT;
                if (flag7)
                {
                    gameObject.transform.SetParent(FightText.instacne, false);
                    fightTextTempSC.init(FightTextTempSC.TYPE_ANI);
                }
                else
                {
                    gameObject.transform.SetParent(FightText.instacne, false);
                    fightTextTempSC.init(FightTextTempSC.TYPE_TEXT);
                }
                fightTextTempSC.pool        = list;
                fightTextTempSC.playingPool = FightText.playingPool;
            }
            else
            {
                fightTextTempSC = list[0];
                fightTextTempSC.setActive(true);
                list.RemoveAt(0);
            }
            fightTextTempSC.timer = Time.time;
            FightText.playingPool.Add(fightTextTempSC);
            Vector2 one   = Vector2.one;
            bool    flag8 = FightText.CurrentCauseRole != null;

            if (flag8)
            {
                Vector3 vector;
                try
                {
                    vector = GRMap.GAME_CAM_CAMERA.WorldToScreenPoint(FightText.CurrentCauseRole.m_curModel.position);
                }
                catch (Exception)
                {
                    return;
                }
                one = new Vector2((float)((vector.x - pos.x > 0f) ? 1 : -1), (float)((vector.y - pos.y > 0f) ? 1 : -1));
            }
            fightTextTempSC.ani.SetFloat("HorizontalValue", one.x);
            fightTextTempSC.ani.SetFloat("VerticalValue", one.y);
            fightTextTempSC.play(pos, num, criatk);
            FightText.posIdx++;
            bool flag9 = FightText.posIdx >= 20;

            if (flag9)
            {
                FightText.posIdx = 0;
            }
        }
Esempio n. 9
0
        public static void play1(string id, Vector3 pos, int num, bool criatk = false, int type = -1)
        {
            bool flag = FightText.offsetPos == null;

            if (flag)
            {
                FightText.offsetPos = new List <Vector3>();
                for (int i = 0; i < 20; i++)
                {
                    Vector3 item = new Vector3((float)ConfigUtil.getRandom(-30, 30), (float)ConfigUtil.getRandom(-30, 10), 0f);
                    FightText.offsetPos.Add(item);
                }
            }
            bool flag2 = FightText.instacne == null;

            if (flag2)
            {
                FightText.instacne = GameObject.Find("fightText").transform;
                FightText.process  = new TickItem(new Action <float>(FightText.onUpdate));
                TickMgr.instance.addTick(FightText.process);
                FightText.mousePointCon = GameObject.Find("mouseTouchAni").transform;
                InterfaceMgr.setUntouchable(FightText.mousePointCon.gameObject);
            }
            GameObject original   = Resources.Load(id) as GameObject;
            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original);
            bool       flag3      = type != -1;

            if (flag3)
            {
                Sprite sprite = Resources.Load("icon/rune_fight/" + type, typeof(Sprite)) as Sprite;
                bool   flag4  = sprite != null;
                if (flag4)
                {
                    gameObject.transform.FindChild("Text/Image").GetComponent <Image>().sprite = sprite;
                }
            }
            FightTextTempSC fightTextTempSC = gameObject.GetComponent <FightTextTempSC>();
            bool            flag5           = fightTextTempSC == null;

            if (flag5)
            {
                fightTextTempSC = gameObject.AddComponent <FightTextTempSC>();
            }
            bool flag6 = id == FightText.MOUSE_POINT || id == FightText.MISS_TEXT;

            if (flag6)
            {
                gameObject.transform.SetParent(FightText.instacne, false);
                fightTextTempSC.init(FightTextTempSC.TYPE_ANI);
            }
            else
            {
                gameObject.transform.SetParent(FightText.instacne, false);
                fightTextTempSC.init(FightTextTempSC.TYPE_TEXT);
            }
            fightTextTempSC.play(pos + ((id == FightText.MOUSE_POINT) ? Vector3.zero : FightText.offsetPos[FightText.posIdx]), num, criatk);
            FightText.posIdx++;
            bool flag7 = FightText.posIdx >= 20;

            if (flag7)
            {
                FightText.posIdx = 0;
            }
        }