예제 #1
0
 public static void MayBuild(ref string text, GameObject go)
 {
     if (GlobalData.Money - DefaultPrice >= 0)
     {
         GlobalData.Money -= DefaultPrice;
         RudnikScr r = go.GetComponent <RudnikScr>();
         ShopClick.Cancel();
         r.ustanovka.SetActive(true);
         r.EventMouseUp();
         text = "Установлено";
     }
     else
     {
         text = "Недостаточно денег";
     }
 }
예제 #2
0
        public static GameObject LoadObject(int i)
        {
            RudnikScr t = Instantiate(Resources.Load("Object/GAME/Enviroment/Rudnik") as GameObject, new Vector3(), new Quaternion()).GetComponent <RudnikScr>();

            t.transform.position    = new Vector3(PlayerPrefs.GetFloat("Rd" + i + "Px"), PlayerPrefs.GetFloat("Rd" + i + "Py"), PlayerPrefs.GetFloat("Rd" + i + "Pz"));
            t.transform.eulerAngles = new Vector3(PlayerPrefs.GetFloat("Rd" + i + "Rx"), PlayerPrefs.GetFloat("Rd" + i + "Ry"), PlayerPrefs.GetFloat("Rd" + i + "Rz"));
            t.ustanovka.SetActive((PlayerPrefs.GetInt("Rd" + i + "Us") == 1) ? true : false);
            if (t.ustanovka.activeSelf)
            {
                t.vagonetka.transform.position = new Vector3(PlayerPrefs.GetFloat("Rd" + i + "VPx"), PlayerPrefs.GetFloat("Rd" + i + "VPy"), PlayerPrefs.GetFloat("Rd" + i + "VPz"));
                t.vagonetka.StartTime          = Time.time + PlayerPrefs.GetFloat("Rd" + i + "ST");
                t.vagonetka.Flag            = PlayerPrefs.GetInt("Rd" + i + "F");
                t.vagonetka.SelectedMineral = PlayerPrefs.GetInt("Rd" + i + "SM");
                for (int j = 0; j < t.vagonetka.progresMinerals.Length; j++)
                {
                    t.vagonetka.progresMinerals[j] = PlayerPrefs.GetInt("Rd" + i + "PM" + j);
                }
            }
            return(t.gameObject);
        }