// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag ("Player"); playerAmmo = player.GetComponent<PlayerAmmo> (); transform.position += new Vector3 (0, .5f, 0); }
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player"); playerAmmo = player.GetComponent <PlayerAmmo> (); transform.position += new Vector3(0, .5f, 0); }
void Awake() { anim = GetComponent <Animator>(); botUtility = GetComponentInParent <BotUtility>(); health = botUtility.GetComponent <PlayerHealth>(); ammo = botUtility.GetComponentInChildren <PlayerAmmo>(); }
// Use this for initialization void Start() { playerArmor = GetComponent <PlayerArmor>(); playerInventory = GetComponent <PlayerInventory>(); properties = GetComponent <PlayerProperties>(); duffleImage = UIElement.GetComponent <Image>(); playerAmmo = GetComponent <PlayerAmmo>(); }
// finds gameobjects and set booleans void Start() { AmmoCount = GameObject.Find("AmmoCount"); ActiveWeapon = GameObject.Find("ActiveWeapon"); weaponControl = ActiveWeapon.GetComponent <WeaponControl>(); playerAmmo = AmmoCount.GetComponent <PlayerAmmo>(); meleeSpawn = false; }
private void Awake() { gunShot = GetComponent <AudioSource>(); playerStat = GetComponentInParent <PlayerStats>(); playerAmmo = GetComponentInParent <PlayerAmmo>(); playerGrapple = GetComponentInParent <Grapple>(); gunAnimation = GetComponent <ProceduralGunAnimation>(); }
void Awake() { ammo = GetComponent <PlayerAmmo>(); animator = GetComponent <Animator>(); foreach (var weapon in weapons) { weapon.gameObject.SetActive(false); } }
private void Start() { /*---------------------------------------------------------------------- * //Gets the Players Rigidbody Collider * ------------------------------------------------------------------------*/ body = GetComponent <Rigidbody2D>(); ammo = GetComponent <PlayerAmmo>(); }
void Awake() { // Create a layer mask for the Shootable layer. shootableMask = LayerMask.GetMask("Shootable"); player = GameObject.FindGameObjectWithTag("Player"); playerAmmo = player.GetComponent <PlayerAmmo> (); weaponSource = player.GetComponent <AudioSource> (); weaponSource.clip = fireGun; }
public void Spawn(Dictionary <string, object> _data) { MyAmmos = new List <PlayerAmmo>(); GameObject ballGo = Instantiate(PlayerAmmoPrefab.gameObject, Vector3.zero, Quaternion.identity) as GameObject; PlayerAmmo pa = ballGo.GetComponent <PlayerAmmo>(); MyAmmos.Add(pa); pa.transform.SetParent(transform); pa.transform.localPosition = Trans_SpawnPos.localPosition; pa.Init(_data); pa.Launch(); }
// Use this for initialization public override void Start() { if (isPickup) { return; } base.Start(); cam = playerProperties.cam; playerAmmo = player.GetComponent <PlayerAmmo>(); updateAmmo = player.transform.Find("SinglePlayer UI/HUD/Ammo Count").GetComponent <UpdateAmmo>(); control = player.GetComponent <PlayerInputControls>(); }
void Start() { botUtility = GetComponent <BotUtility>(); health = botUtility.GetComponent <PlayerHealth>(); ammo = botUtility.GetComponent <PlayerAmmo>(); traitComponent = GetComponent <Agent>(); int uniqueId = (TryGetComponent <AIPlannerTarget>(out var target) ? target.UniqueId : -1); traitComponent.UniqueId = uniqueId; UpdateParams(); }
public void ObtenerPlayerAmmo(Transform playerAmmo) { Transform spawnedAmmo = PlayerAmmoQueue.Dequeue(); PlayerAmmo pa = spawnedAmmo.GetComponent <PlayerAmmo>(); pa.SetPlayerAmmo(VelocidadPlayerAmmo, TiempoVidaPlayerAmmo, ValorDañoPlayerAmmo); spawnedAmmo.gameObject.SetActive(true); spawnedAmmo.position = playerAmmo.position + (playerAmmo.forward * 2f); spawnedAmmo.rotation = playerAmmo.rotation; PlayerAmmoQueue.Enqueue(spawnedAmmo); //return spawnedAmmo; }
void Start() { botUtility = GetComponent <BotUtility>(); health = botUtility.GetComponent <PlayerHealth>(); ammo = botUtility.GetComponent <PlayerAmmo>(); traitComponent = GetComponent <TraitComponent>(); int uniqueId = (TryGetComponent <AIPlannerTarget>(out var target) ? target.UniqueId : -1); ITraitData agent = traitComponent.GetTraitData <Agent>(); agent.SetValue("UniqueId", uniqueId); UpdateParams(); }
public Transform SpawnAmmo(Transform playerAmmo) { Transform spawnedAmmo = playerAmmoQueue.Dequeue(); PlayerAmmo pa = spawnedAmmo.GetComponent <PlayerAmmo>(); pa.speed = playerAmmoSpeed; pa.lifeTime = playerAmmoLifeTime; //spawnedAmmo.SetParent(playerAmmo); spawnedAmmo.gameObject.SetActive(true); spawnedAmmo.position = playerAmmo.position + (playerAmmo.forward * 2f); spawnedAmmo.rotation = playerAmmo.rotation; //spawnedAmmo.position = playerAmmo.forward * 1.5f; // playerAmmoQueue.Enqueue(spawnedAmmo); return(spawnedAmmo); }
// Use this for initialization void Start() { if (gameObject.name != "Ammo Count Panel") { Debug.LogWarning("Make sure this is attached to a panel with ammo dislpay UI objects in it!"); } Image[] tempImages = GetComponentsInChildren <Image>(); ammoImage = new Image[tempImages.Length - 1]; for (int i = 1; i < tempImages.Length; i++) { ammoImage[i - 1] = tempImages[i]; } amountText = GetComponentsInChildren <Text>(); try { ammo = transform.root.GetComponent <PlayerAmmo>(); } catch (MissingComponentException e) { Debug.LogError("Missing a player ammo in the root transform!!"); } weaponSwitch = transform.root.GetComponent <WeaponSwitch>(); }
// Use this for initialization void Start() { text = GetComponent <Text>(); weaponSwitch = transform.root.GetComponent <WeaponSwitch>(); playerAmmo = weaponSwitch.GetComponent <PlayerAmmo>(); }
public new void Start() { base.Start (); playerAmmo = player.GetComponent<PlayerAmmo> (); }
new public void Start() { base.Start(); playerAmmo = player.GetComponent <PlayerAmmo> (); }
void Start() { _ammo = FindObjectOfType <PlayerAmmo>(); _viewCamera = GameObject.Find("HeadCamera").GetComponent <UnityEngine.Camera>(); }
// Find gameobjects void Start() { weaponControl = GameObject.Find("ActiveWeapon").GetComponent <WeaponControl>(); playerAmmo = GameObject.Find("AmmoCount").GetComponent <PlayerAmmo>(); shootSound = GetComponent <AudioSource>(); }