private void Awake() { levelScript = this; fadeInOut.SetActive(true); gameOverMenu.SetActive(false); }
public bool UseItem(LevelScript lvl, GameObject inthisroom) { bool allUsedUp = false; if (name == lvl.GetPrefabName(lvl.PF_FireExtinguisher)) { Transform fire = inthisroom.transform.Find(lvl.GetPrefabName(lvl.PF_Fire)); if (fire != null) { Destroy(fire.gameObject); } // Decrease extinguisher use here TODO } else if (name == lvl.GetPrefabName(lvl.PF_Plank)) { Transform hole = inthisroom.transform.Find(lvl.GetPrefabName(lvl.PF_Hole)); if (hole != null) { lvl.CreateElementInRoom(lvl.PF_PlankBridge, inthisroom); allUsedUp = true; } } return(allUsedUp); }
// Use this for initialization void Start() { parallax = GameObject.Find("Parallax").GetComponent <Parallax>(); script = new LevelScript(levels[0]); lastLevel = script.level; endLevel = new LevelScript(betweenLevels); }
void Start() { _logObject = GameObject.Find(StaticVariables.LogObjectName); _levelScript = GameObject.Find(StaticVariables.LevelObjectName).GetComponent <LevelScript>(); _gameState = GameObject.Find("GameScript").GetComponent <GameScript>().gameState; _apple = _logObject != null?_logObject.transform.Find(StaticVariables.AppleObjectName) : null; }
public static void AssignLevel(LevelScript level) { currentLevel = level; level.gameObject.SetActive(true); PlayerControls.goalScoreTextStatic.text = "" + currentLevel.targetSavedBlueberries; currentScore = 0; }
public TileMap(LevelScript level, int x, int z) { this.Level = level; this.Map = new TileScript[x, z]; this.Size = new Vector2(x, z); this.Tiles = new List <TileScript>(); }
public TileScript Init(LevelScript level, Position p) { this.Edges = new Edge[4]; this.level = level; this.Position = new Position(p); return(this); }
public override void OnInspectorGUI() { LevelScript myTarget = (LevelScript)target; myTarget.experience = EditorGUILayout.IntField("Experience", myTarget.experience); EditorGUILayout.LabelField("Level", myTarget.Level.ToString()); }
public void Navigate(int scene) { switch (scene) { case 0: //menu m_desiredPosition = Vector3.zero; LevelScript ls = FindObjectOfType <LevelScript>(); if (ls != null) { Destroy(ls.gameObject); } m_otherAudioSource.Stop(); m_mainAudioSource.clip = m_menuSong; m_mainAudioSource.Play(); break; case 1: //game m_desiredPosition = Vector3.left * leftMovementCanvas; //1280 m_mainAudioSource.clip = m_gameSong; m_mainAudioSource.Play(); break; case 2: //collectables UpdateCollectableButtons(); m_desiredPosition = Vector3.down * leftMovementCanvas; break; } }
/// <summary> /// Initializes the tile with new data. /// </summary> /// <param name="diamonds">Number of diamonds in the tile.</param> /// <param name="xCoord">x-position in the grid for the tile.</param> /// <param name="yCoord">y-position in the grid for the tile.</param> /// <param name="inLevel">Reference to the level the tile is in.</param> public void Initialize(int diamonds, int xCoord, int yCoord, LevelScript inLevel) { // Attach hint FX var hintP = ObjectPooler.Instance.GetPooledObject(hintParticles.name); hintP.transform.SetParent(transform); hintP.transform.localPosition = new Vector3(0, fxOffset, 0); hintP.SetActive(true); hintFX = hintP.GetComponent <ParticleSystem>(); // Attach explosion FX var explodeP = ObjectPooler.Instance.GetPooledObject(explodedParticles.name); explodeP.transform.SetParent(transform); explodeP.transform.localPosition = new Vector3(0, fxOffset, 0); explodeP.SetActive(true); explodeFX = explodeP.GetComponent <ChildParticleEmitter>(); // Update variables numDiamonds = diamonds; clickable = true; x = xCoord; y = yCoord; level = inLevel; }
//method called everytime when a new inspector is drawn inside Unity public override void OnInspectorGUI() { LevelScript myLevelScript = (LevelScript)target; myLevelScript.experience = EditorGUILayout.IntField("Experience", myLevelScript.experience); //any change done need to be written back EditorGUILayout.LabelField("Level", myLevelScript.Level.ToString()); //read-only; label contronl requires a string value }
void Awake() { masterGame = GetComponentInParent<MasterGameScript>(); foreground = transform.Find ("Camera/Foreground"); level = GetComponentInChildren<LevelScript>(); waves = new List<Wave>(); }
void Awake() { //catapult = spring.connectedBody.transform; lerpScript = GameObject.Find("Main Camera").GetComponent<LerpObjectives>(); projectileFollowScript = GameObject.Find("Main Camera").GetComponent<ProjectileFollow>(); projectileFollowScript.projectile = transform; projectileFollowScript.script = this.gameObject.GetComponent<forceshooting>(); projectileFollowScript.SetCameraToBallPosition(); level = GameObject.Find("ScriptObject").GetComponent<LevelScript>(); totalCheckpoints = level.totalCheckpoints; resetColliders = level.checkpoints; walls = level.walls; newBallPositions = level.ballPositions; newCatapultPositions = level.catapultPositions; force = level.force; level.ball = this.gameObject; createTrail = this.GetComponent<TrajectoryScript1>() as TrajectoryScript1; if(SceneManager.GetActiveScene().name == "DiscoveryClub") { if(projectileFollowScript.finishedTutorial == false) { finishedTutorial = false; } else { finishedTutorial = true; } } }
public override void OnInspectorGUI() { LevelScript ls = (LevelScript)target; ls.exp = EditorGUILayout.IntField("Experience", ls.exp); EditorGUILayout.LabelField("Level", ls.Level.ToString()); }
private void FixedUpdate() { float v = CrossPlatformInputManager.GetAxis("Horizontal"); GetComponent <Rigidbody2D>().velocity = new Vector2(v, 0) * _RacketSpeed; if (GameObject.FindGameObjectsWithTag("brick").Length == 0) { if (SceneManager.GetActiveScene().name == "Level36") { return; } else { Level = FindObjectOfType <LevelScript>(); //Level.Pass(); int currentLevel = SceneManager.GetActiveScene().buildIndex; if (currentLevel >= PlayerPrefs.GetInt("levelIsUnlocked")) { PlayerPrefs.SetInt("levelIsUnlocked", currentLevel + 1); } Debug.Log("LEVEL" + PlayerPrefs.GetInt("levelIsUnlocked") + " UNLOCKED"); } winPanel.SetActive(true); winSound.Play(); Time.timeScale = 0; Debug.Log("You won"); } }
void Awake() { levelGenerator = GameObject.Find(Tags.LEVEL_GENERATOR).GetComponent <LevelScript>(); levelGeneratorPooling = GameObject.Find(Tags.LEVEL_GENERATOR).GetComponent <LevelGeneratorPooling>(); shootBtn = GameObject.Find(Tags.SHOOT_BTN).GetComponent <Button>(); shootBtn.onClick.AddListener(() => Fire()); }
void Awake() { FoundPuzzlePiece = false; _dialogueScript = GameObject.FindGameObjectWithTag("UI").GetComponent <Dialogue>(); //_interfaceScript = GameObject.FindGameObjectWithTag("UI").GetComponent<InterfaceScript>(); _levelScript = GameObject.FindGameObjectWithTag("ScriptHolder").GetComponent <LevelScript>(); }
public void Awake() { //Get all of the scripts InteractionScript = GetComponent <InteractionCommands>(); CommandScript = GetComponent <Commands>(); CombatCommands = GetComponent <CombatCommands>(); MovementCommands = GetComponent <MovementCommands>(); DissectingScript = GetComponent <DissectInputScript>(); DialogueScript = GameObject.FindGameObjectWithTag("UI").GetComponent <Dialogue>(); PlayerScript = GetComponent <Player>(); InterfaceScript = GameObject.FindGameObjectWithTag("UI").GetComponent <InterfaceScript>(); ItemNameListScript = GameObject.FindGameObjectWithTag("ScriptHolder").GetComponent <ItemNameList>(); GameTurnController = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameTurnController>(); if (!GameObject.FindGameObjectWithTag("CommandListHolder")) { Instantiate(gameObject, Vector3.zero, Quaternion.identity); gameObject.tag = "CommandListHolder"; gameObject.name = "CommandListHolder"; gameObject.AddComponent <CommandList>(); CommandListScript = gameObject.GetComponent <CommandList>(); } else { CommandListScript = GameObject.FindGameObjectWithTag("CommandListHolder").GetComponent <CommandList>(); } LevelScript = GameObject.FindGameObjectWithTag("ScriptHolder").GetComponent <LevelScript>(); }
public void Navigate(int scene) { switch (scene) { case 0: //menu UpdateMenuButtons(); m_desiredPosition = Vector3.zero; LevelScript ls = FindObjectOfType <LevelScript>(); if (ls != null) { Destroy(ls.gameObject); } m_otherAudioSource.Stop(); m_mainAudioSource.clip = m_menuSong; m_mainAudioSource.Play(); break; case 1: //game m_desiredPosition = Vector3.left * 1280; m_mainAudioSource.clip = m_gameSong; m_mainAudioSource.Play(); break; } }
void Awake() { _source = FindObjectOfType <AudioSource>(); bsm = new BearStateMachine(); Reset(); ls = FindObjectOfType <LevelScript>(); }
void Start() { level = FindObjectOfType <LevelScript> (); FruitsEaten = FindObjectsOfType <Fruits> ().ToList(); GameStarted += Manager_GameStarted; notification = FindObjectOfType <Notification> (); }
// Start is called before the first frame update void Start() { rigidBody2D = GetComponent <Rigidbody2D>(); playerAnimation = GetComponent <Animator>(); respawnPoint = transform.position; startPoint = transform.position; levelscript = FindObjectOfType <LevelScript>(); }
// Use this for initialization void Start() { animator = GetComponent <Animator>(); audioSource = GetComponent <AudioSource>(); LevelScript = GetComponent <LevelScript>(); audioSource.loop = false; ScoreText.text = "SCORE NEEDED TO OPEN: " + MinimumScoreToActive.ToString(); }
// Start is called before the first frame update void Start() { level1 = Instantiate(Level1Prefab, Vector3.zero, Quaternion.identity).GetComponent <LevelScript>(); level1.Load(); level1.enabled = false; scoreText = Score.GetComponentInChildren <Text>(); MusicController.SoundController(MusicController.SOUNDS.MENU, true); }
// Use this for initialization void Start() { levelScript = FindObjectOfType<LevelScript>(); x = 0; y = INITIAL_DIRECTION; enemyRadius = GetComponent<CircleCollider2D>().radius; lastShotTime = -50; }
private void Start() { Level = FindObjectOfType <LevelScript>(); ThePlayer.transform.position = new Vector3(-Toolbox.TileSizeX / 2f, 0f, ThePlayer.transform.position.z); _caveHandler = FindObjectOfType <CaveHandler>(); _villageSequencer = GameObject.FindGameObjectWithTag("Scripts").AddComponent <VillageSequencer>(); StartCoroutine("LoadSequence"); }
private void CountBreakableBlocks() { if (tag == "Breakable") { level = FindObjectOfType <LevelScript>(); level.blockAdded(); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.tag == "Player") { LevelScript.OnFinish(); FindObjectOfType <AudioManager>().Play("Win"); } }
LevelScript level; //instantiate Level type and as a reference private void Start() { level = FindObjectOfType <LevelScript>(); //assign level to be a level type if (tag == "Breakable") //only count blocks we can break { level.CountLevelBlocks(); //+1 to the number of breakable blocks //every block instance has this script so it should correctly count the number of blocks we can break in a level } }
private void CountBreakableBlocks() { //Encontrar el objeto con el script level = FindObjectOfType <LevelScript>(); if (tag == "Breakable") { level.CountBlocks(); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.name.StartsWith("Ball")) { Ball.complete = true; SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); LevelScript.Pass(); } }
void Start() { gameManager = GameManager.singleton; level = gameManager.level; speed = level.speed; speed2 = level.speed2; InitializingBackground(); }
void Awake() { masterGame = GetComponentInParent<MasterGameScript>(); foreground = transform.Find ("Camera/Foreground"); playerCamera = GetComponentInChildren<Camera>(); revengeSpawner = GetComponentInChildren<RevengeSpawner>(); level = GetComponentInChildren<LevelScript>(); waves = new List<Wave>(); }
// Start is called before the first frame update void Start() { _levelScript = levelBaseGameObject.GetComponentInChildren <LevelScript>(); _playerTransform = this.GetComponent <Transform>(); waypoints = _levelScript.getWaypoints(); transform.position = waypoints[(MenuScreenLoadParam.currentLevel - 1) * 3].position; currWaypointIdx = (MenuScreenLoadParam.currentLevel - 1) * 3; currLoc = MenuScreenLoadParam.currentLevel; }
// Use this for initialization void Awake() { lScript = this; if (!PlayerPrefs.HasKey ("Played")) { PlayerPrefs.SetInt("Played",0); } curLevel=PlayerPrefs.GetInt("CurrentLevel"); if ((PlayerPrefs.GetInt ("Played")) < curLevel) PlayerPrefs.SetInt ("Played", curLevel); }
// Use this for initialization void Start () { Frame = Instantiate(Resources.Load("Prefab/Frame"), Vector3.zero, Quaternion.identity) as GameObject; Frame.transform.parent = gameObject.transform; Frame.SetActive(false); CameraControls = Camera.main.GetComponent<CameraController>(); LS = this.gameObject.GetComponentInChildren<LevelScript>(); NowClic = false; UICam = NGUITools.FindCameraForLayer(8); // Debug.Log(UICam.name); }
public void Start() { InstantiatePlayer(); _stars = new List<ShrinkStars>(); _stars = FindObjectsOfType<ShrinkStars>().ToList<ShrinkStars>(); Instance = this; _currentNumberOfLives = MaxNumberOfLives; if (Player == null) { Debug.LogError("Assign Player to LevelScript!"); Application.Quit(); } }
void Awake() { rnd = new System.Random(); GetComponent<TrailRenderer>().enabled = false; isBoosted = false; level = GameObject.Find("Level").GetComponent<LevelScript>(); shootLogic = GetComponent<ShootLogicV3>(); if (GameObject.Find("GameManager")) { manager = GameObject.Find("GameManager").GetComponent<GameManagerScript>(); camShake = GameObject.Find("GameManager").GetComponent<CameraShakeScript>(); cam = Camera.main; } amountOfHits = 0; anim = GetComponent<Animator>(); }
override protected void Start() { base.Start(); levelScript = FindObjectOfType<LevelScript>(); uiManager = FindObjectOfType<UIManagerScript>(); ScriptRobot.Health = ScriptRobot.MaxHealth; (ScriptRobot.CharacterController as RobotController).AttackDelay = ScriptRobot.AttackDelay; (ScriptRobot.CharacterController as RobotController).JumpDelay = ScriptRobot.JumpDelay; characterShootingHeight = -0.1f; if (projectile) { projectile.ScriptProjectile = new Projectile(ScriptRobot.ShotsDamage, ScriptRobot.ShotsSpeed); } robotAnimator = GetComponent<Animator>(); }
/// <summary> /// Initializes the tile with new data. /// </summary> /// <param name="diamonds">Number of diamonds in the tile.</param> /// <param name="xCoord">x-position in the grid for the tile.</param> /// <param name="yCoord">y-position in the grid for the tile.</param> /// <param name="inLevel">Reference to the level the tile is in.</param> public void Initialize(int diamonds, int xCoord, int yCoord, LevelScript inLevel) { // Attach hint FX var hintP = ObjectPooler.Instance.GetPooledObject(hintParticles.name); hintP.transform.SetParent(transform); hintP.transform.localPosition = new Vector3(0, fxOffset, 0); hintP.SetActive(true); hintFX = hintP.GetComponent<ParticleSystem>(); // Attach explosion FX var explodeP = ObjectPooler.Instance.GetPooledObject(explodedParticles.name); explodeP.transform.SetParent(transform); explodeP.transform.localPosition = new Vector3(0, fxOffset, 0); explodeP.SetActive(true); explodeFX = explodeP.GetComponent<ChildParticleEmitter>(); // Update variables numDiamonds = diamonds; clickable = true; x = xCoord; y = yCoord; level = inLevel; }
void Start() { objects = new List<GameObject>(); planets = new GameObject[2]; planets[0] = GameObject.Find("StartingPlanet"); player = GameObject.Find("Player"); camera = GameObject.Find("Main Camera"); go = GameObject.Find("Canvas"); leveldata = new LevelScript[levelCount]; for (int i = 0; i < levelCount; ++i) { leveldata[i] = new LevelScript(); } CreateLevelData (); persistentData = GameObject.Find("PersistentData").GetComponent<PersistentData>(); currentLevel = persistentData.currentLevelID - 1; go.SetActive(false); planets[0].GetComponent<PlanetScript>().planetID = currentLevel; planets[0].GetComponent<Renderer>().material = planetMats[currentLevel % 5]; BuildLevel(); }
public override void Start() { base.Start(); level = (LevelScript) parentGame.GetComponentInChildren (typeof(LevelScript)); }
void Awake() { ball = GameObject.Find("Ball").GetComponent<BallScript>(); level = GameObject.Find("Level").GetComponent<LevelScript>(); }
void Awake() { level = GameObject.Find("Level").GetComponent<LevelScript>(); }
// Use this for initialization void Start () { script = GetComponent<LevelScript>(); cameraScript = GameObject.Find("Main Camera").GetComponent<ProjectileFollow>(); }