public IEnumerator ToRegisterStart( ) { CConnectingDialog.ToShow(); SMaster sMaster = new SMaster(); yield return(StartCoroutine(sMaster.RequestVersions())); App.Util.Global.versions = sMaster.versions; CConnectingDialog.ToClose(); CLoadingDialog.ToShow(); yield return(StartCoroutine(Init(App.Util.Global.versions))); App.Util.SceneManager.LoadScene(App.Util.SceneManager.Scenes.Register.ToString()); }
public void OnMouseDown() { //Debug.Log("try to build"); if (Taken == false && !SMaster.gameObject.GetComponent <Script_SceneMaster>().Pause&& SMaster.gameObject.GetComponent <Script_SceneMaster>().ActiveFoundation == null && SMaster.gameObject.GetComponent <Script_SceneMaster>().FoundationPlaceable) { GameObject Panel = Instantiate(PanelPre, PanelPre.transform.position, PanelPre.transform.rotation); SMaster.GetComponent <Script_SceneMaster>().SetFoundation(this.gameObject); Panel.GetComponent <Script_Towerselect>().pos = this.transform.position; anim.SetBool("Pressed", true); } }
public static IEnumerator Initialize() { if (initComplete) { yield break; } SMaster sMaster = new SMaster(); yield return(AppManager.CurrentScene.StartCoroutine(sMaster.RequestVersions())); Global.versions = sMaster.versions; CLoadingDialog.ToShow(); yield return(AppManager.CurrentScene.StartCoroutine(LoadAssetbundle(App.Util.Global.versions))); CLoadingDialog.ToClose(); initComplete = true; }
public IEnumerator ToLoginStart(string accountStr, string passwordStr) { CConnectingDialog.ToShow(); yield return(StartCoroutine(App.Util.Global.SUser.RequestLogin(accountStr, passwordStr))); if (App.Util.Global.SUser.self == null) { CConnectingDialog.ToClose(); yield break; } SMaster sMaster = new SMaster(); yield return(StartCoroutine(sMaster.RequestVersions())); App.Util.Global.versions = sMaster.versions; CConnectingDialog.ToClose(); CLoadingDialog.ToShow(); yield return(StartCoroutine(Init(App.Util.Global.versions))); App.Util.SceneManager.LoadScene(App.Util.SceneManager.Scenes.Top.ToString()); }
void Update() { if (countdown > 0) { countdown -= 1 * Time.deltaTime * SMaster.GetComponent <Script_SceneMaster>().GameSpeed; } if (countdown < 0) { countdown = 0; } if ((target == null)) { SetTarget(); } else if (Preference == 4 && target.gameObject.GetComponent <Script_enemie01>().SlowTimer > 0) { SetTarget(); } else { if (Vector3.Distance(target.transform.position, this.transform.parent.transform.position) <= range * RangeSearchAddition) { Vector3 AimAt = target.transform.position; AimAt.x -= this.transform.position.x; AimAt.y -= this.transform.position.y; angle = (Mathf.Atan2(AimAt.x, AimAt.y) * Mathf.Rad2Deg); if (angle < 0) { angle += 360; } if (Checkrot(lookangle, angle, 5f)) { if (countdown <= 0) { Shoot(); } } else { float diff = angle - lookangle; if (diff < 0f) { diff += 360f; } if (diff >= 180f) { lookangle -= 5; if (lookangle <= -1f) { lookangle = 359f; } } else { lookangle += 5; if (lookangle >= 360f) { lookangle = 0f; } } } } else { target = null; } } for (int i = 0; i <= 7; i++) { if (Checkrot(lookangle, ((float)i * 45), 22.5f)) { AniWeapon.SetInteger("Facing", i); } } }