示例#1
0
    public void StartSleeping(RestingPlace place = null, bool block_moves = true)
    {
        if (!Player.Get().CanSleep())
        {
            return;
        }
        this.m_RestingPlace = place;
        this.SetupSurroundingConstructions();
        if (block_moves)
        {
            this.m_Player.BlockMoves();
            this.m_Player.BlockRotation();
        }
        this.m_StartSleepingTime = Time.time;
        this.m_StartSleepHour    = this.m_Sky.Cycle.Hour;
        this.m_Progress          = 0f;
        this.m_PrevProgress      = 0f;
        this.m_HourProgress      = 0;
        HUDSleeping.Get().gameObject.SetActive(true);
        MenuInGameManager.Get().HideMenu();
        Item currentItem = this.m_Player.GetCurrentItem(Hand.Right);

        if (currentItem != null && currentItem.m_Info.IsHeavyObject())
        {
            this.m_Player.DropItem(currentItem);
        }
        Player.Get().StartController(PlayerControllerType.Sleep);
        PlayerAudioModule.Get().PlaySleepSound();
        GreenHellGame.Instance.SetSnapshot(AudioMixerSnapshotGame.Sleep, 0.5f);
        if (Inventory3DManager.Get().IsActive())
        {
            Inventory3DManager.Get().Deactivate();
        }
    }
示例#2
0
 public void SetRestingPlace(RestingPlace place)
 {
 }