private IEnumerator DropBridge() { while (Mathf.Abs(createdBridge.transform.eulerAngles.z - 270) > 1) { createdBridge.transform.eulerAngles += new Vector3(0, 0, -ValueStepOfDroppingBridge); yield return(new WaitForEndOfFrame()); } if (playerMovement.GetPlayerResult(transform.position + new Vector3(SpriteUtilities.GetSpriteHeight(createdBridge), 0, 0)) != 0) { AudioManager.instance.Play("BridgeFall1"); } //Заставляем игрок идти на ту точку playerMovement.MovePlayerTo(transform.position + new Vector3(SpriteUtilities.GetSpriteHeight(createdBridge), 0, 0), this); yield return(null); }
private IEnumerator BridgeCreatingCorountine() { createdBridge = CreateBridge(); //Пока создаём мост while (IsCreating) { createdBridge.transform.localScale += new Vector3(0, ValueStepOfCreating, 0); //Позиция верхушки моста Vector3 posTopOfBridge = transform.position + new Vector3(0, SpriteUtilities.GetSpriteHeight(createdBridge), 0); //Поворачиваем руку мага к мосту TurnHandToBridge(posTopOfBridge); yield return(null); } yield return(null); }