Пример #1
0
    protected override void ApplyNewValue(string newValue)
    {
        _localize.key = newValue;
#if NGUI_2
        _localize.Localize();
#endif
    }
Пример #2
0
    private bool isClickable = true;            // When the card is showing/animating lock the click, internal check of card state

    public void Initialize(ImmutableDataMemoryTrigger triggerData, bool isSprite)
    {
        triggerName = triggerData.Name;

        tweeningCoverParent = coverSprite.transform.parent.gameObject;

        // Set components on start
        if (isSprite)
        {
            triggerSprite.sprite  = SpriteCacheManager.GetSprite(triggerData.SpriteName);
            triggerSprite.name    = triggerData.SpriteName;
            tweeningContentParent = triggerSprite.transform.parent.parent.gameObject;           // Get grandfather
            triggerLabelLocalize.transform.parent.gameObject.SetActive(false);                  // Disable the unused half
        }
        else
        {
            triggerLabelLocalize.key = triggerData.DisplayKey;
            triggerLabelLocalize.Localize();
            tweeningContentParent = triggerLabelLocalize.transform.parent.gameObject;           // Get grandfather
            triggerSprite.transform.parent.parent.gameObject.SetActive(false);                  // Disable the unused half
        }

        // Hide the original card content until its clicked
        tweeningContentParent.SetActive(false);

        // Assign the respective trigger type particle
        GameObject particlePrefab = Resources.Load(triggerData.TypeParticlePrefab) as GameObject;

        triggerTypeParticle = GameObjectUtils.AddChild(gameObject, particlePrefab).GetComponent <ParticleSystem>();
    }
 public void updateSelection()
 {
     label.key = soundOptionsArray.isSoundOn?keySoundON:keySoundOFF;
     label.Localize();
     soundONIcon.SetActive(soundOptionsArray.isSoundOn);
     soundOFFIcon.SetActive(!soundOptionsArray.isSoundOn);
 }
    protected override void ApplyNewValue(string newValue)
    {
        if (!isAwake)
        {
            Awake();
        }

        _localize.key = newValue;
        //_localize.Localize();
#if NGUI_2
        _localize.Localize();
#endif
    }
Пример #5
0
    public void ShowCategory(AccessoryTypes type)
    {
        baseTween.Hide();
        gridTween.Show();
        int itemCount = 0;

        // Reset accessory list
        accessoryEntryList = new List <AccessoryStoreItemController>();

        // Populate the entries with loaded data
        List <Item> accessoryList = ItemManager.Instance.AccessoryList;

        foreach (AccessoryItem accessoryData in accessoryList)
        {
            if (accessoryData.AccessoryType == type)
            {
                // Change the title of the category
                switch (accessoryData.AccessoryType)
                {
                case AccessoryTypes.Hat:
                    categoryBanner.key = "ACCESSORIES_TYPE_HAT";
                    break;

                case AccessoryTypes.Glasses:
                    categoryBanner.key = "ACCESSORIES_TYPE_GLASSES";
                    break;

                default:
                    Debug.LogError("Invalid accessory type");
                    break;
                }
                categoryBanner.Localize();                    // Force relocalize

                GameObject accessoryEntry = GameObjectUtils.AddChild(gridParent.gameObject, accessoryEntryPrefab);
                AccessoryStoreItemController entryController = accessoryEntry.GetComponent <AccessoryStoreItemController>();
                entryController.Init(accessoryData);
                accessoryEntryList.Add(entryController);
                itemCount++;
            }
        }

        // Adjust the grid height based on the height of the cell and spacing
        float gridHeight = itemCount * (gridParent.cellSize.y + gridParent.spacing.y);

        gridParent.GetComponent <RectTransform>().sizeDelta = new Vector2(gridParent.cellSize.x, gridHeight);
    }
    public override void LocalizeButtonText(string leftStrIDS, string rightStrIDS)
    {
        if (!string.IsNullOrEmpty(leftStrIDS))
        {
            UILocalize localizeLeft = leftButtonLabel.gameObject.GetComponent <UILocalize>();

            localizeLeft.key = leftStrIDS;

            localizeLeft.Localize();
        }

        if (!string.IsNullOrEmpty(rightStrIDS))
        {
            UILocalize localizeRight = rightButtonLabel.gameObject.GetComponent <UILocalize>();

            localizeRight.key = rightStrIDS;

            localizeRight.Localize();
        }
    }
    public void setDisplayedDevice(
        Device device
        , string status = _defaultStatus
        , string infos  = _defaultInfo
        , string name   = _defaultName
        )
    {
        Logger.Log("FinalizationInfoPanelManager::setDisplayedDevice(" + device + ")"
                   + "with status=" + status
                   + ", infos=" + infos
                   + ", name=" + name
                   + ", _device=" + _device
                   , Logger.Level.DEBUG
                   );

        _device = device;
        craftResultDevice._device = device;

        finalizationIconSprite.spriteName = DisplayedDevice.getTextureName(device);
        finalizationIconSprite.gameObject.SetActive(null != device);

        //string displayedInfo = _device!=null?_lengthPrefix+_device.getSize().ToString()+_lengthPostfix:infos;
        //finalizationInfoLabel.text = displayedInfo;
        //Logger.Log("FinalizationInfoPanelManager::setDisplayedDevice: finalizationInfoLabel.text="+finalizationInfoLabel.text, Logger.Level.TRACE);

        //string displayedName = _device!=null?_device.getName():name;
        //finalizationNameLabel.text = displayedName;
        //Logger.Log("FinalizationInfoPanelManager::setDisplayedDevice: finalizationNameLabel.text="+finalizationNameLabel.text, Logger.Level.TRACE);

        if (null != finalizationStatusLabel)
        {
            finalizationStatusLabel.key = status;
            finalizationStatusLabel.Localize();
            //Logger.Log("FinalizationInfoPanelManager::setDisplayedDevice: finalizationStatusLabel.text="+finalizationStatusLabel.text, Logger.Level.TRACE);
        }
    }
Пример #8
0
 protected override void ApplyNewValue(string newValue)
 {
     _localize.key = newValue;
     _localize.Localize();
 }