public void ControlUpdate()
    {
        if (!stats.IsAssembly)
        {
            return;
        }

        if (input.yeet.IsPressed())
        {
            SlimeType selectedType = unitHandler.SelectedType;
            if (selectedType.IsKing())
            {
                if (hp.IsFull())
                {
                    PerformYeet(selectedType);
                }
            }
            else
            {
                PlayerBaseStats unitStats = unitHandler.GetSelectable(selectedType).Stats;
                int             hearts    = unitStats.Hearts;
                if (hp.CurrentHP > hearts)
                {
                    PerformYeet(selectedType);
                }
            }
        }
    }
Exemple #2
0
    public void YeetOutside(SlimeType type)
    {
        PlayerUnitSelectable selectable = unitHandler.GetSelectable(type);

        selectable.UnitController.di.camera.CameraSegment = unitController.di.camera.CameraSegment;
        selectable.GetYeeted(unitController.di.yeetModule);
        selectable.SetActive();
    }
    private void OnSelectChange(SlimeType selectedType)
    {
        SlimeTypeUI newSelectedSlimeUI = slimeTypesUI[selectedType];

        crownUI.transform.SetParent(newSelectedSlimeUI.transform, worldPositionStays: false);
        if (selectedSlimeUI)
        {
            selectedSlimeUI.Deselect();
        }
        selectedSlimeUI = newSelectedSlimeUI;
        selectedSlimeUI.Select();

        foreach (SlimeType slimeType in SlimeTypeHelpers.GetEnumerable())
        {
            if (unitHandler.GetSelectable(slimeType).IsUnlocked)
            {
                slimeTypesUI[slimeType].Show();
            }
            else
            {
                slimeTypesUI[slimeType].Hide();
            }
        }
    }