public override void Reset() { base.Reset(); spawner = null; m_rigidBody.enabled = false; activated = false; }
private void Start() { Application.targetFrameRate = 60; saveLoadManager = GetComponentInChildren <SaveLoadManager>(); savedData = saveLoadManager.LoadData(); fruitSpawner = GetComponentInChildren <FruitSpawner>(); if (saveLoadManager.GetTutorialStatus()) { fruitSpawner.Init(); } scoreManager = GetComponentInChildren <ScoreManager>(); scoreManager.Init(savedData); guiManager = GetComponentInChildren <GuiManager>(); guiManager.Init(saveLoadManager); powerupSpawner = GetComponentInChildren <PowerupSpawner>(); powerupSpawner.Init(savedData); cameraController.Init((CameraStatus)saveLoadManager.GetCameraStatus(), saveLoadManager.GetScreenOrientationStatus()); styleManager = GetComponentInChildren <StyleManager>(); styleManager.Init(savedData); playStoreManager = GetComponentInChildren <PlayStoreManager>(); playStoreManager.Init(); achievementManager = GetComponentInChildren <AchievementManager>(); adManager = GetComponentInChildren <AdManager>(); soundManager = GetComponentInChildren <SoundManager>(); soundManager.Init(saveLoadManager); soundManager.PlaySound(SoundEffectType.SOUND_SLITHER, false); }
private void Awake() { if (instance == null) { instance = this; } }
// Use this for initialization void Start() { spawner = GameObject.Find("Powerups").GetComponent <PowerupSpawner> (); ScoringObject = GameObject.Find("Camera").GetComponent <ScoreKeeper> (); controller = GameObject.Find("GameController").GetComponent <GameController> (); hit = GameObject.Find("PowerupSound").GetComponent <AudioSource> (); rotateSpeed = 50; moveSpeed = 4; }
void Start() { _powerupSpawnManager = GameObject.Find("PowerupSpawner").GetComponent <PowerupSpawner>(); _uiManager = GameObject.Find("Canvas").GetComponent <UIManager>(); // Display the startup title Screen _uiManager.ShowTitleScreen(); previousScore = 0; }
//Methods void Awake() { if (instance != null) { Destroy(gameObject); return; } instance = this; powerups = new List<GameObject>(); player = GameObject.FindGameObjectWithTag("Player").transform; }
private void Start() { player = GameObject.Find("Player").transform; powerupSpawner = GameObject.Find("Powerups Manager").GetComponent <PowerupSpawner>(); swipeControl = player.gameObject.GetComponent <SwipeControl>(); myCopyOfMaterial = new Material(material); myCopyOfMaterial.EnableKeyword("_Emission"); myCopyOfMaterial.SetColor("_EmissionColor", Color.clear); meshRenderer.sharedMaterial = myCopyOfMaterial; currentHealth = health; }
public override void Pickup(ChadControls chad, Transform hand) { base.Pickup(chad, hand); if (spawner) { spawner.Free(); spawner = null; //Debug.Log("Cleared spawner"); } }
private void Start() { if (Instance != null) { Destroy(gameObject); return; } Instance = this; StartCoroutine(SpawnPowerups(timeBetweenSpawns, maximumDistanceDelta)); }
// Start is called before the first frame update void Start() { player = GameObject.FindGameObjectWithTag("Eater").transform; lastSpawnPoint = GameObject.FindGameObjectWithTag("LastSpawnPoint"); lastPowerupPosition = GameObject.FindGameObjectWithTag("LastPowerupSpawnPoint"); lastCollectiblePoint = GameObject.FindGameObjectWithTag("LastCollectibleSpawnPoint"); spawner = GameObject.FindGameObjectWithTag("Spawner").GetComponent <Spawner>(); powerupSpawner = GameObject.FindGameObjectWithTag("PowerupSpawner").GetComponent <PowerupSpawner>(); collectibleSpawner = GameObject.FindGameObjectWithTag("CollectibleSpawner").GetComponent <CollectibleSpawner>(); powerupSpawnDifference = maxSpawnDifference; collectibleSpawnDifference = maxSpawnDifference; }
public static void Reset() { IsPowerupActive = false; PowerUpStartTime = Time.time; IsInvincible = false; IsSlow = false; IsFast = false; IsReverse = false; TimeText.text = string.Empty; PowerUpEndTime = Time.time; PowerupSpawner.ClearActivePowerups(); }
void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; // DontDestroyOnLoad(gameObject); } powerups = new GameObject("powerups"); }
public void RPCRemove() { RPCDrop(); if (spawner) { if (spawner.isOwner) { spawner.Free(); } spawner = null; } MatchSystem.instance.PowerupManager.RecyclePowerup(this); }
// Start is called before the first frame update void Start() { RedMissilesRemaining = (((RedMissilesToSpawn * levelNumber) + (levelNumber * 2)) * numberOfWaves); gameState = GameState.Playing; thisRedMissileSpawner = FindObjectOfType <RedMissileSpawner>(); thisPowerupSpawner = FindObjectOfType <PowerupSpawner>(); if (difficulty == 1) { if (CheckLucky()) { this.thisPowerupSpawner.spawnPowerUp(); } thisRedMissileSpawner.wave((RedMissilesToSpawn * levelNumber + (levelNumber * 2)), waveDelay); //level*2 = 4 Invoke(("CheckState"), 1.0f); thisRedMissileSpawner.wave((RedMissilesToSpawn * levelNumber + (levelNumber * 2)), waveDelay + 7.0f); //level*2 + 2 = 4 Invoke(("CheckState"), 1.0f + 7.0f); } else if (difficulty == 2) { if (CheckLucky()) { this.thisPowerupSpawner.spawnPowerUp(); } thisRedMissileSpawner.wave((RedMissilesToSpawn * levelNumber + (levelNumber * 2)), waveDelay); Invoke(("CheckState"), 1.0f); thisRedMissileSpawner.wave((RedMissilesToSpawn * levelNumber + (levelNumber * 2)), waveDelay + 7.0f); Invoke(("CheckState"), 1.0f + 7.0f); thisRedMissileSpawner.wave((RedMissilesToSpawn * levelNumber + (levelNumber * 2)), waveDelay + 14.0f); Invoke(("CheckState"), 1.0f + 14.0f); } else if (difficulty == 3) { if (CheckLucky()) { this.thisPowerupSpawner.spawnPowerUp(); } thisRedMissileSpawner.wave((RedMissilesToSpawn * levelNumber + (levelNumber * 2)), waveDelay); Invoke(("CheckState"), 1.0f); thisRedMissileSpawner.wave((RedMissilesToSpawn * levelNumber + (levelNumber * 2)), waveDelay + 7.0f); Invoke(("CheckState"), 1.0f + 7.0f); thisRedMissileSpawner.wave((RedMissilesToSpawn * levelNumber + (levelNumber * 2)), waveDelay + 14.0f); Invoke(("CheckState"), 1.0f + 14.0f); thisRedMissileSpawner.wave((RedMissilesToSpawn * levelNumber + (levelNumber * 2)), waveDelay + 21.0f); Invoke(("CheckState"), 1.0f + 21.0f); } Invoke(("CheckState"), 1.0f + (numberOfWaves * 10.0f)); }
// Use this for initialization void Start() { gameState = 0; ballSpawn = new Vector3(12.0f, 12.0f, 5.0f); cameraPosGame = new Vector3(0f, 18.6f, -21.5f); cameraPosMenu = new Vector3(40.0f, 20.0f, -25.0f); cameraRotGame = new Vector3(15.0f, 0, 0); cameraRotMenu = new Vector3(20.0f, -45.0f, 0f); ballRotation = Quaternion.identity; initBall = true; flipperTextActive = true; PowerSpawner = GameObject.Find("Powerups").GetComponent <PowerupSpawner> (); ScoringObject = GameObject.Find("Camera").GetComponent <ScoreKeeper> (); cameraPosition = camera.GetComponent <Transform> (); music.Play(); }
private void Awake() { instance = this; mainObstacleSpawner = obstacleContainer.GetComponent <ObstacleSpawner>(); mainPowerupSpawner = powerupContainer.GetComponent <PowerupSpawner>(); mainLineController = mainLine.GetComponent <LineController>(); starsPS = stars.GetComponent <ParticleSystem>(); powerupSlider = HUDCanvas.transform.Find("PowerupSlider").GetComponent <Slider>(); progressSlider = HUDCanvas.transform.Find("ProgressSlider").GetComponent <Slider>(); pressSpaceText = powerupSlider.transform.Find("PressSpaceText").GetComponent <Text>(); pressSpaceText.text = ""; dialoguePanel = dialogueCanvas.transform.Find("DialoguePanel").gameObject; normalDialogue = dialoguePanel.transform.Find("NormalDialogue").GetComponent <Text>(); importantDialogue = dialoguePanel.transform.Find("ImportantDialogue").GetComponent <Text>(); nextButton = dialoguePanel.transform.Find("NextButton").gameObject; goodButton = dialoguePanel.transform.Find("GoodButton").gameObject; }
private void OnTriggerEnter(Collider other) { _ability = GetComponent <BaseAbility>(); PhotonView pv = PhotonView.Get(this); if (other.gameObject.tag == "Player") { AbilityManager aManager = other.GetComponent <AbilityManager>(); aManager.AddAbility(_ability); PowerupSpawner pSpawn = spawner.GetComponent <PowerupSpawner>(); pSpawn.hasPickup = false; PhotonNetwork.Destroy(gameObject); if (photonView.isMine) { PhotonNetwork.Destroy(photonView); } } }
public void TakeDamage(int demage) { if (HP <= 0) { return; } HP -= demage; if (HP <= 0) { hpBar.SetBar(0f, maxHp); PowerupSpawner PowerupSpawner_Instance = gameObject.GetComponent <PowerupSpawner>(); PowerupSpawner_Instance.Spawn(); Destroy(gameObject); } else { hpBar.SetBar(HP, maxHp); } }
private void Start() { saveLoadManager = GetComponentInChildren <SaveLoadManager>(); savedData = saveLoadManager.LoadData(); fruitSpawner = GetComponentInChildren <FruitSpawner>(); if (saveLoadManager.GetTutorialStatus()) { fruitSpawner.Init(); } scoreManager = GetComponentInChildren <ScoreManager>(); scoreManager.Init(savedData); guiManager = GetComponentInChildren <GuiManager>(); guiManager.Init(saveLoadManager); powerupSpawner = GetComponentInChildren <PowerupSpawner>(); powerupSpawner.Init(savedData); cameraController.Init(); styleManager = GetComponentInChildren <StyleManager>(); styleManager.Init(savedData); soundManager = GetComponentInChildren <SoundManager>(); soundManager.Init(saveLoadManager); soundManager.PlaySound(SoundEffectType.SOUND_SLITHER, false); }
public override void OnRead(NetDataReader reader, bool initialState) { base.OnRead(reader, initialState); int spawnerID = reader.GetInt(); if ((!spawner && spawnerID != -1) || (spawner && spawner.ID != spawnerID)) { Reset(); spawner = MatchSystem.instance.Scene.FindNetworkObject(spawnerID)?.gameObject.GetComponent <PowerupSpawner>(); } if (spawnerID == -1) { spawner = null; } bool newActivation = reader.GetBool(); if (!activated && newActivation) { OnActivate(); } activated = newActivation; }
// Start is called before the first frame update void Awake() { Instance = this; hayMachine = FindObjectOfType <HayMachine>(); powerupSpawner = FindObjectOfType <PowerupSpawner>(); }
void Start() { boardManager = GetComponent <BoardManager>(); powerupSpawner = GetComponent <PowerupSpawner>(); powerupSpawner.gameObject.SetActive(false); }
void Start() { // store the PowerupSpawner component attached to this section (if there is one) powerupSpawner = GetComponent <PowerupSpawner>(); }
/// <summary> /// Respawn all powerups in the level. /// </summary> private void SpawnPowerups() { FindSpawnManager(); powerupSpawner = spawnManager.GetComponent <PowerupSpawner>(); powerupSpawner.SpawnPowerups(); }