public void BuildLevel(int LevelNumber) { if (Controller == null) // just incase we don't have a reference fron the "Start()" { Controller = GameObject.Find("MGC").GetComponent <MGC>(); } int[] LD = TD.GetLevelData(LevelNumber); MakeColumn(); // Get random pair of colours for Tier segments baseColour = PickColour(); contrastColour = baseColour + 1; TierCount = LD.Length; Debug.Log("Tier Count = " + TierCount.ToString()); // Make Tiers // Top Tier ... Orientation -7.5 to ensure bounce on a platform MakeTier((TierCount / 2) + 1, 1, -7.5f); //Remaining Middle Tiers (from LD (Level Data) array) for (int i = 0; i < TierCount - 1; i = i + 2) { MakeTier((i / 2) + 1, LD[i], LD[i + 1]); } // Bottom "Home" Tier MakeTier(0, 0, 0); // Get Controller to make ball Controller.ResetBall(); }
public void BuildRandomLevel() { if (Controller == null) // just incase we don't have a reference fron the "Start()" { Controller = GameObject.Find("MGC").GetComponent <MGC>(); } Level = Controller.CurrentLevel; TierCount = Controller.TiersPerLevel; MakeColumn(); // Get random pair of colours for Tier segments baseColour = PickColour(); contrastColour = baseColour + 1; // Make Tiers // Top Tier ... Orientation -7.5 to ensure bounce on a platform MakeTier(TierCount - 1, 1, -7.5f); //Remaining Middle Tiers for (int i = TierCount - 2; i > 0; i--) { MakeTier(i, Random.Range((int)(TD.GetPossibleTierCount() * 0.75), TD.GetPossibleTierCount()), Random.Range(-180, 181)); //MakeTier(i, 1, 0); // SAfety development tier build for debugging // CAN DELETE LATER } // Bottom "Home" Tier MakeTier(0, 0, 0); // Get Controller to make ball Controller.ResetBall(); }
void Start() { direction = 0; print ("Initial waypoint is: " + currentWaypoint.name); OnTransition = false; mgc = MGC.Instance; this.transform.position = mgc.currentCameraDefaultPosition; this.transform.rotation = currentWaypoint.transform.rotation; //this.transform.position = currentWaypoint.transform.position; }
void Awake() { if (instance) { Debug.Log("Already an MGC (MaxGameController) - going to die now ....."); DestroyImmediate(gameObject); return; } instance = this; DontDestroyOnLoad(gameObject); }
private void cmb_range_SelectedIndexChanged(object sender, EventArgs e) { if (cmb_range.SelectedIndex == 0) { txt_mem_nos.Text = "ALL"; txt_mem_nos.Enabled = false; } else if (cmb_range.SelectedIndex == 1) { txt_mem_nos.Enabled = true; txt_mem_nos.Text = ""; } else { txt_mem_nos.Enabled = false; txt_mem_nos.Text = MGC.GetMemberGroup(cmb_range.Text).MemberNosText; } }
// Use this for initialization void Start() { // Get Game Cpntroller reference Controller = GameObject.Find("MGC").GetComponent <MGC>(); }
void Start() { Controller = GameObject.Find("MGC").GetComponent <MGC>(); screenDimensions = new Vector2(Screen.width, Screen.height); }