void Start() { hElementsGeneratorCS = (ElementsGeneratorCS)GameObject.Find("Player").GetComponent(typeof(ElementsGeneratorCS)); Transform powerups = this.transform.Find("Powerup"); if (powerups == null) { return; } vPowerups = new Transform[powerups.childCount]; int i = 0; foreach (Transform powerup in powerups) { GameObject type = hElementsGeneratorCS.getRandomPowerup(); if (type == null) { Destroy(powerup.gameObject); continue; } vPowerups[i] = ((GameObject)Instantiate(type, powerup.position, powerup.rotation)).transform; vPowerups[i].parent = this.transform; Destroy(powerup.gameObject); i++; } }
void Start() { WaypointAngle = 0.0f; fPathLength = defaultPathLength; fNextPathLength = defaultPathLength; CurrentPercent = 0.0f; hInGameScriptCS = (InGameScriptCS)this.GetComponent(typeof(InGameScriptCS)); hControllerScriptCS = (ControllerScriptCS)this.GetComponent(typeof(ControllerScriptCS)); hPatchesRandomizerCS = (PatchesRandomizerCS)this.GetComponent(typeof(PatchesRandomizerCS)); hElementsGeneratorCS = (ElementsGeneratorCS)this.GetComponent(typeof(ElementsGeneratorCS)); }
void Start() { hInGameScriptCS = (InGameScriptCS)this.GetComponent(typeof(InGameScriptCS)); hCheckPointsMainCS = (CheckPointsMainCS)GetComponent(typeof(CheckPointsMainCS)); hElementsGeneratorCS = (ElementsGeneratorCS)this.GetComponent(typeof(ElementsGeneratorCS)); iCurrentPNum = 1; fPreviousTotalDistance = 0.0f; fPatchDistance = hCheckPointsMainCS.getDefaultPathLength(); instantiateStartPatch(); goPreviousPatch = goCurrentPatch; tPlayer = GameObject.Find("Player").transform; hCheckPointsMainCS.setChildGroups(); hCheckPointsMainCS.SetCurrentPatchCPs(); hCheckPointsMainCS.SetNextPatchCPs(); }