GlobalGameDetails GlobalState() { if (!ggd) { GameObject[] states = GameObject.FindGameObjectsWithTag("PersistedState"); ggd = states[0].GetComponent <GlobalGameDetails>(); } return(ggd); }
void FixedUpdate() { GameObject[] states = GameObject.FindGameObjectsWithTag("PersistedState"); ggd = states[0].GetComponent <GlobalGameDetails>(); float offset = ggd.BlindOffset(); Vector3 v = new Vector3(0, offset * multiplier, 0.5F); transform.localPosition = v; }
public void Awake() { if (!i) { i = this; DontDestroyOnLoad(this); } else { Destroy(gameObject); } }