| | |
| | | /// <param name="firingPoints"></param> |
| | | public virtual void Launch(Targetable enemy, GameObject attack, Transform[] firingPoints) |
| | | { |
| | | var poolable = Poolable.TryGetPoolable<Poolable>(attack); |
| | | if (poolable == null) |
| | | { |
| | | return; |
| | | } |
| | | // var poolable = Poolable.TryGetPoolable<Poolable>(attack); |
| | | // if (poolable == null) |
| | | // { |
| | | // return; |
| | | // } |
| | | GameObject obj = Instantiate(attack); |
| | | |
| | | // 此处设置局内升级数据对应的攻击数据: |
| | | Damager tm = poolable.gameObject.GetComponent<Damager>(); |
| | | Damager tm = obj.GetComponent<Damager>(); |
| | | if (tm) |
| | | { |
| | | tm.IsEnhancedBullet = attack.GetComponent<Damager>().IsEnhancedBullet; |
| | | Damager srctm = attack.GetComponent<Damager>(); |
| | | tm.inSceneUpGradeDamage = srctm.inSceneUpGradeDamage; |
| | | tm.doubleHit = srctm.doubleHit; |
| | | BallisticAttack ballisticAttack = poolable.gameObject.GetComponent<BallisticAttack>(); |
| | | BallisticAttack ballisticAttack = obj.GetComponent<BallisticAttack>(); |
| | | ballisticAttack.TowerPtr = attack.GetComponent<Damager>().TowerPtr; |
| | | |
| | | // 最后一颗子弹的多倍伤害. |
| | |
| | | srctm.damageMulti = 1.0f; |
| | | } |
| | | // WORK START: 从 Pool 内获取数据的时候,就把原来的数据清除掉了. |
| | | Launch(enemy, poolable.gameObject, firingPoints[0]); //GetRandomTransform(firingPoints)); |
| | | Launch(enemy, obj, firingPoints[0]); //GetRandomTransform(firingPoints)); |
| | | } |
| | | |
| | | /// <summary> |