protected override void OnInit() { var initialSize = GetComponent <Renderer>().bounds.size; float spawnMinX = SpaceUtil.WorldMap.Left.x + initialSize.x; float spawnMinY = (SpaceUtil.WorldMap.Bottom.y + SpaceUtil.WorldMap.Center.y) * 0.5f; SpawnMin = new Vector2(spawnMinX, spawnMinY); float spawnMaxX = SpaceUtil.WorldMap.Right.x - initialSize.x; float spawnMaxY = (SpaceUtil.WorldMap.Center.y + SpaceUtil.WorldMap.Top.y) * 0.5f; SpawnMax = new Vector2(spawnMaxX, spawnMaxY); var activateCanCollide = new GameTaskFunc(this, () => CanCollide = true); float fullBrightAlpha = Alpha; var entranceFadeIn = new FadeTo(this, 0f, fullBrightAlpha, FadeTime); var entranceScaleIn = new ScaleTo(this, float.Epsilon, LocalScale, FadeTime); var entranceSequence = new Sequence(entranceFadeIn, entranceScaleIn, activateCanCollide); var fadeOut = new FadeTo(this, fullBrightAlpha, TravelAlpha, FadeTime); var fadeOutEase = new EaseIn3(fadeOut); var scaleOut = new ScaleTo(this, LocalScale, TravelSizeScale, FadeTime); var scaleOutEase = new EaseIn3(scaleOut); var fadeOutConcurrence = new ConcurrentGameTask(fadeOutEase, scaleOutEase); TravelMove = MoveTo.Default(this, 1.0f); TravelMoveEase = new EaseInOut(TravelMove); var fadeIn = new FadeTo(this, TravelAlpha, fullBrightAlpha, FadeTime); var scaleIn = new ScaleTo(this, TravelSizeScale, LocalScale, FadeTime); var fadeInConcurrence = new ConcurrentGameTask(fadeIn, scaleIn); TravelSequence = new Sequence(fadeOutConcurrence, TravelMoveEase, fadeInConcurrence, activateCanCollide); CanCollide = false; LocalScale = float.Epsilon; transform.position = SpaceUtil.WorldMap.Center; RunTask(entranceSequence); }