Пример #1
0
 public void Play()
 {
     if (Application.isPlaying)
     {
         particleController.Play();
     }
     else
     {
         Debug.LogWarning("In order to see ParticleController working, please enter Play mode.");
     }
 }
Пример #2
0
 /// <summary>
 /// 发射炮弹,后坐力展示
 /// </summary>
 /// <param name="cannonballSpeed"></param>
 /// <returns></returns>
 void Fire(Vector3 cannonballSpeed) //发射,炮弹在这里出膛!
 {
     for (int i = 0; i < firePosition.Length; i++)
     {
         CannonBall canball = ParticleController.FireConnonBall(firePosition[i].position, cannonballSpeed, BulletType.normal, data.deviation);      //再注释回来
         //canball.SetCannonBall(cannonballSpeed, .3f);
         canball.data.belongTo = belongTo;
     }
     if (isVisible)
     {
         ParticleController.Play(firePosition[0].position, CannonBarrel.rotation, ExploseType.normal);
         if (recoilAnim)
         {
             recoilAnim.Play();
         }
     }
     canFire = true;
 }
Пример #3
0
    public void BecomeJuggernaut()
    {
        isJuggernaut = true;
        PlayerEnemyHandler playEnHand = GetComponent <PlayerEnemyHandler> ();

        playEnHand.ClearEnemies();
        WeaponManager wepMan = GetComponent <WeaponManager> ();

        wepMan.SetAllDamageMults(1f);
        wepMan.SetAllDamageReds(1f);
        wepMan.SetAllAttackSpeedReds(.7f);
        HealthScript healthScript = GetComponent <HealthScript> ();

        move_mult = 1f;
        healthScript.health_max = 500f;
        healthScript.health     = healthScript.health_max;
        healthScript.lives      = 6;
        playEnHand.enemy_count  = 7;
        ParticleController partCont = GetComponentInChildren <ParticleController> ();

        partCont.Play(4);
    }
Пример #4
0
 /// <summary>
 /// 受到炮弹伤害
 /// </summary>
 /// <param name="cannonball">实施伤害炮弹</param>
 public void OnReceiveDamage(CannonBall cannonball)   //当受到伤害
 {
     if (cannonball.data.belongTo == transform)
     {
         return;
     }
     cannonball.OnHitEnemy(); //通知炮弹攻击到目标,自动隐藏
     shipData.health -= cannonball.data.damage;
     if (isAlive)             //判断是否存活
     {
         if (!isVisible)      //如果相机看不到,那就别忙活了(效果可以省略了).
         {
             return;
         }
         ParticleController.Play(cannonball.transform.position, Quaternion.identity, ExploseType.fire); //播放爆炸特效
         if (IsHitLeft(cannonball.transform.position))
         {
             if (isVisible && animBehaviour)
             {
                 animBehaviour.Play("HitLeft");
             }
         }
         else
         {
             if (isVisible && animBehaviour)
             {
                 animBehaviour.Play("HitRight");
             }
         }
         if (ripple)
         {
             ripple.SetShow(); //播放波纹
         }
     }
     else
     {
         OnDie();
     }
 }
Пример #5
0
 /// <summary>
 /// 打击到水面时调用此方法
 /// </summary>
 public void OnHitWater()
 {
     //击中水面特效
     ParticleController.Play(transform.position, Quaternion.identity, ExploseType.water);
     gameObject.SetActive(false);
 }