public override void DoInitialize() { this.mapType = MapType.QUICKTIME; this.fallingObjectResObj = this.fallingObjectRes.GetRandomFallingObjectRes(); this.levelIconSprite = this.fallingObjectResObj.fallingObjectSprite; this.fallingObject.Initialize(this.reference, this.OnGetHit, this.fallingObjectResObj); this.cameraResetter.Initialize(this.OnSkip); this.playerDefaultPosition = GameManager.Instance.gameController.mapScroller.playerDefaultPosition.position.x; }
public void Initialize(double reference, Action onHit, FallingObjectResObj fallingObjectRes) { this.dealDamageInteractableObject.Initialize(reference, onHit); this.transform.SetParent(null); this.fallingObjectResObj = fallingObjectRes; this.sprite.sprite = fallingObjectRes.fallingObjectSprite; Vector3 playerPos = GameManager.Instance.gameController.mapScroller.playerDefaultPosition.position; this.timeToFallToPlayer = (this.transform.position.y - playerPos.y) / this.fallSpeed; this.xMoveSpeed = (this.transform.position.x - playerPos.x) / this.timeToFallToPlayer; }