コード例 #1
0
    public void runSkill_2010()
    {
        if (m_SFX2 == null)
        {
            m_SFX2 = GameObject.Instantiate(WARRIOR_SFX2) as GameObject;
            m_SFX2.transform.SetParent(m_curModel, false);
            m_SFX2.SetActive(false);
        }

        if (process_2010 == null)
        {
            process_2010 = new TickItem(onUpdate_2010);
            TickMgr.instance.addTick(process_2010);
        }
        m_cur2010_time = 0;
    }
コード例 #2
0
    void runSkill_3003()
    {
        if (process_3003 == null)
        {
            process_3003 = new TickItem(onUpdate_3003);
            TickMgr.instance.addTick(process_3003);
        }
        m_cur3003_time  = 0;
        m_cur3003_num   = 0;
        m_3003_pos      = m_curModel.transform.position;
        m_3003_rotation = m_curModel.transform.rotation;

        if (m_SFX2 == null)
        {
            m_SFX2 = GameObject.Instantiate(P3MAGE_SFX2, m_3003_pos, m_3003_rotation) as GameObject;
            m_SFX2.transform.SetParent(U3DAPI.FX_POOL_TF, false);
        }
    }
コード例 #3
0
        private TickItem CreateOutTransition(string token)
        {
            var outTransition = new TickItem((s, g, e) =>
            {
                var time   = Easing.EaseOut(s.TotalTime.TotalSeconds / SECONDS, EasingType.Quadratic);
                var newPos = 2 * time;
                if (2 - newPos <= 0.01)
                {
                    VportOffset = new Vector2(2, 0);
                    s.RunLimit  = s.Count;
                    return;
                }
                VportOffset = new Vector2(newPos, VportOffset.Y);
            }, TimeSpan.Zero, true);

            outTransition.Retired += () => { StateMachine.Transition(token); Transitioning = false; };
            return(outTransition);
        }
コード例 #4
0
    void removeSkill_30081()
    {
        if (m_SFX1 != null)
        {
            GameObject.Destroy(m_SFX1);
            m_cur3008_time = 0;
            if (process_3008 != null)
            {
                TickMgr.instance.removeTick(process_3008);
            }
            process_3008 = null;
            m_SFX1       = null;

            GameObject _insta = GameObject.Instantiate(P3MAGE_SFX3) as GameObject;
            _insta.transform.SetParent(m_curModel, false);
            GameObject.Destroy(_insta, 1f);
        }
    }
コード例 #5
0
        private TickItem CreateInTransition()
        {
            var inTransition = new TickItem((s, g, e) =>
            {
                var time   = Easing.EaseOut(s.TotalTime.TotalSeconds / SECONDS, EasingType.Quadratic);
                var newPos = 2 - (2 * time);
                if (newPos <= 0.01)
                {
                    VportOffset = new Vector2(0, 0);
                    s.RunLimit  = s.Count;
                    return;
                }
                VportOffset = new Vector2(newPos, VportOffset.Y);
            }, TimeSpan.Zero, true);

            inTransition.Retired += () => Transitioning = false;
            return(inTransition);
        }
コード例 #6
0
ファイル: P2Warrior.cs プロジェクト: atom-chen/rongyaojt
    public void runSkill_2010()
    {
        bool flag = this.m_SFX2 == null;

        if (flag)
        {
            this.m_SFX2 = UnityEngine.Object.Instantiate <GameObject>(P2Warrior.WARRIOR_SFX2);
            this.m_SFX2.transform.SetParent(this.m_curModel, false);
            this.m_SFX2.SetActive(false);
        }
        bool flag2 = this.process_2010 == null;

        if (flag2)
        {
            this.process_2010 = new TickItem(new Action <float>(this.onUpdate_2010));
            TickMgr.instance.addTick(this.process_2010);
        }
        this.m_cur2010_time = 0f;
    }
コード例 #7
0
    void onUpdate_3008(float s)
    {
        //跨地图时m_curModel==null
        if (m_curModel == null)
        {
            TickMgr.instance.removeTick(process_3008);
            return;
        }


        m_cur3008_time += s;
        if (m_cur3008_time > 0.6f)
        {
            m_SFX1.SetActive(true);
            m_cur3008_time = 0;
            TickMgr.instance.removeTick(process_3008);
            process_3008 = null;
        }
    }
コード例 #8
0
    public void runSkill_3008()
    {
        bool flag = this.m_SFX1 == null;

        if (flag)
        {
            this.m_SFX1 = UnityEngine.Object.Instantiate <GameObject>(P3Mage.P3MAGE_SFX1);
            this.m_SFX1.transform.SetParent(this.m_curModel, false);
            this.m_SFX1.SetActive(true);
        }
        bool flag2 = this.process_3008 == null;

        if (flag2)
        {
            this.process_3008 = new TickItem(new Action <float>(this.onUpdate_3008));
            TickMgr.instance.addTick(this.process_3008);
        }
        this.m_cur3008_time = 0f;
    }
コード例 #9
0
    private void removeSkill_30081()
    {
        bool flag = this.m_SFX1 != null;

        if (flag)
        {
            UnityEngine.Object.Destroy(this.m_SFX1);
            this.m_cur3008_time = 0f;
            bool flag2 = this.process_3008 != null;
            if (flag2)
            {
                TickMgr.instance.removeTick(this.process_3008);
            }
            this.process_3008 = null;
            this.m_SFX1       = null;
            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(P3Mage.P3MAGE_SFX3);
            gameObject.transform.SetParent(this.m_curModel, false);
            UnityEngine.Object.Destroy(gameObject, 1f);
        }
    }
コード例 #10
0
    private void runSkill_3003()
    {
        bool flag = this.process_3003 == null;

        if (flag)
        {
            this.process_3003 = new TickItem(new Action <float>(this.onUpdate_3003));
            TickMgr.instance.addTick(this.process_3003);
        }
        this.m_cur3003_time  = 0f;
        this.m_cur3003_num   = 0;
        this.m_3003_pos      = this.m_curModel.transform.position;
        this.m_3003_rotation = this.m_curModel.transform.rotation;
        bool flag2 = this.m_SFX2 == null;

        if (flag2)
        {
            this.m_SFX2 = (UnityEngine.Object.Instantiate(P3Mage.P3MAGE_SFX2, this.m_3003_pos, this.m_3003_rotation) as GameObject);
            this.m_SFX2.transform.SetParent(U3DAPI.FX_POOL_TF, false);
        }
    }
コード例 #11
0
    private void onUpdate_3008(float s)
    {
        bool flag = this.m_curModel == null;

        if (flag)
        {
            TickMgr.instance.removeTick(this.process_3008);
        }
        else
        {
            this.m_cur3008_time += s;
            bool flag2 = this.m_cur3008_time > 0.6f;
            if (flag2)
            {
                this.m_SFX1.SetActive(true);
                this.m_cur3008_time = 0f;
                TickMgr.instance.removeTick(this.process_3008);
                this.process_3008 = null;
            }
        }
    }
コード例 #12
0
        public void NewItem(string Title)
        {
            int HighestID;
            var IdList = TickList.Select(i => i.TickItemID).ToList <int>();

            IdList.Sort();

            try
            {
                HighestID = IdList.Last <int>();
            }
            catch
            {
                HighestID = 0;
            }
            int NewID = HighestID + 1;

            TickItem newItem = new TickItem(NewID, Title);

            TickList.Add(newItem);
        }
コード例 #13
0
    void onUpdate_3003(float s)
    {
        //跨地图时m_curModel==null
        if (m_curModel == null)
        {
            TickMgr.instance.removeTick(process_3003);

            process_3003 = null;
            m_SFX2.transform.FindChild("f").GetComponent <Animator>().SetTrigger(EnumAni.ANI_T_FXDEAD);
            GameObject.Destroy(m_SFX2, 2);
            m_SFX2 = null;

            return;
        }

        m_cur3003_time += s;
        float nexttime = 0.5f + m_cur3003_num * (m_skill3003_time - 1) / m_skill3003_num;

        if (m_cur3003_time > nexttime)
        {
            onBullet_3003(m_3003_pos, m_3003_rotation);
            m_cur3003_num++;
        }

        if (m_cur3003_time > m_skill3003_time)
        {
            m_cur3003_time = 0;
            m_cur3003_num  = 0;
            TickMgr.instance.removeTick(process_3003);
            process_3003 = null;

            m_SFX2.transform.FindChild("f").GetComponent <Animator>().SetTrigger(EnumAni.ANI_T_FXDEAD);
            GameObject.Destroy(m_SFX2, 2);
            m_SFX2 = null;
        }
    }
コード例 #14
0
    void onUpdate_2010(float s)
    {
        //跨地图时m_curModel==null
        if (m_curModel == null)
        {
            TickMgr.instance.removeTick(process_2010);
            return;
        }


        m_cur2010_time += s;
        if (m_cur2010_time > 1.0f)
        {
            m_SFX2.SetActive(true);
        }
        if (m_cur2010_time > m_skill2010_time)
        {
            GameObject.Destroy(m_SFX2);
            m_cur2010_time = 0;
            TickMgr.instance.removeTick(process_2010);
            process_2010 = null;
            m_SFX2       = null;
        }
    }
コード例 #15
0
ファイル: Form1.cs プロジェクト: ZYFDroid/Task-Queued-List
        public void DrawItem(Graphics g)
        {
            velotery *= 0.95f;
            position += velotery;
            float itemHeight  = itemTemplate.Height;
            float panelHeight = tblTaskContainer.Height;
            float panelItems  = panelHeight / itemHeight;

            maxPosition = Math.Max(0, (float)tickItems.Count - panelItems);

            if (panelItems >= tickItems.Count)
            {
                position = 0;
                velotery = 0;
            }
            else
            {
                if (position > maxPosition)
                {
                    position = maxPosition;
                    velotery = 0;
                }
                if (position < 0)
                {
                    position = 0;
                    velotery = 0;
                }

                float scrollBarX = Width - scrollBarArea.Width;
                float scrollBarY = tblTaskContainer.Top;
                float scrollBarW = scrollBarArea.Width;
                float scrollBarH = scrollBarArea.Height;

                g.FillRectangle(scrollbarBack, scrollBarX, scrollBarY, scrollBarW, Height);

                float scrollBlockHeight = Math.Max(8f, scrollBarH / ((float)tickItems.Count) * panelItems);
                float scrollBlockPos    = (scrollBarH - scrollBlockHeight) / maxPosition * position;

                g.FillRectangle(scrollbarBar, scrollBarX, scrollBarY + scrollBlockPos, scrollBarW, scrollBlockHeight);

                if (postDrag != 0)
                {
                    position += maxPosition / (scrollBarH - scrollBlockHeight) * (postDrag);

                    postDrag = 0;
                }

                if (postSwipe != 0)
                {
                    if (panelLeftDown)
                    {
                        velotery = 0;
                    }
                    position += ((float)postSwipe / itemHeight);
                    postSwipe = 0;
                }


                if (position > maxPosition)
                {
                    position = maxPosition;
                }
                if (position < 0)
                {
                    position = 0;
                }
            }
            float itemBegin = (float)Math.Floor(position);
            float itemEnd   = Math.Min((float)Math.Ceiling(position + panelItems), tickItems.Count - 1);

            for (float f = itemBegin; f <= itemEnd; f += 1)
            {
                float    baseX  = tblTaskContainer.Left;
                float    baseY  = tblTaskContainer.Top + (f - position) * itemHeight;
                int      itemId = (int)f;
                TickItem ti     = tickItems[itemId];

                RectangleF entryArea = new RectangleF(baseX + tmpLabel.Left, baseY + tmpLabel.Top, tmpLabel.Width, tmpLabel.Height);

                Rectangle btnTopArea    = new Rectangle((int)baseX + btnTaskTop.Left, (int)baseY + btnTaskTop.Top, btnTaskTop.Width, btnTaskTop.Height);
                Rectangle btnUpArea     = new Rectangle((int)baseX + btnTaskUp.Left, (int)baseY + btnTaskUp.Top, btnTaskUp.Width, btnTaskUp.Height);
                Rectangle btnDownArea   = new Rectangle((int)baseX + btnTaskDown.Left, (int)baseY + btnTaskDown.Top, btnTaskDown.Width, btnTaskDown.Height);
                Rectangle btnBottomArea = new Rectangle((int)baseX + btnTaskBottom.Left, (int)baseY + btnTaskBottom.Top, btnTaskBottom.Width, btnTaskBottom.Height);

                RectangleF buttonArea = new RectangleF(baseX + tmpButton.Left, baseY + tmpButton.Top, tmpButton.Width, tmpButton.Height);

                g.DrawString(ti.name, ti.ticked ? tmpCompleted.Font : tmpLabel.Font, fgPaint, entryArea, alignLeft);
                g.DrawImage(ti.ticked ? chk_yes : chk_no, buttonArea);

                if (isReordering)
                {
                    g.DrawImage(btnTop, btnTopArea);
                    g.DrawImage(btnUp, btnUpArea);
                    g.DrawImage(btnDown, btnDownArea);
                    g.DrawImage(btnBottom, btnBottomArea);
                }
                if (f != itemEnd)
                {
                    g.DrawLine(splitItem, 0, baseY + itemHeight, Width, baseY + itemHeight);
                }

                if (postClickX != 0 && postClickY != 0)
                {
                    if (isReordering)
                    {
                        if (btnTopArea.Contains(postClickX, postClickY))
                        {
                            postClickY = 0; postClickX = 0;

                            tickItems.Remove(ti);
                            tickItems.Insert(0, ti);
                            refreshCountingState();
                        }

                        if (btnBottomArea.Contains(postClickX, postClickY))
                        {
                            postClickY = 0; postClickX = 0;

                            tickItems.Remove(ti);
                            tickItems.Add(ti);
                            refreshCountingState();
                        }

                        if (btnUpArea.Contains(postClickX, postClickY))
                        {
                            postClickY = 0; postClickX = 0;
                            if (itemId > 0)
                            {
                                TickItem tmp = tickItems[itemId];
                                tickItems[itemId]     = tickItems[itemId - 1];
                                tickItems[itemId - 1] = tmp;
                            }
                            refreshCountingState();
                        }
                        if (btnDownArea.Contains(postClickX, postClickY))
                        {
                            postClickY = 0; postClickX = 0;
                            if (itemId < tickItems.Count - 1)
                            {
                                TickItem tmp = tickItems[itemId];
                                tickItems[itemId]     = tickItems[itemId + 1];
                                tickItems[itemId + 1] = tmp;
                            }
                            refreshCountingState();
                        }
                    }
                    if (buttonArea.Contains(postClickX, postClickY))
                    {
                        postClickY = 0; postClickX = 0;
                        ti.ticked  = !ti.ticked;
                        refreshCountingState();
                    }
                }
            }
            postClickY = 0; postClickX = 0;
        }
コード例 #16
0
 public void Put(int id, [FromBody] TickItem item)
 {
     _tickService.ModifyItem(id, item);
 }
コード例 #17
0
ファイル: IngameState.cs プロジェクト: Sidneys1/VirusFactory
        private void UpdatePath(TickItem sender, GameWindow game, FrameEventArgs e)
        {
            _selectedCountry = _countries.RandomSubset(2).ToArray();

            var pathingCities = new[] {
                _selectedCountry?[0].Cities.RandomSubset(1).First(),
                _selectedCountry?[1].Cities.RandomSubset(1).First()
            };

            var connected =
                _selectedCountry[0].BorderCountries.Any(
                    o => o == _selectedCountry[1] || o.BorderCountries.Contains(_selectedCountry[1]));

            if (connected)
            {
                var middleC = _selectedCountry[0].BorderCountries.Contains(_selectedCountry[1])
                                        ? null
                                        : _selectedCountry[0].BorderCountries.FirstOrDefault(
                    o => o.BorderCountries.Contains(_selectedCountry[1]));

                if (_selectedCountry == null)
                {
                    return;
                }

                if (middleC != null)
                {
                    var path = new[] {
                        AStar.FindPath(pathingCities[0], _selectedCountry[0].Outbound[middleC], Distance, Distance),
                        AStar.FindPath(middleC.Outbound[_selectedCountry[0]], middleC.Outbound[_selectedCountry[1]],
                                       Distance, Distance),
                        AStar.FindPath(_selectedCountry[1].Outbound[middleC], pathingCities[1], Distance, Distance)
                    };

                    path[2].FirstPath.PreviousSteps = path[1];
                    path[1].FirstPath.PreviousSteps = path[0];
                    pathingCities = path[2].ToArray();
                    _path         = path[2];
                }
                else
                {
                    var path = new[] {
                        AStar.FindPath(pathingCities[0], _selectedCountry[0].Outbound[_selectedCountry[1]], Distance,
                                       Distance),
                        AStar.FindPath(_selectedCountry[1].Outbound[_selectedCountry[0]], pathingCities[1], Distance,
                                       Distance)
                    };

                    path[1].FirstPath.PreviousSteps = path[0];
                    pathingCities = path[1].ToArray();
                    _path         = path[1];
                }
            }
            else
            {
                var path = new[] {
                    AStar.FindPath(pathingCities[0], _selectedCountry[0].Cities[0], Distance, Distance),
                    new Path <City>(_selectedCountry[1].Cities[0])
                    {
                        PreviousSteps = new Path <City>(_selectedCountry[0].Cities[0])
                    },
                    AStar.FindPath(_selectedCountry[1].Cities[0], pathingCities[1], Distance, Distance)
                };
                path[2].FirstPath.PreviousSteps = path[1];
                path[1].FirstPath.PreviousSteps = path[0];
                pathingCities = path[2].ToArray();
                _path         = path[2];
            }

            _paths = new BufferElement[(pathingCities.Length - 1) * 2];

            for (var i = 0; i < pathingCities.Length - 1; i++)
            {
                var d = (float)((pathingCities[i].Longitude / _scale) + _add.X);
                if (d < -1)
                {
                    d += 2;
                }
                var d2 = (float)((pathingCities[i + 1].Longitude / _scale) + _add.X);
                if (d2 < -1)
                {
                    d2 += 2;
                }
                var color = pathingCities[i].Country == pathingCities[i + 1].Country ||
                            pathingCities[i].Country.BorderCountries.Contains(pathingCities[i + 1].Country)
                                        ? new Vector4(1f, 0f, 0f, 1f)
                                        : new Vector4(0f, 0f, 1f, 1f);

                _paths[i * 2] = new BufferElement(new Vector2(d, (float)((pathingCities[i].Latitude / _scale) + _add.Y)),
                                                  color);
                _paths[(i * 2) + 1] =
                    new BufferElement(new Vector2(d2, (float)((pathingCities[i + 1].Latitude / _scale) + _add.Y)), color);
            }

            PathBuffer?.Dispose();
            PathBuffer = new VertexBuffer <BufferElement>(_paths, () =>
            {
                GL.EnableClientState(ArrayCap.VertexArray);
                GL.EnableClientState(ArrayCap.ColorArray);
                GL.VertexPointer(2, VertexPointerType.Float, BufferElement.SizeInBytes, new IntPtr(0));
                GL.ColorPointer(4, ColorPointerType.Float, BufferElement.SizeInBytes, new IntPtr(Vector2.SizeInBytes));
            });

            _pathText.Text = _path.ToString();
        }
コード例 #18
0
        public void RemoveItem(int id)
        {
            TickItem item = TickList.Where(i => i.TickItemID == id).Single <TickItem>();

            TickList.Remove(item);
        }