//进入场景后 public override void OnEnterScene(BaseScene scene, uint instanceid) { base.OnEnterScene(scene, instanceid); try { mFlyController = initFlyController(); mExplodeController = initExplodeController(); } catch (System.Exception exception) { switch2State(BulletState.Invalid); GameDebug.LogError(exception); return; } // 检查从开火者位置到枪口的碰撞等. BulletState newState = readyCheck(); // 根据子弹的飞行控制器, 确定目标点. if (newState != BulletState.Arrived) { verifyRange(mBulletParam); } // switch2State(newState); // mFlyController.Launch(); }
public override void Destroy() { BehaviourUtil.StopCoroutine(generateVisual((int)mBulletResource.bulletFigureID)); if (mAlertEffect != uint.MaxValue) { Scene.RemoveEffect(mAlertEffect); } if (mVisual != null) { ParticleVisual.DestroyParticle(mVisual); mVisual = null; } mFlyController = null; mExplodeController = null; base.Destroy(); }