void Start() { listFonts = GameObject.FindGameObjectsWithTag("LifePoint").ToList(); listSpawns = GameObject.FindGameObjectsWithTag("Spawner").ToList(); player = GameObject.FindGameObjectWithTag("Player"); game = GameObject.FindGameObjectWithTag("Game"); nextLevelObj = GameObject.FindGameObjectWithTag("NextLevel"); healthBar = player.GetComponent <HealthBarPlayer>(); sceneLoader = game.GetComponent <SceneLoader>(); nextLevel = nextLevelObj.GetComponent <NextLevel>(); playerCmd = player.GetComponent <PlayerComand>(); for (int i = 0; i < listFonts.Count; i++) { lifeFountain = listFonts[i].GetComponent <LifeFountain>(); } for (int j = 0; j < listSpawns.Count; j++) { handleText = listSpawns[j].GetComponent <HandleTextFile>(); spawnInt.Add(0); } for (int k = 0; k < listTotens.Count; k++) { ctrlMaterial = listTotens[k].GetComponent <ControllMaterial>(); } }
// Use this for initialization void Start() { sphereCast = new SphereCast(); spawmList = GameObject.FindGameObjectsWithTag("Spawner").ToList(); listFonts = GameObject.FindGameObjectsWithTag("LifePoint").ToList(); //lifeFountain = fountain.GetComponentInChildren<LifeFountain>(); shaderCtrl = this.gameObject.GetComponent <ShaderController>(); Player = GameObject.FindGameObjectWithTag("Player"); mover = GetComponent <CharacterController>(); camController = cam.gameObject.GetComponent <CameraController>(); healthBar = gameObject.GetComponent <HealthBarPlayer>(); sphereCast = Player.GetComponent <SphereCast>(); for (int i = 0; i < listFonts.Count; i++) { lifeFountain = listFonts[i].GetComponent <LifeFountain>(); } }