// Use this for initialization void Start() { buttonZ = new Slowtime(); buttonX = new NormalizeTime(); buttonLeftMouse = new FireWeapon(); buttonESC = new PauseGame(); }
private void Start() { if (projectile != null && gun != null) { weaponToFire = new FireProjectile(projectile, gun); weaponToFire.timeLimit = 0.3f; } }
private void Awake() { _col = GetComponent <Collider2D>(); _fw = GetComponent <FireWeapon>(); _st = GetComponent <SetTrap>(); _pm = GameObject.Find("Menu").transform.Find("Pause"); _controlsScreen = GameObject.Find("Controller Display"); }
// Use this for initialization void Start() { unit = GetComponent <UnitController>(); weapon = GetComponent <FireWeapon>(); player = GameObject.Find("Player").GetComponent <SelfDestruct>(); assist = FindObjectOfType <FieldOrientationAssistant>(); //Debug.Log(player); }
private void Awake() { input = GetComponent <FPSInput>(); motor = GetComponent <FPSMotor>(); stats = GetComponent <ActorStats>(); fire = GetComponent <FireWeapon>(); currentMoveSpeed = moveSpeed; currentTurnSpeed = turnSpeed; }
public void OnLanuchWeapon(UInt32 nID) { FireWeapon FireScript = GetComponent <FireWeapon>(); if (FireScript != null && FireScript.isActiveAndEnabled) { FireScript.CastSpell(nID); // Debug.Log(FireScript.gameObject); } }
// public GameObject camerasParent; // public GameObject FPSCAMERA; // public float walkSpeed = 4f; // public float hRotationSpeed = 100f; // public float vRotationSpeed = 80f; // public float sprintSpeed = 8f; private void Start() { //Esconde y bloquea el ratón Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; characterMovement = GetComponent <CharacterMovement>(); mouseLook = GetComponent <MouseLook>(); gunAiming = GetComponentInChildren <GunAiming>(); //? fireWeapon = GetComponentInChildren <FireWeapon>(); }
void Start() { dotTexture = (Texture)Resources.Load("Dot"); pController = gameObject.GetComponent <PlayerController>(); fWeapon = gameObject.GetComponent <FireWeapon>(); escMenu = GameObject.Find("EscMenu"); escMenu.GetComponent <Canvas>().enabled = false; }
void Start() { dotTexture = (Texture)Resources.Load("Dot"); pController = gameObject.GetComponent<PlayerController>(); fWeapon = gameObject.GetComponent<FireWeapon>(); escMenu = GameObject.Find("EscMenu"); escMenu.GetComponent<Canvas>().enabled = false; }
// Use this for initialization void Start() { buttonZ = new Slowtime(); buttonX = new NormalizeTime(); buttonLeftMouse = new FireWeapon(); buttonESC = new PauseGame(); buttonSpace = new JumpCommand(); buttonLeftShift = new DashCommand(); buttonB = new ChangeWeapon(); }
private void Start() { Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; GameObject.Find("Capsule").GetComponent <MeshRenderer>().enabled = false; characterMovement = GetComponent <CharacterMovement>(); mouseLook = GetComponent <MouseLook>(); gunAiming = GetComponentInChildren <GunAiming>(); fireWeapon = GetComponentInChildren <FireWeapon>(); }
void OnTriggerEnter(Collider other) { FireWeapon playerWeapon = other.gameObject.GetComponent <FireWeapon>(); if (playerWeapon != null) { playerWeapon.UpdateGrenadeSupply(1); //feedback sound AudioHelper.PlayClip2D(pickupSound, 1f); Destroy(this.gameObject, .25f); } }
void OnTriggerStay(Collider theCollider) { if (theCollider.gameObject.CompareTag("Fire") && canBeHit) { canBeHit = false; myFireParticle.Play(); GameObject tempFire = theCollider.gameObject; FireWeapon tempWpn = tempFire.GetComponentInParent <FireWeapon>(); GetComponent <SimpleHealth>().Damage(1); Invoke("ResetHit", Time.deltaTime + tempWpn.bulletDelay); } }
public void PickUpWeapon(FireWeapon weaponPrefab) { if (weapons[weaponIndex] != null) { Destroy(weapons[weaponIndex].gameObject); } FireWeapon newWeapon = Instantiate(weaponPrefab, weaponHolder); newWeapon.Init(); weapons[weaponIndex] = newWeapon; EquipWeapon(weaponIndex); }
public void EquipWeapon(int index) { CurrentWeapon = weapons[index]; for (int i = 0; i < weapons.Length; i++) { if (weapons[i] != null) { weapons[i].Unequip(); } } if (CurrentWeapon != null) { CurrentWeapon.Equip(); } }
// Start is called before the first frame update void Start() { _fw = GetComponentInParent <FireWeapon>(); _rea = GetComponentInParent <Reactor>(); _hm = GetComponentInParent <HealthManager>(); _pc = GetComponentInParent <PlayerController>(); _shield = gameObject.transform.Find("Shield").GetComponent <SpriteRenderer>(); _aimindic = gameObject.transform.Find("AimIndicator").GetComponent <SpriteRenderer>(); _bubbleanim = gameObject.transform.Find("Bubbles").GetComponent <Animator>(); _bigbubbleanim = gameObject.transform.Find("BigBubble").GetComponent <Animator>(); _unstbulanim = gameObject.transform.Find("UnstBulIndicator").GetComponent <Animator>(); _bouncletanim = gameObject.transform.Find("BouncletIndicator").GetComponent <Animator>(); _shield.enabled = false; }
/* * void OnPlayerConnected(NetworkPlayer player) //obsolete. use unity multiplayer and NetworkIdentity instead * { * //NetworkServer.Spawn(startingWeapon); * } */ // Update is called once per frame void Update() { if (!isLocalPlayer) { //return; } // Active weapon FireWeapon fireWeapon = this.transform.Find(currentWeapon + clone).GetComponent <FireWeapon>(); if (fireWeapon.timer < fireWeapon.timeBetweenBullets || Input.GetButton("Fire1")) // To change a weapon, current weapon must be ready to fire and player cannot be shooting { return; } if (Input.GetButton("Gauntlet")) { //ChangeWeapon("Gauntlet"); weaponString = "Gauntlet"; } if (Input.GetButton("Plasma")) { //ChangeWeapon("Plasma"); weaponString = "Plasma"; } if (Input.GetButton("RL")) { //ChangeWeapon("RocketLauncher"); weaponString = "RocketLauncher"; } if (Input.GetButton("LG")) { //ChangeWeapon("LG"); weaponString = "LG"; } if (Input.GetButton("Rail")) { //ChangeWeapon("Rail"); weaponString = "Rail"; } ChangeWeapon(weaponString); }
// Update is called once per frame void Update() { // Active weapon FireWeapon fireWeapon = this.transform.GetChild(selectedWeapon).GetComponent <FireWeapon>(); if (fireWeapon.timer < fireWeapon.timeBetweenBullets || Input.GetButton("Fire1")) // To change a weapon, current weapon must be ready to fire and player cannot be shooting { return; } int previousSelectedWeapon = selectedWeapon; if (Input.GetAxis("Mouse ScrollWheel") > 0f) { if (selectedWeapon >= transform.childCount - 1) { selectedWeapon = 0; } else { selectedWeapon++; } } if (Input.GetAxis("Mouse ScrollWheel") < 0f) { if (selectedWeapon <= 0) { selectedWeapon = transform.childCount - 1; } else { selectedWeapon--; } } if (previousSelectedWeapon != selectedWeapon) { SelectWeapon(); } }
public void InterpretAction(ActorAction action) { if (action is FireWeapon && attackDelay <= 0 && (!IsPlayer || ammoInClip > 0)) { ammoInClip--; attackDelay += Mechanics.Combat.AttackDelay; FireWeapon tmp = action as FireWeapon; Vector3 direction = tmp.TargetPoint - ActorsPosition.transform.position; Attack att = new Attack( Weapon.ProjectileType, Mechanics.Combat.Damage, Mechanics.Combat.DamageVariance, Mechanics.Combat.CriticalChance, Mechanics.Combat.CriticalMultiplicator, ActorsPosition); ActorsPosition.CreateRangedAttack(att, direction); audioSource.volume = audioSourceVolume * GameRandom.NextFloat(0.9f, 1); audioSource.pitch = GameRandom.NextFloat(0.8f, 1.2f); audioSource.Play(); } if (action is MeleeAttack && attackDelay <= 0) { attackDelay += (action as MeleeAttack).WindUpTime + Mechanics.Combat.AttackDelay; StartCoroutine("MeleeAttackWithWindUp", action as MeleeAttack); } if (action is ReloadWeapon) { StartCoroutine("StartReloadingAfterDelay"); } }
void Attack(UnitController[] targets, IPlayerControl owner) { List <Transform> trn = new List <Transform>(); for (int i = 0; i < targets.Length; i++) { owner.Damage(targets[i], order[index].damage / targets.Length); trn.Add(targets[i].transform); Debug.Log(order[index].name + " aims at " + targets[i].name); } if (trn.Count > 0) { FireWeapon fire = order[index].GetComponent <FireWeapon>(); //fire.onDone = ()=>NextCombatant(); fire.Shoot(trn.ToArray(), 3); LeanTween.delayedCall(gameObject, 3, () => NextCombatant()); } else { NextCombatant(); Debug.Log(order[index].name + " has no targets in range"); } }
public void RegisterWeapon(GameObject weapon) { fireWeapon = weapon.GetComponent <FireWeapon>(); fireWeapon.RegisterTouchPad(this); }
public void SetFireWeapon(FireWeapon fireWeapon) { _fireWeapon = fireWeapon; }
void Start() { // Initialisierungen fireing = GetComponentInParent <FireWeapon>(); try { propsManager = GameObject.Find("PropsManager").transform; } catch {} }
// Start is called before the first frame update void Start() { weapon = GameObject.FindGameObjectWithTag("Player").GetComponent <FireWeapon>(); }
public static void CallFireWeapon(float fuelAmount) { FireWeapon?.Invoke(fuelAmount); }