/// <summary> /// Awake is called when the script instance is being loaded. /// </summary> void Awake() { if (manager == null) { manager = this; } else if (manager != this) { Destroy(this.gameObject); } GameObject pageManagerObject = new GameObject(); pageManager = pageManagerObject.AddComponent <PageManager>(); Instantiate(pageManagerObject); pageManager.Initialize(this); pageManager.LoadPage(adPerLevelAmount); adCount = adPerLevelAmount; timerUIObject = Instantiate(Resources.Load <GameObject>(timerPath)); Color oldColor = timerUIObject.GetComponentInChildren <Image>().color; timerUIObject.GetComponentInChildren <Image>().color = new Color(oldColor.r, oldColor.g, oldColor.b, 0.0f); timer = timerUIObject.GetComponentInChildren <Timer>(); timer.Initialize(this); audioManager = GameObject.FindGameObjectWithTag("Music").GetComponent <AudioManager>(); audioManager.playBackgroundMusic(); }
private void ReallyStart() { Score.TitleScreen = false; _started = true; _index = _startIndex; _instance = this; for (int i = 0; i < _levels.Count; i++) { var level = _levels[i]; var obj = Instantiate(level.gameObject) as GameObject; _levels[i] = obj.GetComponent <BlockLevel>(); obj.SetActive(false); } SpawnLevel(); }
void OnButtonDown_B(MonoBehaviour comp) { BlockGameManager bgm = comp as BlockGameManager; bgm.SpawnLevel(); }
void OnButtonDown_A(MonoBehaviour comp) { BlockGameManager bgm = comp as BlockGameManager; bgm.LaunchBlock(); }
void OnKeyUp_N(MonoBehaviour comp) { BlockGameManager bgm = comp as BlockGameManager; bgm.NextLevel(); }
static void OnKeyDown_Space(MonoBehaviour comp) { BlockGameManager bgm = comp as BlockGameManager; bgm.LaunchBlock(); }
static void OnKeyUp_l(MonoBehaviour comp) { BlockGameManager bgm = comp as BlockGameManager; bgm.CaptureMouse(); }
void OnButtonDown_LeftShoulder(MonoBehaviour comp) { BlockGameManager bgm = comp as BlockGameManager; bgm.NextLevel(); }
private void Awake() { instance = this; }
private void ReallyStart() { Score.TitleScreen = false; _started = true; _index = _startIndex; _instance = this; for (int i = 0; i < _levels.Count; i++) { var level = _levels[i]; var obj = Instantiate(level.gameObject) as GameObject; _levels[i] = obj.GetComponent<BlockLevel>(); obj.SetActive(false); } SpawnLevel(); }
public void Initialize(BlockGameManager blockGameManager) { this.blockGameManager = blockGameManager; }
// Start is called before the first frame update void Start() { manager = GetComponentInParent <BlockGameManager>(); anchorableBehaviour = GetComponent <AnchorableBehaviour>(); mesh = GetComponent <Renderer>(); }