public void EnterToOtherMap(TilePos startPos) { StopMove(); SetPos(startPos); SetDir(Direction.Bottom); if (this.warpSound) { AudioSource.PlayClipAtPoint(warpSound, Camera.main.transform.position); } this.warpping = true; StartCoroutine(CoroutineUtil.DelayRoutine(1.0f, delegate() { this.warpping = false; } )); }
void EnterPortal(Portal portal) { if (portal == null) { return; } Portal linkedPortal = portal.LinkedPortal; if (linkedPortal == null) { return; } ITileMapObject tileMapObj = linkedPortal.GetComponent <ITileMapObject>(); if (tileMapObj == null) { return; } StopMove(); SetPos(tileMapObj.TilePos); SetDir(Direction.Bottom); if (this.warpSound) { AudioSource.PlayClipAtPoint(warpSound, Camera.main.transform.position); } this.warpping = true; StartCoroutine(CoroutineUtil.DelayRoutine(1.0f, delegate() { this.warpping = false; } )); }