private void Awake() { if (instance == null) { instance = this; } if (instance != this) { Destroy(this); } }
public LoginErrorState(UICenter center) { loginErrorObj = Resources.Load("Prefabs/LoginErrorView") as GameObject; //this.center = center; //foreach (StateReferences r in this.center.References) //{ // myReferences = r as LoginErrorReferences; // if (myReferences != null) // { // break; // } //} }
public CreateAccountInitialState(UICenter center) { createAccountInitialObj = Resources.Load("Prefabs/CreateAccountInitialView") as GameObject; //this.center = center; //foreach (StateReferences r in this.center.References) //{ // myReferences = r as CreateAccountInitialReferences; // if (myReferences != null) // { // break; // } //} }
public InventoryState(UICenter center) { inventoryGameObject = Resources.Load("Prefabs/InventoryStateView") as GameObject; //this.center = center; //foreach (StateReferences r in this.center.References) //{ // myReferences = r as InventoryReferences; // if (myReferences != null) // { // break; // } //} }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(this.gameObject); } references.AddRange(GetComponents <StateReferences>()); currentState = new LoginState(this); currentState.DisplayState(); }
public CreateAccountAlreadyExistsState(UICenter center) { createAccountAlreadyExistsObj = Resources.Load("Prefabs/CreateAccountAlreadyExistsView") as GameObject; // this.center = center; // foreach (StateReferences r in this.center.References) // { // myReferences = r as CreateAccountResultSharedReferences; // if (myReferences != null) // { // Debug.Log("Breaking account already exists, the references count is "+myReferences.GetReferencesOfState.Length); // break; // } // } }
public LoginState(UICenter center) { if (canvas == null) { canvas = center.canvas; } loginPrefab = Resources.Load("Prefabs/LoginStateView") as GameObject; // this.center = center; // foreach (StateReferences r in this.center.References) // { // myReferences = r as LoginReferences; // if (myReferences != null) // { // break; // } // } }
void Update() { Player player = ReInput.players.GetPlayer(0); if (isDying) { transform.eulerAngles = Vector3.forward * (GameManager.time - diedAt) * -20; transform.position = evaluable.eval(GameManager.time) + new Vector3(1, -1, 0) * (GameManager.time - diedAt) * 3; return; } if (GameManager.instance.state != GameState.CARD_SELECT || player.GetAxis("Rewind") != 0 || player.GetAxis("Fastforward") != 0) { transform.position = GetCurrentPos(); return; } Vector3 dir = new Vector3(player.GetAxis("MoveHori"), player.GetAxis("MoveVert"), 0); if (dir.magnitude > Mathf.Epsilon && !GameManager.instance.isAtEndOfTurn) { UICenter.DeselectAll(); GameManager.time += dir.magnitude * Time.deltaTime * moveTimeScalar; CullBranch(); transform.position += dir * moveSpeed; TryBounds(); } TryRecordPos(); return; TryShoot(); if (player.GetButtonDown("Confirm")) { for (int x = 0; x < 3; x++) { PlayerShot ps = Instantiate(Resources.Load <PlayerShot>("PlayerShot")); ps.spawnTime = GameManager.time - ((float)x) / 10; ps.dir = Vector3.right * 20; ps.scheduledDeathTime = 5; ps.Init(evaluable); } } }
void Awake() { _instance = this; ResetMusicButtonState(); }
public static void SetUICenter(UICenter uICenter) { UICenter = uICenter; }