示例#1
0
        protected override void OnBounce(Enemy enemy)
        {
            MostRecentTargetVelocity = enemy.Velocity;

            var direction = RandomUtil.RandomDirectionVector(Speed);

            VelocityChange.Init(direction, -direction);
        }
示例#2
0
        protected override void OnPlayerBulletFrameRun(float deltaTime, float realDeltaTime)
        {
            VelocityChange.RunFrame(deltaTime);
            Trail.transform.position = transform.position;

            // Basic (and deliberately-flawed) homing system - apply velocity of most recent target
            ApplyVelocity(MostRecentTargetVelocity, deltaTime);
        }
        protected override void OnPlayerBulletInit()
        {
            Collider = GetComponent <CircleCollider2D>();

            ActivateCollider = new FuncAfterDelay(this, () => Collider.enabled = true, EntranceAnimationTime);
            var fadeIn = new FadeTo(this, 0, Alpha, EntranceAnimationTime);

            VelocityChange = new VelocityChange(this, Vector2.zero, Vector2.zero, EntranceAnimationTime);
            var easeVelocityOut = new EaseOut(VelocityChange);

            EntranceAnimation = new ConcurrentGameTask(fadeIn, easeVelocityOut, ActivateCollider);
        }
示例#4
0
 protected override void OnPlayerBulletInit()
 {
     Accelerate = new VelocityChange(this, StartVelocity, EndVelocity, AccelerationTime);
 }
示例#5
0
 protected override void OnBouncingBulletActivate()
 {
     VelocityChange.FinishSelf();
     MostRecentTargetVelocity = Vector2.zero;
 }
示例#6
0
 protected override void OnBouncingBulletInit()
 {
     VelocityChange = VelocityChange.Default(this, VelocityChangerDuration);
 }