Пример #1
0
        public void Redraw()
        {
            ignore_changes = true;

            if (m_caption == "A")
            {
                RA.Visible      = true;
                label14.Visible = true;
            }
            else
            {
                RA.Visible      = false;
                label14.Visible = false;
            }

            if (m_axis != null)
            {
                AM.Set(m_axis.AxisMode);
                VM.Text = m_axis.Velocity.ToString(CultureInfo.InvariantCulture.NumberFormat);
                FR.Text = m_axis.Feedrate.ToString(CultureInfo.InvariantCulture.NumberFormat);
                JH.Text = m_axis.JerkHoming.ToString(CultureInfo.InvariantCulture.NumberFormat);
                JD.Text = m_axis.JunctionDeviation.ToString(CultureInfo.InvariantCulture.NumberFormat);
                SN.Set(m_axis.SwitchMin);
                SX.Set(m_axis.SwitchMax);
                SV.Text = m_axis.SearchVelocity.ToString(CultureInfo.InvariantCulture.NumberFormat);
                LV.Text = m_axis.LatchVelocity.ToString(CultureInfo.InvariantCulture.NumberFormat);
                LB.Text = m_axis.LatchBackoff.ToString(CultureInfo.InvariantCulture.NumberFormat);
                ZB.Text = m_axis.ZeroBackoff.ToString(CultureInfo.InvariantCulture.NumberFormat);
                TM.Text = m_axis.TravelMaximum.ToString(CultureInfo.InvariantCulture.NumberFormat);
                JM.Text = m_axis.JerkMaximum.ToString(CultureInfo.InvariantCulture.NumberFormat);
                RA.Text = m_axis.Radius.ToString(CultureInfo.InvariantCulture.NumberFormat);

                ignore_changes = false;
            }
            else
            {
                AM.Items.Clear();
                SN.Items.Clear();
                SX.Items.Clear();
                VM.Text = "";
                FR.Text = "";
                JD.Text = "";
                SV.Text = "";
                LV.Text = "";
                LB.Text = "";
                ZB.Text = "";
                TM.Text = "";
                JM.Text = "";
                RA.Text = "";
            }
        }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        if (PlayerPrefs.GetInt("new_v2") != 1)
        {
            PlayerPrefs.DeleteAll();
            Main.install();
        }

        if (SX)
        {
            SX.GetComponent <SX_Ads>().smartBanneHide();
        }

        stars = PlayerPrefs.GetInt("Star");
        SX    = GameObject.Find("SX");
    }
Пример #3
0
 public override void AppendTo(ref SpanWriter writer, OrderedHashSet <string> strings, ref int entries, ref int switches)
 {
     writer.Write((ushort)0x7B20); // "{ "
     writer.Write(LayoutName);
     writer.WriteAscii(' ');
     writer.WriteAscii(X.ToString());
     writer.WriteAscii(' ');
     writer.WriteAscii(Y.ToString());
     writer.WriteAscii(' ');
     writer.WriteAscii(GumpID.ToString());
     writer.WriteAscii(' ');
     writer.WriteAscii(Width.ToString());
     writer.WriteAscii(' ');
     writer.WriteAscii(Height.ToString());
     writer.WriteAscii(' ');
     writer.WriteAscii(SX.ToString());
     writer.WriteAscii(' ');
     writer.WriteAscii(SY.ToString());
     writer.Write((ushort)0x207D); // " }"
 }
Пример #4
0
        public void StructureCheck(IEnumerable <EP> eps)
        {
            var sx = new SX();

            foreach (var ep in eps)
            {
                var a = sx.Increase(ep);
                Assert.IsTrue(a);
            }

            Assert.AreEqual(sx.Payload.Current, 5);


            var tmp = new EP();
            var b   = sx.Increase(tmp);

            Assert.IsFalse(b);

            b = sx.Decrease(eps.Last());
            Assert.IsTrue(b);
            Assert.AreEqual(sx.Payload.Current, 4);
        }
Пример #5
0
    void OnPress(bool isDown)
    {
        if (isDown == false)
        {
            AN_FirebaseAnalytics.LogEvent(gameObject.name);

            if (gameObject.name == "More")
            {
                Main.showMoreApps();
            }

            if (gameObject.name == "X" && (stars >= iPage.unlock[PlayerPrefs.GetInt("page")]))
            {
                if (PlayerPrefs.GetInt("page") < 1)
                {
                    iMap.MSG_1.SetActive(true);
                }
                else if (PlayerPrefs.GetInt("page") < 7)
                {
                    iMap.MSG_2.SetActive(true);
                }
                else
                {
                    iMap.MSG_3.SetActive(true);
                }
            }


            if (gameObject.name == "CloseBonus")
            {
                GameObject.Find("BonusInfo").SetActive(false);
            }

            if (gameObject.name == "WFW")
            {
                BonusInfo.SetActive(true);
            }


            if (gameObject.name == "GoolgePLay")
            {
#if UNITY_IOS
                Application.OpenURL("itms-apps://itunes.apple.com/app/id1496515813");
#endif


#if UNITY_ANDROID
                System.Uri uri        = new System.Uri("market://details?id=com.sayrex.wfw2");
                AN_Intent  viewIntent = new AN_Intent(AN_Intent.ACTION_VIEW, uri);
                AN_MainActivity.Instance.StartActivity(viewIntent);
#endif
            }



            if (gameObject.name == "Sharing")
            {
                SX.SendMessage("Sharing");
            }

            if (gameObject.name == "CloseMSG")
            {
                iMap.MSG_1.SetActive(false);
                iMap.MSG_2.SetActive(false);
                iMap.MSG_3.SetActive(false);
            }

            if (gameObject.name == "Map")
            {
                LoadScene(1);
            }
            if (gameObject.name == "Start")
            {
                PlayerPrefs.SetInt("page", 0);
                LoadScene(1);
            }

            if (gameObject.name == "Level" || gameObject.name == "Next")
            {
                LoadScene(2);
            }

            if (gameObject.name == "Panel_buy")
            {
                panel_buy_up();
            }

            if (gameObject.name == "Panel_buys")
            {
                panel_buy_ups();
            }

            if (gameObject.name == "Back")
            {
                LoadScene(0);
            }

            if (gameObject.name == "o_letters")
            {
                Main.Open_Letters();
            }

            if (gameObject.name == "o_words")
            {
                Main.Open_Word();
            }

            if (gameObject.name == "o_wordss")
            {
                Main.Open_Words();
            }

            if (gameObject.name == "AdsRevard")
            {
                GameObject.Find("SX").SendMessage("rewardedAdsShow");
            }

            if (gameObject.name == "Backspace" && Main.next > 0)
            {
                GameObject w = GameObject.Find("letter" + (Main.next - 1).ToString());;
                w.SendMessage("addLetters");
                //Main.check_next();
            }

            if (gameObject.name == "Page_right")
            {
                int page = 0;
                if (PlayerPrefs.HasKey("page"))
                {
                    page = PlayerPrefs.GetInt("page");
                }
                page--;
                if (page < 0)
                {
                    page = 0;
                }
                PlayerPrefs.SetInt("page", page);
                LoadScene(1);
            }

            if (gameObject.name == "pack1")
            {
                Main.onBuy("wfw2_p1");
            }
            if (gameObject.name == "pack2")
            {
                Main.onBuy("wfw2_p2");
            }
            if (gameObject.name == "pack3")
            {
                Main.onBuy("wfw2_p3");
            }
            if (gameObject.name == "pack4")
            {
                Main.onBuy("wfw2_p4");
            }
            if (gameObject.name == "pack5")
            {
                Main.onBuy("wfw2_p5");
            }
            if (gameObject.name == "buy_page")
            {
                Main.onBuy("page_" + PlayerPrefs.GetInt("page").ToString());
            }


            if (gameObject.name == "Page_left")
            {
                int page = 0;
                if (PlayerPrefs.HasKey("page"))
                {
                    page = PlayerPrefs.GetInt("page");
                }
                page++;
                if (page > 7)
                {
                    page = 7;
                }
                PlayerPrefs.SetInt("page", page);
                LoadScene(1);
            }

            if (gameObject.name == "FaceBook")
            {
                Application.OpenURL("https://www.facebook.com/SayrexGames/");
            }

            if (gameObject.name == "Sayrex")
            {
                Application.OpenURL("https://www.facebook.com/SayrexGames/");
            }


            if (gameObject.name == "GameCenter")
            {
                Main.onLeaderBoard();
            }

            if (gameObject.name == "ARCH")
            {
                Main.SX.GetComponent <SX_GameCenter>().showArchievements();
            }


            if (gameObject.name == "sound")
            {
                Debug.Log("Here");
                if (sound)
                {
                    PlayerPrefs.SetInt("sound", 1);
                    sound = false;
                    gameObject.GetComponentInChildren <UISprite>().spriteName = "btn_sound_off";
                    AudioListener.volume = 0;
                }
                else
                {
                    PlayerPrefs.SetInt("sound", 0);
                    sound = true;
                    gameObject.GetComponentInChildren <UISprite>().spriteName = "btn_sound_on";
                    AudioListener.volume = 1;
                }
            }
        }
    }
Пример #6
0
    // Update is called once per frame
    void Start()
    {
        MSG_1.SetActive(false);
        MSG_2.SetActive(false);
        MSG_3.SetActive(false);

        iMap = this;
        SX.GetComponent <SX_Ads>().smartBanneShow();

        ScoreUp();

        CoinUp();

        if (Screen.width == 1024 || Screen.width == 2048)
        {
            gameObject.transform.localScale = new Vector3(0.8f, 0.8f, 1);
        }
        if (Screen.width == 960)
        {
            gameObject.transform.localScale = new Vector3(0.9f, 0.9f, 1);
        }

        int page = PlayerPrefs.GetInt("page");

        Rate.text = "[FFF900]" + "X" + (page + 1) + "[-]";


        if (page == 0)
        {
            p0.spriteName = "tochka2";
        }
        if (page == 1)
        {
            p1.spriteName = "tochka2";
        }
        if (page == 2)
        {
            p2.spriteName = "tochka2";
        }
        if (page == 3)
        {
            p3.spriteName = "tochka2";
        }
        if (page == 4)
        {
            p4.spriteName = "tochka2";
        }
        if (page == 5)
        {
            p5.spriteName = "tochka2";
        }
        if (page == 6)
        {
            p6.spriteName = "tochka2";
        }
        if (page == 7)
        {
            p7.spriteName = "tochka2";
        }



        int  l      = 0 + (5 * page);
        int  o      = 1;
        bool msg    = true;
        bool finish = true;

        for (int i = 0; i < 5; i++)
        {
            for (int j = 0; j < 1; j++)
            {
                l++;

                Level _lvl = GameObject.Find("l_" + o.ToString()).GetComponent <Level>();
                _lvl.label.text = l.ToString();
                _lvl._Level     = l;

                _lvl.star1.fillAmount = 0;
                float w = 0;
                float c = 0;
                if (PlayerPrefs.HasKey("w_" + l.ToString()))
                {
                    w = PlayerPrefs.GetFloat("w_" + l.ToString());
                }
                if (PlayerPrefs.HasKey("c_" + l.ToString()))
                {
                    c = PlayerPrefs.GetFloat("c_" + l.ToString());
                }

                if (c > 0 && w > 0)
                {
                    _lvl.star1.fillAmount = c / w;
                    if (c / w > 0.30)
                    {
                        msg = false;
                    }
                }
                if (c / w < 1 || c < 1 || w < 1)
                {
                    finish = false;
                }

                o++;
            }
        }

        if (stars >= iPage.unlock[page])
        {
            if (PlayerPrefs.GetInt("page") < 1)
            {
                iMap.MSG_1.SetActive(msg);
            }
            else if (PlayerPrefs.GetInt("page") < 4)
            {
                iMap.MSG_2.SetActive(msg);
            }
            else
            {
                iMap.MSG_3.SetActive(msg);
            }

            if (finish)
            {
                Rate.text = "[EB2F00]" + "X" + (page + 1) + "[-]";
            }
        }
    }
Пример #7
0
    void OnPress(bool isDown)
    {
        if (isDown == false)
        {
            AN_FirebaseAnalytics.LogEvent(gameObject.name);

            if (gameObject.name == "More")
            {
                Main.showMoreApps();
            }

            if (gameObject.name == "X" && (stars >= iPage.unlock[PlayerPrefs.GetInt("page")]))
            {
                if (PlayerPrefs.GetInt("page") < 1)
                {
                    iMap.MSG_1.SetActive(true);
                }
                else if (PlayerPrefs.GetInt("page") < 7)
                {
                    iMap.MSG_2.SetActive(true);
                }
                else
                {
                    iMap.MSG_3.SetActive(true);
                }
            }

            if (gameObject.name == "CloseMSG")
            {
                iMap.MSG_1.SetActive(false);
                iMap.MSG_2.SetActive(false);
                iMap.MSG_3.SetActive(false);
            }

            if (gameObject.name == "Map")
            {
                LoadScene(1);
            }
            if (gameObject.name == "Start")
            {
                PlayerPrefs.SetInt("page", 0);
                LoadScene(1);
            }

            if (gameObject.name == "Level" || gameObject.name == "Next")
            {
                LoadScene(2);
            }

            if (gameObject.name == "Panel_buy")
            {
                panel_buy_up();
            }

            if (gameObject.name == "Sharing")
            {
                SX.SendMessage("Sharing");
            }

            if (gameObject.name == "Panel_buys")
            {
                panel_buy_ups();
            }

            if (gameObject.name == "Back")
            {
                LoadScene(0);
            }

            if (gameObject.name == "o_letters")
            {
                Main.Open_Letters();
            }

            if (gameObject.name == "o_words")
            {
                Main.Open_Word();
            }

            if (gameObject.name == "o_wordss")
            {
                Main.Open_Words();
            }

            if (gameObject.name == "AdsRevard")
            {
                GameObject.Find("SX").SendMessage("rewardedAdsShow");
            }

            if (gameObject.name == "Backspace" && Main.next > 0)
            {
                GameObject w = GameObject.Find("letter" + (Main.next - 1).ToString());;
                w.SendMessage("addLetters");
                //Main.check_next();
            }

            if (gameObject.name == "Page_right")
            {
                int page = 0;
                if (PlayerPrefs.HasKey("page"))
                {
                    page = PlayerPrefs.GetInt("page");
                }
                page--;
                if (page < 0)
                {
                    page = 0;
                }
                PlayerPrefs.SetInt("page", page);
                LoadScene(1);
            }

            if (gameObject.name == "pack1")
            {
                Main.onBuy("wfw_p1");
            }
            if (gameObject.name == "pack2")
            {
                Main.onBuy("wfw_p2");
            }
            if (gameObject.name == "pack3")
            {
                Main.onBuy("wfw_p3");
            }
            if (gameObject.name == "pack4")
            {
                Main.onBuy("wfw_p4");
            }
            if (gameObject.name == "pack5")
            {
                Main.onBuy("wfw_p5");
            }
            if (gameObject.name == "buy_page")
            {
                Main.onBuy("page_" + PlayerPrefs.GetInt("page").ToString());
            }


            if (gameObject.name == "Page_left")
            {
                int page = 0;
                if (PlayerPrefs.HasKey("page"))
                {
                    page = PlayerPrefs.GetInt("page");
                }
                page++;
                if (page > 7)
                {
                    page = 7;
                }
                PlayerPrefs.SetInt("page", page);
                LoadScene(1);
            }

            if (gameObject.name == "FaceBook")
            {
                Application.OpenURL("https://www.facebook.com/SayrexGames/");
            }

            if (gameObject.name == "Sayrex")
            {
                Application.OpenURL("https://www.facebook.com/SayrexGames/");
            }


            if (gameObject.name == "GameCenter")
            {
                Main.onLeaderBoard();
            }

            if (gameObject.name == "ARCH")
            {
                Main.SX.GetComponent <SX_GameCenter>().showArchievements();
            }


            if (gameObject.name == "sound")
            {
                Debug.Log("Here");
                if (sound)
                {
                    PlayerPrefs.SetInt("sound", 1);
                    sound = false;
                    gameObject.GetComponentInChildren <UISprite>().spriteName = "btn_sound_off";
                    AudioListener.volume = 0;
                }
                else
                {
                    PlayerPrefs.SetInt("sound", 0);
                    sound = true;
                    gameObject.GetComponentInChildren <UISprite>().spriteName = "btn_sound_on";
                    AudioListener.volume = 1;
                }
            }
        }
    }