Beispiel #1
0
    private void OnItemClicked(int chosenEntityId)
    {
        CharacterChooserProperties props = (CharacterChooserProperties)properties;

        props.ActionEntity.AddTarget(chosenEntityId);
        //UIService.HideWidget(UiAssetTypes.CharacterChooser);
    }
Beispiel #2
0
    protected override void OnNewProperties()
    {
        DestroyItems();

        CharacterChooserProperties props = (CharacterChooserProperties)properties;

        if (chooseItemPrefab == null)
        {
            //chooseItemPrefab = UIService.GetAsset(UiAssetTypes.CharacterChooserItem);
        }

        foreach (int possibleEntityId in props.PossibleEntityIds)
        {
            CharacterChooserItemWidget newItem = Instantiate(chooseItemPrefab, gameObject.transform)
                                                 .GetComponent <CharacterChooserItemWidget>();
            newItem.Open();
            newItem.ApplyProperties(
                new CharacterChooserItemProperties(possibleEntityId, possibleEntityId.ToString(), OnItemClicked));
            chooseItems.Add(newItem);
        }
    }