Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
    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;
    }