Exemple #1
0
    /// TELEPORT

    public ITeleportable TeleportTo(Teleport pTeleport)
    {
        //simulated on owner side
        if (!player.IsItMe)
        {
            return(null);
        }

        transform.position = Vector2.one * 666;
        player.SetActive(false);

        //small teleport delay
        DoInTime(() =>
        {
            transform.position = pTeleport.GetOutPosition();
            player.SetActive(true);
            SetDirection(pTeleport.OutDirection);
            SyncPosition(true);
        }, 0.5f);

        return(this);
        //transform.position = pTeleport.OutPosition.position;
        //SetDirection(pTeleport.OutDirection);
        //SyncPosition(true);
    }
Exemple #2
0
    /// TELEPORT

    public ITeleportable TeleportTo(Teleport pTeleport)
    {
        //simulated on owner side
        if (!Owner.IsItMe)
        {
            return(null);
        }

        Projectile newProjectile = game.ProjectileManager.SpawnProjectile(
            pTeleport.GetOutPosition(), Owner, config, pTeleport.OutDirection);

        ReturnToPool();
        return(newProjectile);
    }