コード例 #1
0
ファイル: LaunchTorpedo.cs プロジェクト: temik911/audio
 public LaunchTorpedo(Entity entity, List<Cell> path, ActionsQueue queue)
 {
     if (((Submarine)entity).launchTorpedo())
     {
         ((Submarine)entity).Team.launchedTorpedo++;
         Entity = new Torpedo((Submarine)entity);
         entity.Parent.addToCollection(Entity);
     }
     else
         Entity = null;
     ActionsQueue = queue;
     this.path = path;
 }
コード例 #2
0
    public int DetermineWhichPlayerSelected(Torpedo torpedo)
    {
        Player result;

        for (int x = 0; x < players.Count; x++)
        {
            players.TryGetValue(x, out result);
            Torpedo resultTorpedo = result.GetSelectedTorpedo();
            if (resultTorpedo != null)
            {
                if (resultTorpedo.Equals(torpedo))
                {
                    return(result.playerNumber);
                }
            }
        }
        return(-1);
    }
コード例 #3
0
    /// <summary>
    /// Fires the torpedo launcher.
    /// </summary>
    public override Projectile Fire()
    {
        if (torpedo.targetShip)
        {
            torpedo.targetShip.IncomingProjectile(torpedo);
        }
        else
        {
            torpedo.targetDistance = 30f;
        }
        torpedo.Launch();


        Torpedo firedTorpedo = torpedo;

        torpedo = null;
        return(firedTorpedo);
    }
コード例 #4
0
        public override string GetBattleDetail(int index)
        {
            var sb = new StringBuilder();

            string airbattle      = AirBattle.GetBattleDetail(index);
            string asw            = OpeningASW.GetBattleDetail(index);
            string openingTorpedo = OpeningTorpedo.GetBattleDetail(index);
            string shelling1      = Shelling1.GetBattleDetail(index);
            string shelling2      = Shelling2.GetBattleDetail(index);
            string shelling3      = Shelling3.GetBattleDetail(index);
            string torpedo        = Torpedo.GetBattleDetail(index);

            if (airbattle != null)
            {
                sb.AppendLine("《航空戦》").Append(airbattle);
            }
            if (asw != null)
            {
                sb.AppendLine("《開幕対潜》").Append(asw);
            }
            if (openingTorpedo != null)
            {
                sb.AppendLine("《開幕雷撃》").Append(openingTorpedo);
            }
            if (shelling1 != null)
            {
                sb.AppendLine("《第一次砲撃戦》").Append(shelling1);
            }
            if (shelling2 != null)
            {
                sb.AppendLine("《第二次砲撃戦》").Append(shelling2);
            }
            if (shelling3 != null)
            {
                sb.AppendLine("《第三次砲撃戦》").Append(shelling3);
            }
            if (torpedo != null)
            {
                sb.AppendLine("《雷撃戦》").Append(torpedo);
            }

            return(sb.ToString());
        }
コード例 #5
0
    private void SelectClosestTorpedoFromList()
    {
        Torpedo closestTorpedo = null;

        foreach (Torpedo torpedo in GameController.instance.GetTorpedoList())
        {
            if (torpedo.IsSelectableByPlayer(playerNumber))
            {
                if (closestTorpedo == null || Vector3.Distance(closestTorpedo.transform.position, gameObject.transform.position) > Vector3.Distance(torpedo.transform.position, gameObject.transform.position))
                {
                    closestTorpedo = torpedo;
                }
            }
        }
        if (closestTorpedo != null)
        {
            SelectTorpedo(closestTorpedo);
        }
    }
コード例 #6
0
        public ShotWrapper Shoot(Torpedo torpedo)
        {
            var        torpedoCoordinates = ExtractPosition(torpedo);
            ShotStatus shotStatus;
            string     message = string.Empty;

            if (GameBoard.GameBoard[torpedoCoordinates.Row, torpedoCoordinates.Column] == BoardSquareStatus.Empty)
            {
                shotStatus = ShotStatus.Miss;
                message    = _constants.MissMessage;
                GameBoard.DisplayBoard[torpedoCoordinates.Row, torpedoCoordinates.Column] = ShotStatus.Miss.ToString();
            }
            else
            {
                shotStatus = TorpedoHit(torpedoCoordinates);
                if (shotStatus == ShotStatus.Hit)
                {
                    GameBoard.DisplayBoard[torpedoCoordinates.Row, torpedoCoordinates.Column] = ShotTypes.Hit.ToString();
                    message = _constants.HitMessage;
                }
                else if (shotStatus == ShotStatus.Sink)
                {
                    GameBoard.DisplayBoard[torpedoCoordinates.Row, torpedoCoordinates.Column] = ShotTypes.Sink.ToString();
                    message = _constants.SinkMessage;
                }

                if (AllShipsSunk())
                {
                    shotStatus = ShotStatus.End;
                    message    = _constants.EndMessage;
                }
            }

            var boardWrapper = new ShotWrapper
            {
                DisplayBoard = GameBoard.DisplayBoard,
                Status       = shotStatus.ToString(),
                Message      = message
            };

            return(boardWrapper);
        }
コード例 #7
0
    private void LaunchTorpedo()
    {
        //instanciate bullet
        Torpedo torpedo = Instantiate(torpedoPrefab, bulletParent.transform);

        //give same position as player
        torpedo.transform.position = gun.transform.position;

        //give velocity
        Rigidbody2D rb2 = torpedo.GetComponent <Rigidbody2D>();

        //rbb.velocity = new Vector2(1, 0);
        rb2.velocity = Vector2.up * torpedoSpeed;

        //torpedo sound
        FindObjectOfType <AudioManager>().Play("Torpedo");

        // reset torpedos back to empty
        player.setPlayerTorpedo(false);
    }
コード例 #8
0
        public ThreeShooter(int originX, int originY) : base(WeaponTypes.THREE_SHOOTER)
        {
            this.X = originX;
            this.Y = originY;

            for (int i = 0; i < 3; i++)
            {
                Torpedo torpedo = new Torpedo(this.X, this.Y);

                if (i == 0)
                {
                    torpedo.X += 5;
                }
                else if (i == (Torpedos.Count - 1))
                {
                    torpedo.X -= 5;
                }

                Torpedos.Add(torpedo);
            }
        }
コード例 #9
0
    private void FireTorpedo()
    {
        Transform torpClone = Instantiate(torpedoPrefab, torpedoBay.position, Quaternion.identity) as Transform;
        Torpedo   torp      = torpClone.GetComponent <Torpedo>();

        torp.whatIsTarget = whatIsTarget;
        int layerValue = whatAreOurProjectiles.layermask_to_layer();

        torpClone.gameObject.layer = layerValue;

        if (CheckIfLookingAtTarget(out Transform subTarget) == true)
        {
            if (subTarget)
            {
                torp.target = subTarget;
            }
        }

        torpClone.up = transform.up;

        torpedoTimer = torpedoDelay + Time.time;
    }
コード例 #10
0
        void InitializeTorpedos()
        {
            Echo("Initializing torpedos: \n");
            int c = 0;

            for (int x = 1; x <= 8; x++)
            {
                string status = "";
                if (Torpedos.FindAll((b) => ((b.status == 1) && (b.Name == TORPEDO + x))).Count == 0)
                {
                    if (Torpedo.CheckBlocks(TORPEDO + x, out status))
                    {
                        Torpedos.Add(new Torpedo(TORPEDO + x, this));
                        c++;
                        Echo(status);
                    }
                }
            }
            Echo("\n" + c + " new torpedos initialized");
            Echo("\n" + Torpedos.FindAll((b) => ((b.status == 1))).Count + " torpedos ready for launch");
            Echo("\n" + Torpedos.FindAll((b) => ((b.status == 2))).Count + " torpedos on the way");
            Echo("\n" + Torpedos.Count + "torpedos in list");
        }
コード例 #11
0
    internal void LaunchTorpedo()
    {
        FindObjectOfType <questionManager>().questionNeeded = "";


        if (stateManager.gameState != playStatus.playing)
        {
            return;
        }

        ResetPosition(true);



        GameObject Torpedo = Instantiate(TorpedoPrefab, start.transform.position, start.transform.rotation, this.transform);

        FiredTorpedo = Torpedo.GetComponent <Torpedo>();

        float speed = .04f;

        speed = ((bossMaxHealth - bossHealth) * speed) + speed;

        FiredTorpedo.CreateTorpedo(start, end, boss, answers[0].ToString(), this, speed);
    }
コード例 #12
0
    private void DropBomb()
    {
        if (target)
        {
            if (bombPrefab.GetComponent <GuidedBomb>())
            {
                float       yOffsetDelay = Mathf.Clamp(1 / (30 / Mathf.Abs(transform.position.y)), 0f, 1f);
                Transform   bombClone    = Instantiate(bombPrefab, bombBay.position, transform.rotation) as Transform;
                Rigidbody2D bombRb       = bombClone.GetComponent <Rigidbody2D>();
                GuidedBomb  bomb         = bombClone.GetComponent <GuidedBomb>();
                int         layerValue   = whatAreOurProjectiles.layermask_to_layer();
                bombClone.gameObject.layer = layerValue;
                bomb.target             = target;
                bomb.timeBeforeBoosters = Mathf.Clamp(bomb.timeBeforeBoosters - yOffsetDelay, 0.6f, 2f);
                Debug.Log(bomb.timeBeforeBoosters + " | " + yOffsetDelay);
                bomb.whatIsEnemy = whatIsTarget;
                bombRb.velocity  = thisRb.velocity;
            }
            else if (bombPrefab.GetComponent <Torpedo>())
            {
                Transform torpClone = Instantiate(bombPrefab, bombBay.position, Quaternion.identity) as Transform;
                Torpedo   torp      = torpClone.GetComponent <Torpedo>();
                torp.whatIsTarget = whatIsTarget;
                int layerValue = whatAreOurProjectiles.layermask_to_layer();
                torpClone.gameObject.layer = layerValue;

                torpClone.up = transform.up;
            }
        }
        else
        {
            Debug.Log("No target");
        }

        dropTimer = dropDelay + Time.time;
    }
コード例 #13
0
 public void AddTorpedoToList(Torpedo newTorpedo)
 {
     torpedoes.Add(newTorpedo);
 }
コード例 #14
0
 public void TorpedoSolved()
 {
     selectedTorpedo = null;
     SelectClosestTorpedoFromList();
 }
コード例 #15
0
ファイル: TorpedoManager.cs プロジェクト: Norne9/TorpedoGame
 public void Despawn(Torpedo torpedo)
 {
     _torpedoes.Remove(torpedo);
     _torpedoPool.Despawn(torpedo);
 }
コード例 #16
0
ファイル: ShipOutfitter.cs プロジェクト: merihim/Random-Wing
        public Dictionary <string, int> RandomUpgrade(string upgradeType)
        {
            RandomizerHelper randomDictionary = new RandomizerHelper();
            string           upgradeName      = "";

            int[] numbers;
            int   shuffle = 0;
            Dictionary <string, int> dict;

            if (upgradeType.Contains("Cannon"))
            {
                Cannon cannons = new Cannon();
                dict = cannons.CannonUpgrades;
                Random rand = new Random();
                numbers = new[] { 1, 2, 3, 4, 5, 7 };
                shuffle = numbers.OrderBy(n => Guid.NewGuid()).ToArray().First();
                foreach (var weapon in randomDictionary.RandomValues(dict, shuffle).Take(1))
                {
                    upgradeName = weapon;
                    continue;
                }
            }
            else if (upgradeType.Contains("Torpedo"))
            {
                Torpedo torp = new Torpedo();
                dict = torp.TorpedoUpgrades;
                Random rand = new Random();
                numbers = new[] { 2, 3, 4, 5, 6 };
                shuffle = numbers.OrderBy(n => Guid.NewGuid()).ToArray().First();
                foreach (var weapon in randomDictionary.RandomValues(dict, shuffle).Take(1))
                {
                    upgradeName = weapon;
                    continue;
                }
            }
            else if (upgradeType.Contains("Illicit"))
            {
                Illicit illict = new Illicit();
                dict = illict.IllicitUpgrades;
                Random rand = new Random();
                numbers = new[] { 1, 2, 3 };
                shuffle = numbers.OrderBy(n => Guid.NewGuid()).ToArray().First();
                foreach (var weapon in randomDictionary.RandomValues(dict, shuffle).Take(1))
                {
                    upgradeName = weapon;
                    continue;
                }
            }
            else if (upgradeType.Contains("ElitePilotTalent"))
            {
                ElitePilotTalent ept   = new ElitePilotTalent();
                ShipBuilder      shipB = new ShipBuilder();
                if (shipB.CurrentFaction == "scum")
                {
                    foreach (var talents in ept.ScumEPT)
                    {
                        ept.GenEPT.Add(talents.Key, talents.Value);
                    }
                }

                dict = ept.GenEPT;
                Random rand = new Random();
                numbers = new[] { 0, 1, 2, 3, 4 };
                shuffle = numbers.OrderBy(n => Guid.NewGuid()).ToArray().First();
                foreach (var weapon in randomDictionary.RandomValues(dict, shuffle).Take(1))
                {
                    upgradeName = weapon;
                    continue;
                }
            }
            else if (upgradeType.Contains("Crew"))
            {
                Crew        crew  = new Crew();
                ShipBuilder shipB = new ShipBuilder();
                if (shipB.CurrentFaction == "scum")
                {
                    foreach (var talents in crew.ScumCrew)
                    {
                        crew.GenCrew.Add(talents.Key, talents.Value);
                    }
                }
                try
                {
                    crew.GenCrew.Remove(Ship1Name);
                }
                catch
                {
                    Console.WriteLine(string.Format("Attempted to remove {0} from the crew list, but didn't find them as an available crew.", Ship1Name));
                }

                try
                {
                    crew.GenCrew.Remove(Ship2Name);
                }
                catch
                {
                    Console.WriteLine(string.Format("Attempted to remove {0} from the crew list, but didn't find them as an available crew.", Ship2Name));
                }

                try
                {
                    crew.GenCrew.Remove(Ship3Name);
                }
                catch
                {
                    Console.WriteLine(string.Format("Attempted to remove {0} from the crew list, but didn't find them as an available crew.", Ship3Name));
                }


                dict = crew.GenCrew;
                Random rand = new Random();
                numbers = new[] { 1, 2, 3, 4, 5 };
                shuffle = numbers.OrderBy(n => Guid.NewGuid()).ToArray().First();
                foreach (var weapon in randomDictionary.RandomValues(dict, shuffle).Take(1))
                {
                    upgradeName = weapon;
                    UniqueList unique = new UniqueList();
                    if (unique.UniqueVar.Contains(upgradeName))
                    {
                        crew.GenCrew.Remove(upgradeName);
                    }
                    continue;
                }
            }
            else if (upgradeType.Contains("Missile"))
            {
                Missile missile = new Missile();

                dict = missile.MissileUpgrade;
                Random rand = new Random();
                numbers = new[] { 1, 3, 4, 5 };
                shuffle = numbers.OrderBy(n => Guid.NewGuid()).ToArray().First();
                foreach (var weapon in randomDictionary.RandomValues(dict, shuffle).Take(1))
                {
                    upgradeName = weapon;
                    continue;
                }
            }
            else if (upgradeType.Contains("SalvagedAstromech"))
            {
                SalvagedAstromech astromech = new SalvagedAstromech();

                dict = astromech.SalvagedAstromechs;
                Random rand = new Random();
                numbers = new[] { 0, 1, 2, 3 };
                shuffle = numbers.OrderBy(n => Guid.NewGuid()).ToArray().First();
                foreach (var weapon in randomDictionary.RandomValues(dict, shuffle).Take(1))
                {
                    upgradeName = weapon;
                    continue;
                }
            }
            else if (upgradeType.Contains("System"))
            {
                Systems system = new Systems();

                dict = system.SystemsUpgrade;
                Random rand = new Random();
                numbers = new[] { 0, 1, 2, 3, 4 };
                shuffle = numbers.OrderBy(n => Guid.NewGuid()).ToArray().First();
                foreach (var weapon in randomDictionary.RandomValues(dict, shuffle).Take(1))
                {
                    upgradeName = weapon;
                    continue;
                }
            }
            else if (upgradeType.Contains("Modification"))
            {
                Modification modification = new Modification();

                dict = modification.Modifications;
                Random rand = new Random();
                numbers = new[] { 0, 1, 2, 3, 4 };
                shuffle = numbers.OrderBy(n => Guid.NewGuid()).ToArray().First();
                foreach (var weapon in randomDictionary.RandomValues(dict, shuffle).Take(1))
                {
                    upgradeName = weapon;
                    continue;
                }
            }
            else if (upgradeType.Contains("Bomb"))
            {
                Bombs bomb = new Bombs();

                dict = bomb.BombUpgrades;
                Random rand = new Random();
                numbers = new[] { 2, 3, 4, 5 };
                shuffle = numbers.OrderBy(n => Guid.NewGuid()).ToArray().First();
                foreach (var weapon in randomDictionary.RandomValues(dict, shuffle).Take(1))
                {
                    upgradeName = weapon;
                    continue;
                }
            }

            dict = new Dictionary <string, int>();
            dict.Add(upgradeName, shuffle);
            return(dict);
        }
コード例 #17
0
 public void OnTorpedoSunk(LevelTile tile, Torpedo ammunition, TorpedoFailure?torpedoFailure)
 {
 }
コード例 #18
0
ファイル: Check.cs プロジェクト: nkast/FusionFramework
        public bool CheckState(ref List <Action> actionList)
        {
            //Stopwatch timer = new Stopwatch();
            //timer.Start();

            List <Submarine> submarines = queue.GameCollection.getSubmarines();
            List <Mine>      mines      = queue.GameCollection.getMines();

            if (entity is Submarine)
            {
                Submarine sub = entity as Submarine;
                actionList.Add(new Move(sub, to, queue, speed, noise));
                foreach (BaseC basec in sub.Team.Bases)
                {
                    if (basec.Cell == to)
                    {
                        actionList.Add(new Reload(sub));
                    }
                }
                foreach (Submarine submarine in submarines)
                {
                    if (sub != submarine)
                    {
                        if (to == submarine.Cell)
                        {
                            actionList.Add(new Accident(sub, submarine, queue));
                            actionList.Add(new Accident(submarine, sub, queue));
                            actionList.Add(new Move(sub, from, queue, speed, noise));
                            foreach (Mine mine in mines)
                            {
                                if (from == mine.Cell)
                                {
                                    actionList.Add(new Bang(mine, queue));
                                    actionList.Add(new MineDamage(sub, queue));
                                }
                            }
                            //timer.Stop();
                            //Console.WriteLine("Check. FrameID: " + gameTime.FrameID + ". Time: " + timer.Elapsed);
                            return(false);
                        }
                    }
                }
                foreach (Mine mine in mines)
                {
                    if ((to == mine.Cell) && (mine.activated))
                    {
                        actionList.Add(new Bang(mine, queue));
                        actionList.Add(new MineDamage(sub, queue));
                        //timer.Stop();
                        //Console.WriteLine("Check. FrameID: " + gameTime.FrameID + ". Time: " + timer.Elapsed);
                        return(true);
                    }
                }
            }
            if (entity is Torpedo)
            {
                Torpedo torpedo = entity as Torpedo;
                actionList.Add(new Move(torpedo, to, queue, speed, noise));
                foreach (Submarine submarine in submarines)
                {
                    if ((to == submarine.Cell) && (submarine != torpedo.Launcher))
                    {
                        actionList.Add(new Bang(torpedo, queue));
                        actionList.Add(new TorpedoDamage(submarine, queue));
                        //timer.Stop();
                        //Console.WriteLine("Check. FrameID: " + gameTime.FrameID + ". Time: " + timer.Elapsed);
                        return(false);
                    }
                }
                foreach (Submarine submarine in submarines)
                {
                    if ((to.Neighbours.Contains(submarine.Cell)) && (submarine != torpedo.Launcher))
                    {
                        actionList.Add(new Move(torpedo, submarine.Cell, queue, speed, noise));
                        actionList.Add(new Bang(torpedo, queue));
                        actionList.Add(new TorpedoDamage(submarine, queue));
                        //timer.Stop();
                        //Console.WriteLine("Check. FrameID: " + gameTime.FrameID + ". Time: " + timer.Elapsed);
                        return(false);
                    }
                }
            }

            //timer.Stop();
            //Console.WriteLine("Check. FrameID: " + gameTime.FrameID + ". Time: " + timer.Elapsed);
            return(true);
        }
コード例 #19
0
	//Reset the torpedo, called from the actual torpedo
	public void ResetTorpedo(Torpedo sender)
	{
		//Remove it from the actives, and add it to the inactive
		activated.Remove(sender);
		inactive.Add(sender);
	}
コード例 #20
0
 public void OnRegisterTorpedo(Torpedo torpedo)
 {
     levelView.OnRegisterAmmunition(torpedo);
 }
コード例 #21
0
        public Repository Insert(Repository value)
        {
            using (PinheiroSereniContext db = new PinheiroSereniContext())
            {
                try
                {
                    value.mensagem = Validate(value, Crud.INCLUIR);
                    if (value.mensagem.Code > 0)
                    {
                        throw new ArgumentException(value.mensagem.Message);
                    }

                    #region identifica o corretor da vez
                    SMSRepository  r        = (SMSRepository)value;
                    CorretorOnline corretor = r.corretor.obterCorretor(db.SMSs, db.CorretorOnlines);
                    #endregion

                    #region verifica se tem sessão ativa para o corretor da vez
                    var _s = from s in db.Sessaos
                             where s.corretorId == corretor.corretorId &&
                             s.dt_desativacao == null &&
                             s.statusOperador.Equals("O")
                             select s;
                    #endregion

                    #region Se o corretor da vez não tiver sessão ativa, procurar o primeiro corretor que esteja online
                    if (_s.Count() == 0)
                    {
                        _s = from s in db.Sessaos
                             where s.dt_desativacao == null &&
                             s.statusOperador.Equals("O") &&
                             s.corretorId != null
                             orderby s.CorretorOnline.indexEscala
                             select s;

                        if (_s.Count() == 0) // não tem corretor online => usar o corretor "Supervisor Online"
                        {
                            corretor = (from cor in db.CorretorOnlines where cor.nome == "Supervisor Online" select cor).FirstOrDefault();
                        }
                        else if (_s.Where(m => m.CorretorOnline.indexEscala >= corretor.indexEscala).Count() > 0)
                        {
                            _s       = _s.Where(m => m.CorretorOnline.indexEscala >= corretor.indexEscala);
                            corretor = db.CorretorOnlines.Find(_s.First().corretorId);
                        }
                    }
                    #endregion

                    #region insere o registro SMS do cliente
                    r.sms.dt_cadastro = DateTime.Now;
                    r.sms.corretorId  = corretor.corretorId;
                    db.SMSs.Add(r.sms);
                    db.SaveChanges();
                    #endregion

                    #region enviar o SMS

                    #if (release)
                    Torpedo torpedo = new Torpedo();
                    value.mensagem = torpedo.send("", r.sms.nome, r.sms.telefone, corretor.telefone);
                    Validate mensagemCaco = torpedo.send("", r.sms.nome, r.sms.telefone, "9184524500");
                    #endif

                    #endregion
                }
                catch (PinheiroSereniException ex)
                {
                    value.mensagem = new Validate()
                    {
                        Code = 17, Message = MensagemPadrao.Message(17).ToString(), MessageBase = ex.Message
                    };
                }
                catch (ArgumentException ex)
                {
                    value.mensagem = new Validate()
                    {
                        Code = value.mensagem.Code, Message = MensagemPadrao.Message(value.mensagem.Code.Value, "telefone", value.mensagem.Message.ToString()).ToString(), MessageBase = ex.Message
                    };
                }
                catch (Exception ex)
                {
                    throw new PinheiroSereniException(ex.Message, GetType().FullName);
                }
            }

            return(value);
        }
コード例 #22
0
 public void OnTorpedoHitGroundOrWater(LevelTile tile, Torpedo torpedo, float posX, float posY)
 {
 }
コード例 #23
0
 //Reset the torpedo, called from the actual torpedo
 public void ResetTorpedo(Torpedo sender)
 {
     //Remove it from the actives, and add it to the inactive
     activated.Remove(sender);
     inactive.Add(sender);
 }
コード例 #24
0
 /// <summary>
 /// Funkcja zostanie wywolana gdy torpeda przekroczy dopuszczalny dystans,
 /// lub gdy wyleci poza plansze.
 /// </summary>
 /// <param name="torpedo">Torpeda do odrejestrowania.</param>
 /// <author>Adam Witczak</author>
 public void OnUnregisterTorpedo(Torpedo torpedo)
 {
     AddJob(MethodBase.GetCurrentMethod().Name, new object[] { torpedo });
 }
コード例 #25
0
 public void RemoveTorpedoFromList(Torpedo torpedoToRemove)
 {
     torpedoes.Remove(torpedoToRemove);
 }
コード例 #26
0
 private void SelectTorpedo(Torpedo torpedo)
 {
     selectedTorpedo = torpedo;
 }
コード例 #27
0
 public void OnUnregisterTorpedo(Torpedo torpedo)
 {
     levelView.OnUnregisterTorpedo(torpedo);
 }
コード例 #28
0
ファイル: TorpedoHealth.cs プロジェクト: SamSeidenberg/DGames
 // Use this for initialization
 void Start()
 {
     _torpedo = GetComponent<Torpedo>();
 }
コード例 #29
0
 /// <summary>
 /// Wywołane kiedy torpeda została uszkodzona i "zatonęła"
 /// </summary>
 /// <param name="tile"></param>
 /// <param name="ammunition"></param>
 /// <param name="torpedoFailure"></param>
 public void OnTorpedoSunk(LevelTile tile, Torpedo ammunition, TorpedoFailure?torpedoFailure)
 {
     AddJob(MethodBase.GetCurrentMethod().Name, new object[] { tile, ammunition, torpedoFailure });
 }
コード例 #30
0
 /// <summary>
 /// Funkcja jest wywolywana jesli torpeda wpadnie do wody
 /// </summary>
 /// <param name="tile">Obiekt, ktory zostal trafiony.</param>
 /// <param name="torpedo">Torpeda ktora trafila w obiekt.</param>
 /// <param name="posX"></param>
 /// <param name="posY"></param>
 ///
 /// <author>Adam Witczak</author>
 public void OnTorpedoHitGroundOrWater(LevelTile tile, Torpedo torpedo, float posX, float posY)
 {
     AddJob(MethodBase.GetCurrentMethod().Name, new object[] { tile, torpedo, posX, posY });
 }
コード例 #31
0
 public void PutProjectile(Torpedo torpedo)
 {
     torpedo.Release();
     pools.PutTo(TORPEDO_POOL, torpedo.gameObject);
 }