Exemple #1
0
    public static void GameScreenEvents(Settings.GameScreenEvents eventType)
    {
        if (eventType == Settings.GameScreenEvents.NOT_ABLE_TO)
        {
            var             simple_text_obj = ScreenUIManager.Instance.UIPoolList.GetFromPool(Settings.PoolTypes.UI_SIMPLE_MESSAGE_TEXT, new Vector3(0, 0, 0), Quaternion.identity, ScreenUIManager.Instance.mainScreenStaticCanvas.transform);
            TextMeshProUGUI simple_text     = simple_text_obj.GetComponent <TextMeshProUGUI>();

            if (simple_text != null)
            {
                // Kontrolér
                SimpleMessageController simple_text_controller = simple_text.GetComponent <SimpleMessageController>();

                simple_text_controller.move              = true;
                simple_text_controller.translateSpeed    = new Vector3(0, 0.5f, 0f);
                simple_text_controller.distanceFromEdges = 50f;

                // Nastavíme pozici
                simple_text.GetComponent <RectTransform>().localPosition = new Vector3(0, 0, 0);

                // Zapneme blok
                simple_text.gameObject.SetActive(true);


                // Nastavíme message
                simple_text.text = TextHolder.NOT_ABLE_TO_PLACE_BLOCK;
                // Nastavíme barvu
                simple_text.color = ColorDecryptor.GetColorFromString(Settings.COLOR_RED_WARNING);
                ScreenUIManager.Instance.FadeTextColor(simple_text, 1, 2f, 1f);
            }

            ScreenUIManager.Instance.UIPoolList.ReturnToPool(Settings.PoolTypes.UI_SIMPLE_MESSAGE_TEXT, simple_text_obj);
        }
    }
Exemple #2
0
    /// <summary> Vrací příslušnou barvu kontroléru, podle typu.</summary>
    /// <param name="c_type"></param>
    /// <returns></returns>
    public static Color GetCheckerColorByType(Settings.Checkers_types c_type)
    {
        // Podle typu checkeru rozřadíme barvičky
        switch (c_type)
        {
        case Settings.Checkers_types.LIFE_SUPPORT:
            return(ColorDecryptor.GetColorFromString(Settings.COLOR_C_TYPE_GREAN));

        case Settings.Checkers_types.POWER:
            return(ColorDecryptor.GetColorFromString(Settings.COLOR_C_TYPE_ORANGE));

        case Settings.Checkers_types.BLANK:
        case Settings.Checkers_types.STANDART:
            return(ColorDecryptor.GetColorFromString(Settings.COLOR_C_TYPE_BLUE));    //Manager.Instance.themeModulColors[0];

        default:
            return(new Color());
        }
    }