public void OnAddInteraction(AbstractInteraction interaction)
    {
        var laserInteraction = interaction as LaserInteraction;

        if (laserInteraction != null)
        {
            var titanView      = laserInteraction.ParentTitan.View as TitanView;
            var enemyTitanView = laserInteraction.TargetTitan.View as TitanView;
            if (laserInteraction.Damage.Value > 0)
            {
                LaserBeamPool.ShowHit(titanView.GetHitPoint(), enemyTitanView.GetHitPoint(), 0.5f);
            }
            else
            {
                LaserBeamPool.ShowMiss(titanView.GetHitPoint(), enemyTitanView.GetHitPoint(), 0.5f);
            }
        }
        var rocketInteraction = interaction as RocketInteraction;

        if (rocketInteraction != null)
        {
            RocketsPool.Fire(rocketInteraction);
        }
    }
Exemple #2
0
 private void Awake()
 {
     instance = this;
 }