void Awake() { _manager = FindObjectOfType <Manager>(); fireProjectile = fireProjectile.GetComponent <FireProjectile>(); this.gameObject.DrawCircle(_attackRange, .05f); //_anim = GetComponent<Animator>(); }
void Start () { effectScript = GameObject.Find("FireProjectile").GetComponent<FireProjectile>(); getProjectileNames(); MyButtonText = Button.transform.FindChild("Text").GetComponent<Text>(); MyButtonText.text = projectileParticleName; }
private void Awake() { droidMeshRender = droid.GetComponent <MeshRenderer>(); // Set up the reference to the Mesh Renderer boxCollider = GetComponent <BoxCollider>(); // Set up the reference to the Box Collider playerControlScript = GetComponent <PlayerControl>(); // Set up the reference to the PlayerControl script fireProjectileScript = GetComponent <FireProjectile>(); // Set up the reference to the FireProjectile script }
public override void Start() { base.Start(); b1 = p1.GetComponent <Boomerang>(); b2 = p2.GetComponent <Boomerang>(); path1 = Polar180(Poly(6)); path1 = Mult(boomerangRadius, path1); path2 = Negx(path1); //mainCycle = TPAndStart(this.transform, MainCycler); teleportHP = teleportHP1; teleport = firstTeleport; currentAttackTime = defaultAttackTime; fire = new FireProjectile(shotPrefab, shotDamage, shotKnockback, shotSpeed); fireBall = new FireProjectile(ballPrefab, 10, 1, 5, 2); boomerangCycle = Burst6; invulnCooldown = new Cooldown(teleportFromTime + teleportToTime); }
void Start() { effectScript = GameObject.Find("FireProjectile").GetComponent <FireProjectile>(); getProjectileNames(); MyButtonText = Button.transform.Find("Text").GetComponent <Text>(); MyButtonText.text = projectileParticleName; }
public static FireProjectile CreateNew(Layer layer, float x = 0, float y = 0) { FireProjectile instance = null; instance = new FireProjectile(mContentManagerName ?? FlatRedBall.Screens.ScreenManager.CurrentScreen.ContentManagerName, false); instance.AddToManagers(layer); instance.X = x; instance.Y = y; foreach (var list in ListsToAddTo) { if (SortAxis == FlatRedBall.Math.Axis.X && list is PositionedObjectList <FireProjectile> ) { var index = (list as PositionedObjectList <FireProjectile>).GetFirstAfter(x, Axis.X, 0, list.Count); list.Insert(index, instance); } else if (SortAxis == FlatRedBall.Math.Axis.Y && list is PositionedObjectList <FireProjectile> ) { var index = (list as PositionedObjectList <FireProjectile>).GetFirstAfter(y, Axis.Y, 0, list.Count); list.Insert(index, instance); } else { // Sort Z not supported list.Add(instance); } } if (EntitySpawned != null) { EntitySpawned(instance); } return(instance); }
protected virtual void ExecuteSpecificWeapon(FireProjectile shooter) { // Check if the shooter exist if (shooter == null || shooter.firing) { return; } // Single shoot mode switch (shooter.fireMode) { case FireProjectile.FiringMode.Single: // Fire the main weapon and send the current ship's velocity as momentum shooter.Fire(bulletSpeed, currentVelocity * WeaponMomentum); break; case FireProjectile.FiringMode.Continuous: // Shoot as long as burst beam duration allows it shooter.Fire(bulletSpeed, currentVelocity * WeaponMomentum); break; default: throw new ArgumentOutOfRangeException(); } }
private void Awake() { animator = GetComponent <Animator>(); agent = GetComponent <NavMeshAgent>(); health = GetComponent <Health>(); fireProjectile = GetComponent <FireProjectile>(); }
// 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>(); }
/// <summary> /// Makes the argument objectToMakeUnused marked as unused. This method is generated to be used /// by generated code. Use Destroy instead when writing custom code so that your code will behave /// the same whether your Entity is pooled or not. /// </summary> public static void MakeUnused(FireProjectile objectToMakeUnused, bool callDestroy) { if (callDestroy) { objectToMakeUnused.Destroy(); } }
// Use this for initialization void Start() { playerManager = GetComponent<PlayerManager>(); health = GetComponent<Health>(); fireProj = GetComponent<FireProjectile>(); inputDir = new Vector3(); }
protected override void SpawnBullet() { base.SpawnBullet(); FireProjectile bullet = fireProjectilePool.Rent() as FireProjectile; SetUpBullet(bullet); }
//----------------------------------------------------------------------- /** * Draw the wand on the HUD when player collects */ public void DrawWand(int yPositionIn) { if (FireProjectile.PlayerHasWand()) { yPositionIn += 20; int xPosition = ((Screen.width / 20) * 19); GUI.Label(new Rect(xPosition + 6, yPositionIn, width, 50), magicWand); } }
void Start() { GameObject fireProjectileS = GameObject.FindWithTag("Player"); if (fireProjectileS != null) { fireProjectile = fireProjectileS.GetComponent <FireProjectile>(); } }
void Awake() { // Set up initial values playerController = GetComponent <PlayerControl>(); fireProjectile = GetComponent <FireProjectile>(); startingHealth = health; // This records the initial health value to use when player is destroyed healthSlider.value = health; powerUsage = (powerEfficiency / 10); }
void SetUpBullet(FireProjectile bullet) { if (bullet) { bullet.SetTarget(target); bullet.transform.position = projectileSpawnPoint.transform.position; bullet.gameObject.SetActive(true); } }
private static void FactoryInitialize() { const int numberToPreAllocate = 20; for (int i = 0; i < numberToPreAllocate; i++) { FireProjectile instance = new FireProjectile(mContentManagerName, false); mPool.AddToPool(instance); } }
void Awake() { // Set up initial values playerController = GetComponent <PlayerControl>(); fireProjectile = GetComponent <FireProjectile>(); startingHealth = health; // This records the initial health value to use when player respawns // startingPower = power; // 5. This records the initial power value to use when player respawns healthSlider.value = health; // powerUsage = (powerEfficiency / 10); // 6. Uncomment this for droid power system }
public void OnTriggerEnter(Collider c) { string tag = c.tag; //Give player the magic wand if ("Player" == tag) { FireProjectile.SetMagicWand(true); Destroy(gameObject); } } //end OnTriggerEnter
void SpawnProjectile() { if (status == 3 && projectile != null) { FireProjectile projectile = Instantiate(this.projectile, transform.position + facingDirection, Quaternion.identity); SoundManager.instance.PlaySingle(fireballSound); projectile.Direction = facingDirection; } }
private void Start() { myTimer = GetComponent <CountdownTimer>(); myTimer.ResetTimer(timeForLevel); GameGUI.SetBarrelsLeft(barrelsForLevel); //print ("BARRELS FOR LEVEL" + barrelsForLevel); GameGUI.SetFinalLevel(isFinalLevel); FireProjectile.SetMagicWand(playerHasWand); }
public IProjectile FireProjectile() { if (this.Target != null && this.Target.Exists && this.frameCount >= this.Speed) { this.frameCount = 0; Projectile projectile = null; if (Math.Abs(this.lastAngle - this.towerAngle) < 1) { switch (this.projectileType) { case ProjectileSelection.ArrowProjectile: projectile = new ArrowProjectile( this.Coordinates.X, this.Coordinates.Y, this.Target, this.Damage); break; case ProjectileSelection.FireProjectile: projectile = new FireProjectile( this.Coordinates.X, this.Coordinates.Y, this.Target, this.Damage); break; case ProjectileSelection.FreezeProjectile: projectile = new FreezeProjectile( this.Coordinates.X, this.Coordinates.Y, this.Target, this.Damage); break; case ProjectileSelection.SniperProjectile: projectile = new SniperProjectile( this.Coordinates.X, this.Coordinates.Y, this.Target, this.Damage); break; } return(projectile); } } else { this.frameCount++; } return(null); }
// Start is called before the first frame update void Start() { fProjectile = this.gameObject.GetComponent <FireProjectile>(); fProjectile.SetProjectile(dartObj); if (shootDelay < 0.5f) { shootDelay = 0.5f; } canSpawnPart = true; }
//private float Deathtimer = 100f; // Start is called before the first frame update void Start() { if (Player == null) { Player = GameObject.FindGameObjectWithTag("Player"); } if (Bullet == null) { Bullet = (GameObject)Resources.Load("Prefabs/Bullet") as GameObject; } fireProj = this.gameObject.GetComponent <FireProjectile>(); fireProj.SetProjectile(Bullet); m_SpawnPickup = this.gameObject.GetComponent <SpawnPickup>(); Enemy = this.gameObject; }
void Awake() { inputState = GetComponent <InputState> (); walkBehavior = GetComponent <Walk> (); animator = GetComponent <Animator> (); collisionState = GetComponent <CollisionState> (); duckBehavior = GetComponent <Duck> (); if (blockAnimationNeed) { blockBehavoir = GetComponent <Block> (); } if (shootAnimationInAirNeed) { fireBehavior = GetComponent <FireProjectile> (); } if (changeStateNeed) { changeStateBevavior = GetComponent <ChangeState> (); } }
IEnumerator throwFireballUp() { for (int f = 0; f < nbFireballsUp; ++f) { yield return(new WaitForSeconds(timeBetweenFireballsUp)); float posX = Random.Range( transform.position.x - 1.5f, transform.position.x + 1.5f ); FireProjectile projectile = Instantiate( fireProjectilePrefab, new Vector3(posX, transform.position.y, transform.position.z), Quaternion.identity ); projectile.GetComponent <Rigidbody2D>().velocity = new Vector2( 0f, projectileSpeedUp ); Destroy(projectile, ttlFireballUp); } }
virtual protected void ExecuteSpecificWeapon(FireProjectile shooter) { // Check if the shooter exist if (shooter == null || shooter.firing) { return; } // Single shoot mode if (shooter.fireMode == FireProjectile.FiringMode.Single) { // Fire the main weapon and send the current ship's velocity as momentum shooter.Fire(bulletSpeed, currentVelocity * WeaponMomentum); } // Continuous shoot mode else if (shooter.fireMode == FireProjectile.FiringMode.Continuous) { // Shoot as long as burst beam duration allows it shooter.Fire(bulletSpeed, currentVelocity * WeaponMomentum); } }
// Use this for initialization void Start() { fireProjectile = GetComponent <FireProjectile>(); fireProjectileCooldown = gameObject.AddComponent <ActionCoolDown>(); fireProjectileCooldown.cooldownTime = fireProjectileCooldownTime; facing = gameObject.AddComponent <Facing>(); basicPatrol = transform.GetComponentInChildren <BasicPatrol>(); basicSearch = transform.GetComponentInChildren <BasicSearch>(); lookRotation = transform.GetComponentInChildren <LookRotation>(); visionRange = transform.GetComponentInChildren <VisionRange>(); navMeshAgent = transform.GetComponentInChildren <NavMeshAgent>(); health = transform.GetComponentInChildren <Health>(); if (target != null) { visionRange.validTargets = new List <GameObject> { target }; } }
void Start() { ip = new InputPacket(); fp = GetComponent <FireProjectile>(); ip.inputAction1 = true; }
void Start() { effectScript = GameObject.Find("FireProjectile").GetComponent<FireProjectile>(); getEffectNames(); }
void Start() { effectScript = GameObject.Find("FireProjectile").GetComponent <FireProjectile>(); getEffectNames(); }
// Start is called before the first frame update void Start() { m_FireProjectile = this.gameObject.GetComponent <FireProjectile>(); m_FireProjectile.SetProjectile(m_Projectile); }
void Start() { _projectileLauncher = gameObject.GetComponent<FireProjectile> (); }
// Use this for initialization void Start() { agent = GetComponent<NavMeshAgent>(); tankGun = gameObject.GetComponentInChildren<FireProjectile>(); sinceLastShot += Random.Range(0, fireRate); }
public void SetPlayerProjectile(FireProjectile projectile) { player.Projectile = projectile; }
protected override void Awake() { base.Awake(); myProjectile = gameObject.GetComponent<FireProjectile>(); }