// Start is called before the first frame update void Start() { ss = GameObject.Find("Spawn").GetComponent <SpawnScript>(); time = gameObject.GetComponent <Text>(); cl = GameObject.Find("Question").GetComponent <ColorManager>().checkWarna; ClientSend.ColorRequest(); }
//Variables End------------------------------------ void Start() { if (networkView.isMine) { myTransform = transform; cameraHeadTransform = myTransform.FindChild("CameraHead"); //Find the SpawnManager and access the SpawnScript to find out which team the player is on. GameObject spawnManager = GameObject.Find("SpawnManager"); SpawnScript spawnScript = spawnManager.GetComponent <SpawnScript>(); if (spawnScript.amIRed == true) { iAmRed = true; } if (spawnScript.amIBlue == true) { iAmBlue = true; } } else { enabled = false; } }
// Update is called once per frame void Update() { if (!gameOver) { if (health <= 0) { makeGameOver(); SpawnScript spawn = GameObject.Find("Spawn").GetComponent("SpawnScript") as SpawnScript; spawn.makeGameOver(false); } move(); rotate(); if (Input.GetButtonDown("Fire1")) { if (barks > 0) { shoot(); } } updateAmmoSlider(); updateHealthSlider(); Vector3 camPosition = new Vector3(Camera.main.transform.position.x, Camera.main.transform.position.y, -10); if (transform.position.x > -9.66f && transform.position.x < 9.66f) { camPosition.x = transform.position.x; } if (transform.position.y > -5.8f && transform.position.y < 5.8f) { camPosition.y = transform.position.y; } Camera.main.transform.position = camPosition; } }
/* Sets up the room by spawning enemies and subscribing to all their death events. */ private void Awake() { spawner = gameObject.transform.Find("SpawnPoints").gameObject.GetComponent <SpawnScript>(); spawnedEnemies = spawner.SpawnEnemies(); numEnemies = spawnedEnemies.Count; SubscribeToEnemyDeath(); }
void Awake() { instance = this; gridSize = GameManager.Instance.gridSize; FixCamera(); int numberOfSpawns = 15; for (int n = 0; n < numberOfSpawns; n++) { GameObject spawn = Instantiate(Resources.Load("Prefabs/SpawnHolder"), Vector3.zero, Quaternion.identity) as GameObject; spawn.transform.SetParent(GameObject.Find("Spawn Locations").transform); spawn.name = "Spawn " + n; spawn.tag = "Spawn"; Vector3 pos = new Vector3(-spawnSpacingX * (n % spawnColumns), ((n / spawnColumns) * spawnSpacingY), 0); spawn.transform.position = pos + spawnPos; Transform background = spawn.transform.Find("Spawn Background"); background.localScale = Vector3.one * blockScale * blockSize; background.localPosition = Vector3.one * blockScale; Transform rotButton = spawn.transform.Find("Rotation Button"); rotButton.localScale = Vector3.one * blockScale * 0.8f; rotButton.localPosition = new Vector3(2.5f * blockScale, -rotButton.localScale.x / 2, -2); rotButton.GetComponent <RotationScript>().spawnNumber = n; spawnLocations.Add(spawn); } }
public void WriteTest() => File.OpenRead(FileName).Using(x => Helpers.AssertStream(x, stream => { var outStream = new MemoryStream(); SpawnScript.Write(outStream, SpawnScript.Read(stream)); return(outStream); }));
// Use this for initialization void Start() { myTransform = transform; spawn = GameObject.Find("SpawnManager").GetComponent <SpawnScript>(); StartCoroutine(DestroyMyselfAfterSomeTime()); // As soon as the projectile is instantiated start a countdown to destroy it. }
// Use this for initialization void Start() { if (networkView.isMine == true) { myTransform = transform; firePointTransform = myTransform.FindChild("FirePoint"); manaScript = gameObject.GetComponent <Mana>(); fireProjectile = GetComponent <FireProjectile>(); spawn = GameObject.Find("SpawnManager").GetComponent <SpawnScript>(); if (spawn.amIOnTheRedTeam == true) { iAmOnTheRedTeam = true; } if (spawn.amIOnTheBlueTeam == true) { iAmOnTheBlueTeam = true; } } else { enabled = false; } source = gameObject.GetComponent <AudioSource>(); }
//right click is 1 //left click is 0 //middle button is 2 void Start() { rightClickMenu = false; //itemDropdownMenuScript = GetComponent<ItemDropdownMenu>(); storedLocations = new Stack <Vector3>(); sizeText = sizeTextObject; visualText = visualTextObject; playerTransform = GetComponentInParent <Transform>(); agent = gameObject.GetComponent <NavMeshAgent>(); inventory = FindObjectOfType <Inventory>(); moveAwayScript = FindObjectOfType <MoveAwayFromObstruction>(); trackItemsScript = FindObjectOfType <SpawnAndTrackItems>(); spawnScriptReference = trackItemsScript.gameObject.GetComponent <SpawnScript>(); itemMouseover = mouseover; Rect rt = itemMouseover.GetComponent <RectTransform>().rect; mouseOverOffset = new Vector3(-6 + -rt.width, 5 + rt.height, 0); players = 1 << LayerMask.NameToLayer("Player"); itemLayerMask = 1 << LayerMask.NameToLayer("Item"); groundLayerMask = 1 << LayerMask.NameToLayer("Level"); obstructions = 1 << LayerMask.NameToLayer("Obstruction"); itemsGroundObstructions = itemLayerMask | groundLayerMask | obstructions; itemsPlayersObstructionsMask = itemLayerMask | obstructions | players; }
// Use this for initialization void Start() { if (networkView.isMine) { myTransform = transform; firePointTransform = myTransform.FindChild("FirePoint"); menu = GameObject.Find("MultiplayerManager").GetComponent <Menu>(); inv = gameObject.GetComponent <InventoryGrid>(); sk = gameObject.GetComponent <ShopKeeper>(); spawn = GameObject.Find("SpawnManager").GetComponent <SpawnScript>(); if (spawn.amIOnTheRedTeam) { iAmOnTheRedTeam = true; } if (spawn.amIOnTheBlueTeam) { iAmOnTheBlueTeam = true; } } else { enabled = false; } source = gameObject.GetComponent <AudioSource>(); }
IEnumerator SpawnMove(SpawnScript spawn, GameObject obj) { List <Vector2> flightpath = new List <Vector2>(); int i = 0; foreach (Vector2 vec in spawn.waypoints) { flightpath.Add(spawn.waypoints[i]); if (i - 1 >= 0 && spawn.waitAtPoint.Length != 0 && spawn.secsToWait.Length == spawn.waitAtPoint.Length && spawn.secsToWait[i - 1] != 0) { yield return(new WaitForSeconds(spawn.secsToWait[i - 1])); } while (obj && Vector2.Distance(obj.transform.position, vec) > .10f) { if (obj) { Vector2 start = obj.transform.position; if (start.Equals(vec)) { break; } obj.transform.position = Vector2.MoveTowards(obj.transform.position, vec, Time.deltaTime * spawn.speed); yield return(null); } } ; i++; } }
// Use this for initialization void Start() { if (networkView.isMine) { shopButton = new Rect(nativeWidth - 560, nativeHeight - 50, 100, 40); hoverBox = new Rect(nativeWidth / 2 - 280, nativeHeight / 2 - 250, 200, 200); hoverLabel = new Rect(nativeWidth / 2 - 275, nativeHeight / 2 - 230, 190, 190); tex = null; inv = gameObject.GetComponent <InventoryGrid>(); spawn = GameObject.Find("SpawnManager").GetComponent <SpawnScript>(); soundEffects = GameObject.Find("AudioEffectsManager").GetComponent <SoundEffects>(); itemBuyValue = new float[6] { 40f, 50f, 30f, 25f, 60f, 20f }; itemSellValue = new float[6] { 20f, 25f, 15f, 10f, 30f, 10f }; typeOfPotion = new string[6] { "Health", "Mana", "Speed", "Attack Damage", "Max Health", "Spell Damage" }; itemEffectValue = new int[6] { 30, 40, 100, 20, 50, 20 }; } else { enabled = false; } }
// Use this for initialization void Start() { if (networkView.isMine == true) { myTransform = transform; spawn = GameObject.Find("SpawnManager").GetComponent <SpawnScript>(); manaScript = gameObject.GetComponent <Mana>(); meleeScript = gameObject.GetComponent <MeleeSystem>(); if (spawn.amIOnTheRedTeam == true) { iAmOnTheRedTeam = true; } if (spawn.amIOnTheBlueTeam == true) { iAmOnTheBlueTeam = true; } } else { enabled = false; } source = gameObject.GetComponent <AudioSource>(); }
// Start is called before the first frame update void Start() { BoxToHit = GameObject.Find("BoxToHit"); BoxToHitTransform = GameObject.Find("BoxToHit").GetComponent <Transform>(); youFailedIt = GameObject.Find("YouFailedIt").GetComponent <Animator>(); youDidIt = GameObject.Find("YouDidIt").GetComponent <Animator>(); _SpawnScript = GameObject.Find("Spawner").GetComponent <SpawnScript>(); spawnBool = true; if (PlayerPrefs.GetInt("BonusMultiplicator") == 1) { moveSpeed = 0.75f; } else if (PlayerPrefs.GetInt("BonusMultiplicator") == 2) { BoxToHitTransform.localScale -= new Vector3(0.5f, 0, 0); moveSpeed = 0.75f; } else if (PlayerPrefs.GetInt("BonusMultiplicator") == 3) { BoxToHitTransform.localScale -= new Vector3(0.5f, 0, 0); moveSpeed = 0.75f; } else if (PlayerPrefs.GetInt("BonusMultiplicator") == 4) { BoxToHitTransform.localScale -= new Vector3(0.5f, 0, 0); moveSpeed = 1f; } }
// Update is called once per frame void Update() { HealthShow = Health; Tijd += 1 * Time.deltaTime; if (transform.position.x < 12) { //update position to a new vector3(x,y,z). the x variable determines the speed of the object transform.position = transform.position + new Vector3(speed * Time.deltaTime, 0, 0); } if (transform.position.x >= 12) { GameObject w = GameObject.Find("Castle"); CastleHealth castleHealth = w.GetComponent <CastleHealth>(); castleHealth.currentwallHP -= 0.5f * Time.deltaTime; castleHealth.healthText.text = "Health: " + castleHealth.currentwallHP.ToString("0") + "%"; if (castleHealth.currentwallHP <= 0) { castleHealth.healthText.text = "Game over."; GameObject s = GameObject.Find("Spawner"); SpawnScript spawnScript = s.GetComponent <SpawnScript>(); spawnScript.stopSpawning = true; } } if (Health <= 0) { //destroy gameobject attached to this script Destroy(this.gameObject); } }
// Start is called before the first frame update void Start() { playerInRangePizza1 = false; playerInRangePizza2 = false; eatingTimeSet1 = false; eatingTimeSet2 = false; scoreScript = FindObjectOfType <ScoreScript>(); spawner = FindObjectOfType <SpawnScript>(); endScript = FindObjectOfType <EndScript>(); }
void Start() { spawn = gameObject.GetComponent <SpawnScript>(); windowRect = new Rect(0, nativeHeight - 200, 500, 200); soundEffects = GameObject.Find("AudioEffectsManager").GetComponent <SoundEffects>(); }
private void Start() { animControll = GetComponent <Animator>(); fireTriggerHash = Animator.StringToHash("Fire"); sRender = GetComponent <SpriteRenderer>(); normalSprite = sRender.sprite; audioSource = GetComponent <AudioSource>(); bulletSpawnScript = GetComponent <SpawnScript>(); }
private void OnDestroy() { SpawnScript ss = FindObjectOfType <SpawnScript>(); if (ss) { ss.currentEnemy--; } }
void Awake() { highlightBox = transform.Find("chkHighlight").gameObject; playerRigid = GetComponent <Rigidbody>(); nowRot = transform.localRotation; playerCamera = GameObject.Find("Camera").GetComponent <Camera>(); cameraAni = playerCamera.GetComponent <Animator>(); playerAniCon = GetComponent <AnimationController>(); sceneName = SceneManager.GetActiveScene().name; if (sceneName == "ItemCollectScene") { playerSpeed = 3; s_itemBtn = GameObject.Find("itemBtnCanvas/btn_GetItem").GetComponent <ItemBtn>(); canvas = GameObject.Find("Canvas"); Block = null; } else if (sceneName == "GameScene") { DontDestroyOnLoad(transform.parent); GM = GameObject.Find("GameMgr2/itemFieldCntrl").GetComponent <ItemFieldCntrl>(); sockServObj = GameObject.Find("GameMgr2/MatchingCntrl"); playerInfo = sockServObj.GetComponent <GameEnterScript>(); weaponNum = playerInfo.savCharInfo.weapon; spawnInfo = sockServObj.GetComponent <SpawnScript>(); shotMgr = GetComponentInChildren <ShotManager>(); shotMgr.ShotPosChange(weaponNum); shotMgr.point = GameObject.Find("PointPrefab"); shotMgr.point.SetActive(false); StartCoroutine(MoveDelay()); //플레이어의 정보 전송하는 코루틴 hpText = GameObject.Find("Canvas").transform.GetChild(0).GetComponent <Text>(); playerHPBar = GameObject.Find("Canvas").transform.GetChild(3).GetComponent <HpBar>(); Block = GameObject.Find("Canvas").transform.GetChild(4).gameObject; s_itemSpawn = GameObject.Find("itemSpawnArr").GetComponent <ItemSpawn>(); s_hitEffect = GameObject.Find("HitEffect").GetComponent <hitEffect>(); ChinkEffect = GameObject.Find("ChinkEffect"); ItemImg = new GameObject[4]; ItemImg[(int)eITEM.em_HP_POTION] = GameObject.Find("HpPotionImg").gameObject; ItemImg[(int)eITEM.em_SPEED_POTION] = GameObject.Find("SpdPotionImg").gameObject; ItemImg[(int)eITEM.em_DAMAGE_UP_POTIOM] = GameObject.Find("AtkPotionImg").gameObject; ItemImg[(int)eITEM.em_DEFENCE_UP_POTION] = GameObject.Find("DefPotionImg").gameObject; for (int i = 0; i < 4; i++) { ItemImg[i].SetActive(false); } sound = GameObject.Find("GameMgr").GetComponent <BgmController>(); effSound = gameObject.GetComponentInChildren <EffSoundController>(); } }
void Start() { if (spawner == null) { spawner = GetComponent <SpawnScript>(); } SpawnPlayer(); }
// Use this for initialization void Start() { player = GameObject.FindWithTag("Player"); playerTransform = player.transform; playerBehaviour = player.GetComponent <PlayerBehaviour>(); anim = GetComponent <Animator>(); updateHealthBar(); spawnScript = GameObject.FindGameObjectWithTag("Spawn").GetComponent <SpawnScript>(); enemy = GameObject.FindGameObjectWithTag("Enemy"); }
public void CreateBody(Vector2 pos, GameObject planet) { Gravity g = SpawnScript.SpawnNewPlanet(pos, planet); colortemp = SpawnScript.getColor(); planettemp = SpawnScript.getPrefab(); physObjects.Add(g); ++ObjectCounter; NewPlanetController(g, colorToString(colortemp) + " " + planettemp); }
public void DestroyCube() { Destroy(gameObject); SpawnScript script = GetComponentInParent <SpawnScript>(); if (script != null) { script.empty = true; } }
// Start is called before the first frame update private void Start() { SpawnArea = GameObject.FindGameObjectWithTag("SpawnArea"); thisNumber = Convert.ToInt32(name.Substring(4)); SA = SpawnArea.GetComponent <SpawnScript>(); if (name != "Ball1") { this.GetComponent <AudioSource>().Play(); } }
private void OnTrackingFound() { master = GameObject.Find("MasterObject"); master_cont = master.GetComponent("MasterControl") as MasterControl; //Debug.Log("master: " + master); //Debug.Log("master_cont: " + master_cont); //Debug.Log("cont: " + master_cont.mode); Renderer[] rendererComponents = GetComponentsInChildren <Renderer>(true); Collider[] colliderComponents = GetComponentsInChildren <Collider>(true); foreach (Renderer component in rendererComponents) { // A print statement here prints out multiple times as long as card is in view //Debug.Log(mTrackableBehaviour.TrackableName + " is on the field"); component.enabled = true; } // Enable colliders: foreach (Collider component in colliderComponents) { component.enabled = true; } summon = field.GetComponent("SpawnScript") as SpawnScript; if (master_cont.mode == 0) { // If statementt to summon the model only once if (counter == 0) { summon.summonToField(main_model); counter++; } foreach (Renderer component in rendererComponents) { // A print statement here prints out multiple times as long as card is in view //Debug.Log(mTrackableBehaviour.TrackableName + " is on the field"); component.enabled = false; } // Enable colliders: foreach (Collider component in colliderComponents) { component.enabled = false; } } Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " found"); }
// Use this for initialization void Start() { sc = gameObject.GetComponent <Scoreboard>(); spawn = gameObject.GetComponent <SpawnScript>(); soundEffects = GameObject.Find("AudioEffectsManager").GetComponent <SoundEffects>(); backgroundAudio = GameObject.Find("AudioManager").GetComponent <BackgroundMusic>(); winningMessage = ""; boxRect = new Rect(nativeWidth / 2 - 400, nativeHeight / 2 - 250, 800, 500); }
// Update is called once per frame void Update() { SpawnScript t = GameObject.Find("PortalSpawningCapsule").GetComponent <SpawnScript>(); if (playerScore > 6000) { Debug.Log(t); t.enabled = true; } playerScore += Time.deltaTime * 100; }
// Use this for initialization void Start() { foreach (MeshRenderer mesh in this.GetComponentsInChildren<MeshRenderer>()) { if (mesh.name == "Body") mesh.material.color = new Color(126f / 255f, 143f / 255f, 156f / 255f); else if (mesh.name == "Head") mesh.material.color = new Color(186f / 255f, 93f / 255f, 104f / 255f); } spawnScript = GameObject.Find ("Spawner").gameObject.GetComponent<SpawnScript> (); }
private void OnTrackingFound() { master = GameObject.Find("MasterObject"); master_cont = master.GetComponent("MasterControl") as MasterControl; //Debug.Log("master: " + master); //Debug.Log("master_cont: " + master_cont); //Debug.Log("cont: " + master_cont.mode); Renderer[] rendererComponents = GetComponentsInChildren<Renderer>(true); Collider[] colliderComponents = GetComponentsInChildren<Collider>(true); foreach (Renderer component in rendererComponents) { // A print statement here prints out multiple times as long as card is in view //Debug.Log(mTrackableBehaviour.TrackableName + " is on the field"); component.enabled = true; } // Enable colliders: foreach (Collider component in colliderComponents) { component.enabled = true; } summon = field.GetComponent("SpawnScript") as SpawnScript; if (master_cont.mode == 0) { // If statementt to summon the model only once if (counter == 0) { summon.summonToField(main_model); counter++; } foreach (Renderer component in rendererComponents) { // A print statement here prints out multiple times as long as card is in view //Debug.Log(mTrackableBehaviour.TrackableName + " is on the field"); component.enabled = false; } // Enable colliders: foreach (Collider component in colliderComponents) { component.enabled = false; } } Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " found"); }
public static SpawnScriptModel Create(List <Bar.Entry> entries, string name) { var entry = entries .FirstOrDefault(x => x.Name == name && x.Type == Bar.EntryType.SpawnScript); if (entry == null) { return(null); } return(new SpawnScriptModel(name, SpawnScript.Read(entry.Stream))); }
void Start() { currentLevel = 1; if (dataFileName.EndsWith(".xml")) { path = Application.dataPath + "/" + dataFileName; spawnXml = SpawnScript.Load(path); } elapsedTime = 0.0f; nodeCounter = 0; previousBounty = GameObject.FindGameObjectWithTag("Player").GetComponent <BountyScore>().currentBounty; }
// Use this for initialization /* void Start () { tubeSpawn = GameObject.Find("Spawner"). GetComponent<SpawnScript> (); tubeSpawn.enabled = false; } */ void Awake() { tubeSpawn = GameObject.Find("Spawner"). GetComponent<SpawnScript> (); tubeSpawn.enabled = false; }
public WaveSystem(SpawnScript spawnScript, PlayerScript playerScript) { //if (instance == null) //{ instance = this; //misc wave system init RoundNumber = 1; WaveNumber = 0; this.spawnScript = spawnScript; this.playerScript = playerScript; EnemiesRemaining = 0; ForceSpawnWave = false; WaveFinished = true; WaveCountdownOccuring = false; spawnWaveTimer = TimeUntilWaveSpawn; //initialize enemy data ChaserUpgrade = new EnemyUpgrade(ChaserHealthInitial, ChaserVelocityInitial, ChaserDamageInitial, ChaserAttackRateInitial); BouncerUpgrade = new EnemyUpgrade(BouncerHealthInitial, BouncerVelocityInitial, BouncerDamageInitial, BouncerAttackRateInitial); ChargerUpgrade = new EnemyUpgrade(ChargerHealthInitial, ChargerVelocityInitial, ChargerDamageInitial, ChargerAttackRateInitial); SniperUpgrade = new EnemyUpgrade(SniperHealthInitial, SniperVelocityInitial, SniperDamageInitial, SniperAttackRateInitial); HealerUpgrade = new EnemyUpgrade(HealerHealthInitial, HealerVelocityInitial, HealerDamageInitial, HealerAttackRateInitial); SpawnerUpgrade = new EnemyUpgrade(SpawnerHealthInitial, SpawnerVelocityInitial, SpawnerDamageInitial, SpawnerAttackRateInitial); BossUpgrade = new EnemyUpgrade(BossHealthInitial, BossVelocityInitial, BossDamageInitial, BossAttackRateInitial); //} }
void Awake() { Time.timeScale = 1; trans_GamePlayMusic = Instantiate(trans_GamePlayMusic) as Transform; script_GamePlayMusic = trans_GamePlayMusic.gameObject.GetComponent<StayAwakeSound>(); trans_EnterTheFocus = Instantiate(trans_EnterTheFocus) as Transform; script_EnterTheFocus = trans_EnterTheFocus.gameObject.GetComponent<StayAwakeSound>(); trans_FocusMode = Instantiate(trans_FocusMode) as Transform; script_FocusMode = trans_FocusMode.gameObject.GetComponent<StayAwakeSound>(); trans_SpeedBackUp = Instantiate(trans_SpeedBackUp) as Transform; script_SpeedBackUp = trans_SpeedBackUp.gameObject.GetComponent<StayAwakeSound>(); trans_PowerUpSpawn1 = Instantiate(trans_PowerUpSpawn1) as Transform; script_PowerUpSpawn1 = trans_PowerUpSpawn1.gameObject.GetComponent<PowerUpSpawn>(); trans_PowerUpSpawn2 = Instantiate(trans_PowerUpSpawn2) as Transform; script_PowerUpSpawn2 = trans_PowerUpSpawn2.gameObject.GetComponent<PowerUpSpawn>(); groundSpawnScript = groundSpawn.gameObject.GetComponent<SpawnScript>(); playerScript = player.gameObject.GetComponent<PlatformerCharacter2D>(); }
void Awake() { GameObject spawner = GameObject.Find ("ObstacleSpawn Low"); this.ss = spawner.GetComponent<SpawnScript>(); }
//load resources for the gui void Start() { //load our font font = Resources.Load<Font>(fontPath); //set our text offset progressBarTextOffset = 6; //create the style for the title text progressBarStyle = new GUIStyle(); progressBarStyle.fontSize = 14; progressBarStyle.font = font; progressBarStyle.normal.textColor = Color.black; tooltipStyle = new GUIStyle(); tooltipStyle.fontSize = 14; tooltipStyle.font = font; tooltipStyle.normal.textColor = Color.black; tooltipStyle.normal.background = Resources.Load<Texture2D>(tooltipBackgroundPath); waveInfoStyle = new GUIStyle(); waveInfoStyle.font = font; waveInfoStyle.fontSize = 30; waveInfoStyle.normal.textColor = Color.black; bossInfoStyle = new GUIStyle(); bossInfoStyle.font = font; bossInfoStyle.fontSize = 30; bossInfoStyle.normal.textColor = Color.black; heartTexture = Resources.Load<Texture2D>(heartTexturePath); greyHeartTexture = Resources.Load<Texture2D>(greyHeartTexturePath); acceptUpgradeCover = Resources.Load<Texture2D>(acceptUpgradeCoverPath); denyUpgradeCover = Resources.Load<Texture2D>(denyUpgradeCoverPath); healthBar = new ProgressBar(new Vector2(10, 60), new Vector2(200, 30), Resources.Load<Texture2D>(progressBarBackPath), Resources.Load<Texture2D>(progressBarRedPath), Resources.Load<Texture2D>(progressBarProgressGreyPath), Resources.Load<Texture2D>(progressBarCoverPath), progressBarStyle, progressBarTextOffset); staminaBar = new ProgressBar(new Vector2(10, 100), new Vector2(200, 30), Resources.Load<Texture2D>(progressBarBackPath), Resources.Load<Texture2D>(progressBarYellowPath), Resources.Load<Texture2D>(progressBarProgressGreyPath), Resources.Load<Texture2D>(progressBarCoverPath), progressBarStyle, progressBarTextOffset); auraBar = new ProgressBar(new Vector2(10, 140), new Vector2(200, 30), Resources.Load<Texture2D>(progressBarBackPath), Resources.Load<Texture2D>(progressBarBluePath), Resources.Load<Texture2D>(progressBarProgressGreyPath), Resources.Load<Texture2D>(progressBarCoverPath), progressBarStyle, progressBarTextOffset); skillShotBar = new ProgressBar(new Vector2(10, 180), new Vector2(200, 30), Resources.Load<Texture2D>(progressBarBackPath), Resources.Load<Texture2D>(progressBarGreenPath), Resources.Load<Texture2D>(progressBarProgressGreyPath), Resources.Load<Texture2D>(progressBarCoverPath), progressBarStyle, progressBarTextOffset); attackDamageBar = new ProgressBar(new Vector2(10, 220), new Vector2(200, 30), Resources.Load<Texture2D>(progressBarProgressGreyPath), Resources.Load<Texture2D>(progressBarDarkGreyPath), Resources.Load<Texture2D>(progressBarProgressGreyPath), Resources.Load<Texture2D>(progressBarCoverPath), progressBarStyle, progressBarTextOffset); skillAvailableBar = new ProgressBar(new Vector2(10, 260), new Vector2(200, 30), Resources.Load<Texture2D>(progressBarSkillUpPath), Resources.Load<Texture2D>(progressBarDarkGreyPath), Resources.Load<Texture2D>(progressBarSkillUpPath), Resources.Load<Texture2D>(progressBarCoverPath), progressBarStyle, progressBarTextOffset); waveInfoBar = new ProgressBar(new Vector2((Screen.width / 2) - 200, 15), new Vector2(400, 100), Resources.Load<Texture2D>(progressBarBackBigPath), Resources.Load<Texture2D>(progressBarBackBigPath), Resources.Load<Texture2D>(progressBarBackBigPath), Resources.Load<Texture2D>(progressBarCoverBigPath), progressBarStyle, progressBarTextOffset); bossHealthBar = new ProgressBar(new Vector2((Screen.width / 2) - 300, 15), new Vector2(600, 50), Resources.Load<Texture2D>(progressBarBackBossPath), Resources.Load<Texture2D>(progressBarRedBossPath), Resources.Load<Texture2D>(progressBarBackBossPath), Resources.Load<Texture2D>(progressBarCoverBossPath), bossInfoStyle, progressBarTextOffset); spawnScript = GameObject.Find ("Spawner").gameObject.GetComponent<SpawnScript> (); skillPointAvailable = Resources.Load<Texture2D>(skillPointAvailablePath); }
void Start() { spawnManager = GameObject.Find ("SpawnManager"); spawnScript = spawnManager.GetComponent<SpawnScript>(); }
// Use this for initializatio void Start() { spawnthingy = this; //enemyNum = Random.Range(enemyMin, enemyMax); for(int i = 3;i-- >0;) { var src = Sauces[i] = gameObject.AddComponent<AudioSource>(); src.clip = i==2? Musick : Kick; if( i== 2 ) { src.clip = Musick; src.loop = true; src.volume = 0.25f; src.priority = 0; } else { src.clip = Kick; src.priority = 10; } } float delay = 0.75f; NextKick =delay +Beat; Sauces[1].PlayScheduled( delay ); Sauces[2].PlayScheduled( delay ); Invoke( "SpawnEnemy", delay+ EnDelay ); BeatI++; }