void Start() { game = false; gameOver = false; app = GameObject.Find("__app"); appScript = app.GetComponent <__app>(); HPText.text = HP.ToString(); gameOverText = ""; Currency = __app.baseCurrency; // Load Level level = Resources.Load("Prefabs/Levels/" + appScript.getLevel()) as GameObject; Instantiate(level); // Find and load waypoints GameObject[] foundWaypoints = GameObject.FindGameObjectsWithTag("Waypoint"); waypoints = new GameObject[foundWaypoints.Length]; // Debug.Log("Waypoints: " + foundWaypoints.Length.ToString()); for (int i = 0; i < foundWaypoints.Length; i++) { foreach (GameObject way in foundWaypoints) { if (way.name == "Waypoint" + i.ToString()) { waypoints[i] = way; } } } startGame(); startNextWave = false; }
public void manualStart() { baseDamages = __app.antibiotics[antibioticType]; color = __app.colors[antibioticType]; towerNickname.text = antibioticType.ToUpper(); if (tag == "MenuItems") { ammoBarWhole.SetActive(false); } if (type == 1) { lr = gameObject.transform.GetChild(1).GetComponent <LineRenderer>(); lr.positionCount = 2; lr.startColor = color; lr.endColor = color; lr.SetPosition(0, new Vector3(0, 0, 0)); } if (type == 2) { appScript = GameObject.Find("__app").GetComponent <__app>(); } ellipseDetectionRadius = new Vector2(detectionRadius, detectionRadius * __app.ellipseYMult); //ammo maxAmmo = __app.maxAmmo; ammo = maxAmmo; //Set Color ammoBar.color = __app.colors[antibioticType]; }
void Start() { mainMenuCoordinates = new Dictionary <string, Vector2>() { { "MainMenu", new Vector2(0f, 0f) }, { "PlayMenu", new Vector2(0f, 10f) }, { "Game", new Vector2(0f, 30f) }, { "OptionsMenu", new Vector2(0f, -10f) }, { "Encyclopedia", new Vector2(-30f, 0f) }, { "labMain", new Vector2(0f, 0f) }, { "labData", new Vector2(0f, 10f) }, { "labLogbook", new Vector2(-17.8f, 0f) }, }; app = GameObject.Find("__app"); appScript = app.GetComponent <__app>(); sceneGuy = app.GetComponent <SceneGuy>(); scene = sceneGuy.currentScene; previousScene = sceneGuy.previousScene; //screen = scene; determineStartPos(); xOffset = 0; yOffset = 0; if (scene == "MainMenu") { GameObject.Find("Strep").GetComponent <Animator>().Play("strep"); GameObject.Find("Staph").GetComponent <Animator>().Play("staph"); GameObject.Find("TB").GetComponent <Animator>().Play("TB"); GameObject.Find("Pneu").GetComponent <Animator>().Play("pneu"); } else if (scene == "Encyclopedia") { } }
// Use this for initialization void Start() { app = GameObject.Find("__app"); appScript = app.GetComponent <__app>(); updateMusicText(); updateSFXText(); updateScreenshakeText(); }
//Upon successful purchase of tower, detach it from the menu. void detachFromMenu() { gameObject.tag = "Tower"; shadow.tag = "TowerShadow"; myTower.ammoBarWhole.SetActive(true); gameObject.transform.SetParent(null); // Increase mutation probability. __app appScript = GameObject.Find("__app").GetComponent <__app>(); appScript.increaseMutationChanceForAntibiotic(myTower.antibioticType); }
void Start() { logbookDrop = Resources.Load("Prefabs/LogbookUnlock") as GameObject; health = maxHealth; game = GameObject.Find("Game"); level = GameObject.FindGameObjectWithTag("Level"); appScript = GameObject.Find("__app").GetComponent <__app>(); audioObject = GameObject.Find("AudioObject"); baseProfitPerEnemy = __app.baseCurrencyPerKill; setDestination(); }
public void reloadTowerAmmo() { if (SelectedTower != null) { Tower tScript = SelectedTower.GetComponent <Tower>(); int cost = calcReloadCost(); if (cost <= gameManager.Currency) { gameManager.Currency -= cost; tScript.ammo = tScript.maxAmmo; __app appScript = GameObject.Find("__app").GetComponent <__app>(); appScript.increaseMutationChanceForAntibiotic(tScript.antibioticType, ((float)cost / tScript.cost) * reloadCostDiv); } } }
void Start() { appScript = GameObject.Find("__app").GetComponent <__app>(); appScript.giveMutationBarsScript(this); }