// Setting up references void Awake() { obstacleSpawner = GameObject.FindGameObjectWithTag("ObstacleSpawner").GetComponent<ObstacleSpawner>(); pickupSpawner = GameObject.FindGameObjectWithTag("PickupSpawner").GetComponent<PickupSpawner>(); soundManager = GameObject.FindGameObjectWithTag("SoundManagerGO").GetComponent<SoundManager>(); playerControls = player.GetComponent<CharacterUserControls>(); }
void Awake() { // Setting up references. explosionFX = GameObject.FindGameObjectWithTag("ExplosionFX").GetComponent<ParticleSystem>(); pickupSpawner = GameObject.Find("pickupManager").GetComponent<PickupSpawner>(); layBombs = GameObject.FindGameObjectWithTag("Player").GetComponent<LayBombs>(); }
void Awake () { // Setting up the references. pickupSpawner = GameObject.Find("pickupManager").GetComponent<PickupSpawner>(); anim = transform.root.GetComponent<Animator>(); observers = new ArrayList(); //attach(GameObject.Find("playerHealth").GetComponent<PlayerHealth>()); //attach(GetComponent<PlayerHealth>()); }
void Awake() { _player = GameObject.Find(Constants.Game.PLAYER_NAME); _pickupSpawner = GameObject.Find("Planet").GetComponent<PickupSpawner>(); enemySpawner = FindObjectOfType<EnemySpawnerScript>(); scoreManager = FindObjectOfType<HUDScoreScript>(); hudMessage = GameObject.Find("HUDMessageCenter").GetComponent<HUDMessageScript>(); }
void Awake() { explosionFX = GameObject.FindGameObjectWithTag( "ExplosionFX" ).GetComponent<ParticleSystem>(); pickupSpawner = GameObject.Find("pickupManager").GetComponent<PickupSpawner>(); if (GameObject.FindGameObjectWithTag("Player")) layBombs = GameObject.FindGameObjectWithTag("Player").GetComponent<LayBombs>(); }
public void OnRealTimeMessageReceived(bool isReliable, string senderId, byte[] data) { if (!gameLoaded) { return; } byte messageVersion = (byte)data[0]; char messageType = (char)data[1]; if (messageType == 'U' && data.Length == updateMessageLength) { Dictionary <string, GameObject> players = levelManager.PlayerList(); float posX = System.BitConverter.ToSingle(data, 2); float posY = System.BitConverter.ToSingle(data, 6); float velX = System.BitConverter.ToSingle(data, 10); float velY = System.BitConverter.ToSingle(data, 14); bool facingLeft = System.Convert.ToBoolean(data [18]); bool attacking = System.Convert.ToBoolean(data [19]); bool blocking = System.Convert.ToBoolean(data [20]); float health = System.BitConverter.ToSingle(data, 21); float blockingAmount = System.BitConverter.ToSingle(data, 25); players [senderId].GetComponent <PlayerController> ().UpdateMultiplayerData(posX, posY, velX, velY, facingLeft, attacking, blocking, health, blockingAmount); } else if (messageType == 'H' && data.Length == hostMessageLength) { int spawnPoint = System.BitConverter.ToInt32(data, 2); int pickupValue = System.BitConverter.ToInt32(data, 6); PickupSpawner spawner = levelManager.pickupSpawner; spawner.SetSpawn(spawnPoint, pickupValue); } else if (messageType == 'M' && data.Length == mapMessageLength) { int mapIndex = System.BitConverter.ToInt32(data, 2); string mapName = mapList[mapIndex]; LoadMultiplayerGame(mapName); } else if (messageType == 'S' && data.Length == mapMessageLength) { int mapIndex = System.BitConverter.ToInt32(data, 2); GameObject.Find("Canvas").GetComponent <UIControl_MapSelector>().UpdateMap(mapIndex); } }
void Awake() { if (disableOnAwake) { gameObject.SetActive(false); return; } S = this; for (int i = 0; i < PlayerIdentity.numPlayersReal; i++) { StartCoroutine(RunTutorial(i)); tutorialsRemaining += 1; } spawner = FindObjectOfType <PickupSpawner>(); spawner.enabled = false; }
// Start is called before the first frame update void Start() { //Set Game State to RUNNING currentState = gameStates.RUNNING; //Get Player player = GameObject.FindGameObjectWithTag("Player"); playerManager = player.GetComponent <PlayerManager>(); //Get Spawner spawner = GameObject.FindGameObjectWithTag("Spawner"); pickupSpawner = spawner.GetComponent <PickupSpawner>(); //Get Screen resolution in units height = Camera.main.orthographicSize * 2; width = height * Screen.width / Screen.height; }
// Start is called before the first frame update void Start() { //Get GameManager manager = GameObject.FindGameObjectWithTag("GameManager"); gameManager = manager.GetComponent <GameManager>(); //Get Spawner pickupSpawner = spawner.GetComponent <PickupSpawner>(); //Get player trail playerTrail = gameObject.GetComponent <PlayerTrail>(); //Get player movement playerMovement = gameObject.GetComponent <PlayerMovement>(); //GetHeadPosition headPoint = head.position; }
private void Awake() { if (Instance) { Destroy(gameObject); } else { Instance = this; } _pickupQueue = new Queue <GameObject>(pickups.Length); foreach (var pickup in pickups) { var pickupObject = Instantiate(pickup, transform, true); pickupObject.SetActive(false); _pickupQueue.Enqueue(pickupObject); } }
public void DropItem(Item discardItem, int discardAmount) { for (int i = 0; i < discardAmount;) { int count; if (i + 5 < discardAmount) { count = 5; } else { count = discardAmount - i; } var spawnLocation = transform.position + UnityEngine.Random.onUnitSphere * 3f; spawnLocation.y = 3f; PickupSpawner.SpawnPickup(discardItem, count, spawnLocation, transform.rotation); i += count; } }
public override void OnStartServer() { if (instance != null) { Debug.LogError("More than one PickupSpawner in scene."); } else { instance = this; } spawned = false; GameObject serverManager = Instantiate(serverManagerPrefab, new Vector3(), Quaternion.identity); NetworkServer.Spawn(serverManager); ammoSpawnTimer = Random.Range(2f, 10f); healthSpawnTimer = Random.Range(2f, 10f); t = 0; }
// Use this for initialization void Start() { pickup = GameObject.Find("PickupSpawner").GetComponent <PickupSpawner>(); arrowRenderer = GetComponentInChildren <MeshRenderer>(); }
public void SetSpawner(PickupSpawner pickupS) { spawner = pickupS; }
private void Start() { pickupSpawner = gameObject.GetComponentInParent <PickupSpawner>(); }
private PickupSpawner pickupSpawner; // Reference to the pickup spawner. void Awake() { // Setting up the references. pickupSpawner = GameObject.Find("pickupManager").GetComponent <PickupSpawner>(); }
private PickupSpawner pickupSpawner; // Reference to the pickup spawner. #endregion Fields #region Methods void Awake() { pickupSpawner = GameObject.Find("pickupManager").GetComponent<PickupSpawner>(); anim = transform.root.GetComponent<Animator>(); }
private bool landed; // Whether or not the crate has landed. void Awake() { pickupSpawner = GameObject.Find("pickupManager").GetComponent <PickupSpawner>(); anim = transform.root.GetComponent <Animator>(); }
void Awake() { explosionFX = GameObject.FindGameObjectWithTag("ExplosionFX").GetComponent <ParticleSystem>(); layBombs = GameObject.FindGameObjectWithTag("Player").GetComponent <LayBombs>(); pickupSpawner = GameObject.Find("pickupManager").GetComponent <PickupSpawner>(); }
void Start () { scoreBoard = FindObjectOfType<ScoreBoard>(); PickupSpawner pickupSpawner = FindObjectOfType<PickupSpawner>(); enemyDeathListener = pickupSpawner; }
void Start() { spawner = GameObject.FindGameObjectWithTag("Spawner").GetComponent <PickupSpawner>(); totalPickups = spawner.numberOfPickups; ShowPickupsText(); }
private bool landed; // Whether or not the crate has landed. void Awake () { // Setting up the references. pickupSpawner = GameObject.Find("pickupManager").GetComponent<PickupSpawner>(); anim = transform.root.GetComponent<Animator>(); }
private ParticleSystem explosionFX; // Reference to the particle system of the explosion effect. void Awake() { // Setting up references. explosionFX = GameObject.FindGameObjectWithTag("ExplosionFX").GetComponent <ParticleSystem>(); pickupSpawner = GameObject.Find("pickupManager").GetComponent <PickupSpawner>(); }
private bool landed = false; // Whether or not the crate has landed yet. void Awake() { // Setting up the reference. pickupSpawner = GameObject.Find("PickupSpawner").GetComponent <PickupSpawner>(); anim = transform.root.GetComponent <Animator>(); }
public void Initialize(PickupSpawner spawner) { this.spawner = spawner; }