Exemplo n.º 1
0
    public static void LoadPage(int nPage)
    {
        MediaList.Clear();
        UIMgr.clearLayer();

        XmlStage.LoadPage(nPage);
    }
Exemplo n.º 2
0
        public void OnPointerDown(BaseEventData arg0)//点选目录视频,eventTrigger事件
        {
            XmlPic2D toggle = XmlStage.GetAsset2D(actButton.assetID);

            if (toggle != null)
            {
                Image img = GetComponent <Image>();
                img.sprite = toggle.PicPress;
            }
        }
Exemplo n.º 3
0
        public void OnPointerUp(BaseEventData arg0)//点选目录视频,eventTrigger事件
        {
            XmlPic2D toggle = XmlStage.GetAsset2D(actButton.assetID);

            if (toggle != null)
            {
                XmlEvent @event = XmlStage.GetEvent(strEvent);
                EventMgr.startEvent(@event);

                Image img = GetComponent <Image>();
                img.sprite = toggle.PicNormal;
            }
        }
Exemplo n.º 4
0
        public void OnButtonClick(BaseEventData arg0)
        {
            XmlPic2D toggle = XmlStage.GetAsset2D(actButton.assetID);

            if (toggle != null)
            {
                Image img = GetComponent <Image>();
                img.sprite = toggle.PicNormal;
            }

            XmlEvent @event = XmlStage.GetEvent(strEvent);

            EventMgr.startEvent(@event);
        }
Exemplo n.º 5
0
        public virtual void Init(ActBase a)
        {
            actPic = a as _show_pic;
            XmlPic2D xmlPic = XmlStage.GetAsset2D(actPic.assetID);

            if (xmlPic == null)
            {
                Debug.LogError("显示图片错误,找不到文件按  " + actPic.assetID + "in stage " + XmlStage.curStage.id);
                return;
            }
            xmlPic.InitSprite();
            Sprite tex = xmlPic.PicNormal;// Resources.Load<Sprite>(XmlStage.filePath +  btn.picNormal.fileName);

            InitPos(tex, actPic.pos, xmlPic.scale, actPic.angle);
        }
        public RandomXmlStream(int seed)
        {
            _names  = new Stack();
            _buffer = new FifoBuffer();
            _isDone = false;
            _rand   = new Random(seed);

            if (GetRandomBool())
            {
                BuildXmlDeclaration();
            }

            _stage     = XmlStage.BeforeMainDocument;
            _nodeCount = GetRandomExp(6);
        }
Exemplo n.º 7
0
        public void SetEvent(_run_event act)
        {
            actRun = act;

            theEvent = XmlStage.GetEvent(actRun.eventID);


            if (theEvent != null)
            {
                theEvent.Start();
            }
            else
            {
                Debug.Log("Event NULL");
            }
        }
Exemplo n.º 8
0
        public override void Init(ActBase act)
        {
            actButton = act as _show_button;
            strEvent  = actButton.strEvent;

            XmlPic2D xml = XmlStage.GetAsset2D(actButton.assetID);

            if (xml != null)
            {
                xml.InitSprite();

                strEvent = actButton.strEvent;

                Sprite tex = xml.PicNormal;

                InitPos(tex, actButton.pos, xml.scale, 0);
            }
        }
Exemplo n.º 9
0
 public static void LoadLevel()
 {
     UIMgr.clearLayer();
     XmlStage.Clear();
 }
Exemplo n.º 10
0
        private void BuildXmlParts()
        {
            switch (_stage)
            {
                case XmlStage.BeforeMainDocument:
                    if (_nodeCount == 0)
                    {
                        _stage = XmlStage.InMainDocument;
                        _nodeCount = GetRandomExp(16);

                        BuildStartElement(_nodeCount == 0);

                        return;
                    }

                    _nodeCount--;

                    switch (GetRandom(3))
                    {
                        case 0: // Comment
                            BuildComment();
                            break;

                        case 1: // PI
                            BuildPI();
                            break;

                        case 2: // Space
                            BuildSpace();
                            break;
                    }

                    break;

                case XmlStage.InMainDocument:
                    if (_nodeCount == 0)
                    {
                        if (_names.Count > 0)
                        {
                            BuildEndElement();

                            return;
                        }

                        _stage = XmlStage.AfterMainDocument;
                        _nodeCount = GetRandomExp(6);
                        goto case XmlStage.AfterMainDocument;
                    }

                    _nodeCount--;

                    while (true)
                    {
                        switch (GetRandom(7))
                        {
                            case 0: // Comment
                                BuildComment();
                                return;

                            case 1: // PI
                                BuildPI();
                                return;

                            case 2: // Space
                                BuildSpace();
                                return;

                            case 3: // CDATA
                                BuildCDATA();
                                return;

                            case 4: // Text
                                BuildText();
                                return;

                            case 5: // StartElement
                                BuildStartElement(true);
                                return;

                            case 6: // EndElement
                                if (_names.Count > 1)
                                {
                                    BuildEndElement();
                                    return;
                                }
                                break;
                        }
                    }

                case XmlStage.AfterMainDocument:

                    if (_nodeCount == 0)
                    {
                        _isDone = true;
                        return;
                    }

                    _nodeCount--;

                    switch (GetRandom(3))
                    {
                        case 0: // Comment
                            BuildComment();
                            break;

                        case 1: // PI
                            BuildPI();
                            break;

                        case 2: // Space
                            BuildSpace();
                            break;
                    }

                    break;
            }
        }
Exemplo n.º 11
0
        public RandomXmlStream(int seed)
        {
            _names = new Stack();
            _buffer = new FifoBuffer();
            _isDone = false;
            _rand = new Random(seed);

            if (GetRandomBool())
            {
                BuildXmlDeclaration();
            }

            _stage = XmlStage.BeforeMainDocument;
            _nodeCount = GetRandomExp(6);
        }
Exemplo n.º 12
0
    public static void startEvent(string evtName)
    {
        XmlEvent evt = XmlStage.GetEvent(evtName);

        startEvent(evt);
    }
        private void BuildXmlParts()
        {
            switch (_stage)
            {
            case XmlStage.BeforeMainDocument:
                if (_nodeCount == 0)
                {
                    _stage     = XmlStage.InMainDocument;
                    _nodeCount = GetRandomExp(16);

                    BuildStartElement(_nodeCount == 0);

                    return;
                }

                _nodeCount--;

                switch (GetRandom(3))
                {
                case 0:         // Comment
                    BuildComment();
                    break;

                case 1:         // PI
                    BuildPI();
                    break;

                case 2:         // Space
                    BuildSpace();
                    break;
                }

                break;

            case XmlStage.InMainDocument:
                if (_nodeCount == 0)
                {
                    if (_names.Count > 0)
                    {
                        BuildEndElement();

                        return;
                    }

                    _stage     = XmlStage.AfterMainDocument;
                    _nodeCount = GetRandomExp(6);
                    goto case XmlStage.AfterMainDocument;
                }

                _nodeCount--;

                while (true)
                {
                    switch (GetRandom(7))
                    {
                    case 0:         // Comment
                        BuildComment();
                        return;

                    case 1:         // PI
                        BuildPI();
                        return;

                    case 2:         // Space
                        BuildSpace();
                        return;

                    case 3:         // CDATA
                        BuildCDATA();
                        return;

                    case 4:         // Text
                        BuildText();
                        return;

                    case 5:         // StartElement
                        BuildStartElement(true);
                        return;

                    case 6:         // EndElement
                        if (_names.Count > 1)
                        {
                            BuildEndElement();
                            return;
                        }
                        break;
                    }
                }

            case XmlStage.AfterMainDocument:

                if (_nodeCount == 0)
                {
                    _isDone = true;
                    return;
                }

                _nodeCount--;

                switch (GetRandom(3))
                {
                case 0:         // Comment
                    BuildComment();
                    break;

                case 1:         // PI
                    BuildPI();
                    break;

                case 2:         // Space
                    BuildSpace();
                    break;
                }

                break;
            }
        }