Наследование: MonoBehaviour, IPointerDownHandler
Пример #1
0
    private void Start()
    {
        IsDisabled    = false;
        TabImage      = GetComponent <Image>();
        InteriorImage = transform.GetChild(0).GetComponent <Image>(); // GetComponentInChildren searches first in parent
        if (InteriorImage != null)
        {
            _defaultImageSize    = InteriorImage.transform.localScale;
            _innerImageIdleColor = InteriorImage.color;
        }

        InteriorText = transform.GetChild(0).GetComponent <TextMeshProUGUI>();
        if (InteriorText != null)
        {
            _defaultTextSize    = InteriorText.transform.localScale;
            _innerTextIdleColor = InteriorText.color;
        }

        _disabler = GetComponent <OnConditionDisabler>();
        if (_disabler != null)
        {
            _disabler.OnDisableCondition += DisableButton;
        }

        _showTooltip = GetComponent <ShowTooltip>();
    }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     gameSystem = FindObjectOfType <GameSystem>();
     slider     = GetComponent <Slider>();
     tooltip    = GetComponent <ShowTooltip>();
     StartValues();
 }
Пример #3
0
 void Start()
 {
     inv        = GameObject.Find("ItemDatabase").GetComponent <Inventory>();
     playerStat = GameObject.Find("Player").GetComponent <PlayerStat>();
     player     = playerStat.gameObject.GetComponent <Player>();
     tooltip    = inv.GetComponent <ShowTooltip>();
     this.transform.SetParent(inv.slots[slot].transform);
     this.transform.position = inv.slots[slot].transform.position;
     transform.localScale    = new Vector3(1, 1, 1);
 }
Пример #4
0
 private void Awake()
 {
     image    = GetComponent <Image>();
     tooltip  = GetComponent <ShowTooltip>();
     traits   = new List <Trait>(numTraits);
     action   = (EmployeeActions)0;
     isAbsent = false;
     CreateEmployee();
     if (tooltip != null)
     {
         UpdateTooltipText();
     }
 }
Пример #5
0
        protected string GetClientSideSettings()
        {
            string tmid = "-1";

            if ((UserId > -1))
            {
                tmid = TabModuleId.ToString(CultureInfo.InvariantCulture);
            }
            return(string.Format("allowIconSizeChange: {0}, allowDetailChange: {1}, selectedSize: '{2}', showDetails: '{3}', tabModuleID: {4}, showTooltip: {5}",
                                 AllowSizeChange.ToString(CultureInfo.InvariantCulture).ToLowerInvariant(),
                                 AllowViewChange.ToString(CultureInfo.InvariantCulture).ToLowerInvariant(),
                                 DefaultSize,
                                 DefaultView,
                                 tmid,
                                 ShowTooltip.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()));
        }
Пример #6
0
    private void Start()
    {
        TabImage          = GetComponent <Image>();
        InteriorImage     = transform.GetChild(0).GetComponent <Image>(); // GetComponentInChildren searches first in parent
        _defaultImageSize = InteriorImage.transform.localScale;
        _tabGroup.BindTab(this);

        if (_startsSelected)
        {
            _tabGroup.OnTabSelected(this);
        }

        _disabler = GetComponent <OnConditionDisabler>();
        if (_disabler != null)
        {
            _disabler.OnDisableCondition += DisableButton;
        }

        _showTooltip = GetComponent <ShowTooltip>();
    }
        protected override IEnumerator ProcessPayload(VisualPayload payload)
        {
            var groupId = GroupId.GetFirstValue(payload.Data);

            DataSharedTooltipVisualizer newVisualizer;

            if (!DataShare.ContainsKey(groupId))
            {
                newVisualizer = VisualizerFactory.InstantiateDataSharedTooltipVisualizer();

                newVisualizer.Initialize(this, payload);

                DataShare[groupId] = newVisualizer;
            }
            else
            {
                newVisualizer = DataShare[groupId];
            }


            newVisualizer.TextColor       = FontColor.GetFirstValue(payload.Data);
            newVisualizer.FontSize        = FontSize.GetFirstValue(payload.Data);
            newVisualizer.BackgroundColor = BackgroundColor.GetFirstValue(payload.Data);
            newVisualizer.CheckRedeclareStyle();


            newVisualizer.DisplayText =
                ShowTooltip.GetFirstValue(payload.Data)?
                Tooltip.GetFirstValue(payload.Data):"";

            newVisualizer.DrawPosition = ScreenPosition.GetFirstValue(payload.Data);

            var iterator = Router.TransmitAll(payload);

            while (iterator.MoveNext())
            {
                yield return(null);
            }
        }
Пример #8
0
 void Start()
 {
     inv        = GameObject.Find("ItemDatabase").GetComponent <Inventory>();
     tooltip    = inv.GetComponent <ShowTooltip> ();
     playerStat = GameObject.Find("Player").GetComponent <PlayerStat>();
 }
Пример #9
0
    void Awake()
    {
        //Static initialization
        Instance = this;

        AudioListener.pause = false;

        possibleGameTypes = new Dictionary <string, Type>();
        possibleGameTypes.Add("Team Deathmatch", typeof(TeamDeathmatch));
        possibleGameTypes.Add("Deathmatch", typeof(Deathmatch));

        //Automatically initialize the lists, DON'T TOUCH!
        if (gameTypeIndexes == null || gameTypeNames == null)
        {
            gameTypeIndexes = new Dictionary <string, int>();
            gameTypeNames   = new Dictionary <int, string>();

            List <string> gameTypeKeys = new List <string>(possibleGameTypes.Keys);
            for (int i = 0; i < gameTypeKeys.Count; i++)
            {
                gameTypeIndexes.Add(gameTypeKeys[i], i);
                gameTypeNames.Add(i, gameTypeKeys[i]);
            }
        }

        Topan.Network.sendNetworkViewsOnConnect = false;
        Topan.Network.enableDebugging           = true;
        tooltipInfo = moreInfoButton.GetComponent <ShowTooltip>();
        ServerEditMode(false);

        mapSelectionBox.transform.localPosition = sliderStart.localPosition;

        for (int i = 0; i < StaticMapsList.mapsArraySorted.Count; i++)
        {
            GameObject newHostMap = (GameObject)Instantiate(mapSelection);
            newHostMap.transform.parent        = sliderStart.parent;
            newHostMap.transform.localPosition = sliderStart.localPosition + (Vector3.right * mapSpacing * i);
            newHostMap.transform.localRotation = sliderStart.localRotation;
            newHostMap.transform.localScale    = Vector3.one;
            ButtonAction hostba = newHostMap.GetComponent <ButtonAction>();
            hostba.sendMessage.numericalMessage.enabled         = true;
            hostba.sendMessage.numericalMessage.isInt           = true;
            hostba.sendMessage.numericalMessage.messageName     = "SelectMap";
            hostba.sendMessage.numericalMessage.messageReceiver = gameObject;
            hostba.sendMessage.numericalMessage.valueToSend     = i;

            MapGUI MGUI    = newHostMap.GetComponent <MapGUI>();
            Map    thisMap = StaticMapsList.mapsArraySorted[i];
            MGUI.nameLabel.text = thisMap.mapName;
            MGUI.description    = thisMap.mapName + "|| " + thisMap.loaderSubheader;

            if (thisMap.previewIcon != null)
            {
                MGUI.mapScreenshot.mainTexture = thisMap.previewIcon;
            }
        }

        selectedMap = Mathf.Clamp(PlayerPrefs.GetInt("SavedMapIndex", 0), 0, StaticMapsList.mapsArraySorted.Count - 1);
        UpdateSelection();

        IPInput.value             = PlayerPrefs.GetString("SavedIPConnect", "127.0.0.1");
        portInput.value           = PlayerPrefs.GetString("SavedPortConnect", "7100");
        pingLimitInput.value      = PlayerPrefs.GetString("SavedPingLimit", "9999");
        portForwardCheckbox.value = (PlayerPrefs.GetInt("PortForward", 0) == 1) ? true : false;
        hostLocalCheckbox.value   = (PlayerPrefs.GetInt("LocalServer", 0) == 1) ? true : false;

        mpErrorTooltip.text = "Validating client version...";
        InvokeRepeating("GetModeSettings", 0f, 1f); //For the clients
        cInput.Init();                              //Initialize cInput at start of game, so we can avoid initializing during gameplay.
    }