public void LoadChoiceItem(AppContentChoice choice, AppContentChoiceItem choiceItem, Color colorTo)
    {
        LogUtil.Log("LoadChoiceItem:" + choice.code);

        SetChoiceParticleSystemColors(colorTo);
        LoadChoiceItem(choice, choiceItem);
    }
Example #2
0
    public void Update()
    {
        bool modifiderKey = Input.GetKey(KeyCode.RightControl);

        if (modifiderKey && Input.GetKeyDown(KeyCode.LeftBracket))
        {
            chosen = false;
        }
        else if (modifiderKey && Input.GetKeyDown(KeyCode.RightBracket))
        {
            chosen = true;
        }
        else if (modifiderKey && Input.GetKeyDown(KeyCode.Backslash))
        {
            AppContentChoiceItem item = null;

            foreach (KeyValuePair <string, AppContentChoice> choice in choices)
            {
                foreach (AppContentChoiceItem choiceItem in choice.Value.choices)
                {
                    item = choiceItem;
                    break;
                }
            }

            BroadcastAppContentChoiceItem(item);
        }
    }
Example #3
0
    public void BroadcastAppContentChoiceItem(AppContentChoiceItem choiceItem)
    {
        //if(choiceItem == null) {
        //    return;
        //}

        //Messenger<AppContentChoiceItem>.Broadcast(AppContentChoiceMessages.appContentChoiceItem, choiceItem);
    }
    public void LoadChoiceItem(AppContentChoice choice, AppContentChoiceItem choiceItem)
    {
        appContentChoice     = choice;
        appContentChoiceItem = choiceItem;

        LoadChoice(
            appContentChoice.code,
            appContentChoice.type,
            appContentChoiceItem.IsTypeCorrect(),
            appContentChoiceItem.display,
            appContentChoiceItem.code, "barrel-1");
    }
    public void LoadChoice(
        string choiceCode,
        string choiceType,
        bool choiceItemIsCorrect,
        string choiceItemDisplay,
        string choiceItemCode,
        string choiceItemAssetCode)
    {
        choiceData                     = new GameObjectChoiceData();
        choiceData.choiceCode          = choiceCode;
        choiceData.choiceType          = choiceType;
        choiceData.choiceItemIsCorrect = choiceItemIsCorrect;
        choiceData.choiceItemDisplay   = choiceItemDisplay;
        choiceData.choiceItemCode      = choiceItemCode;
        choiceData.choiceItemAssetCode = choiceItemAssetCode;

        appContentChoice = AppContentChoices.Instance.GetByCode(choiceCode);
        if (appContentChoice != null)
        {
            foreach (AppContentChoiceItem choiceItem in appContentChoice.choices)
            {
                if (choiceItem.code == choiceItemCode)
                {
                    appContentChoiceItem = choiceItem;
                }
            }
        }

        //LogUtil.Log("LoadChoice:choiceCode:" + choiceCode);
        //LogUtil.Log("LoadChoice:choiceType:" + choiceType);
        //LogUtil.Log("LoadChoice:choiceItemIsCorrect:" + choiceItemIsCorrect);
        //LogUtil.Log("LoadChoice:choiceItemDisplay:" + choiceItemDisplay);
        LogUtil.Log("LoadChoice:choiceItemCode:" + choiceItemCode);
        //LogUtil.Log("LoadChoice:choiceItemAssetCode:" + choiceItemAssetCode);

        LoadAsset(choiceItemAssetCode);

        LogUtil.Log("LoadChoice:SetLabel:choiceData.choiceItemDisplay:" + choiceData.choiceItemDisplay);

        UIUtil.SetLabelValue(labelResponse, choiceData.choiceItemDisplay);
        UIUtil.SetLabelValue(labelResponseShadow, choiceData.choiceItemDisplay);
        //LogUtil.Log("LoadChoice:SetLabel:labelResponse:" + labelResponse.text);

        hasLoadedChoice = true;
    }
Example #6
0
    public void OnAppContentChoiceItemHandler(GameObjectChoiceData data)
    {
        CheckChoicesData();

        isCorrect = data.choiceItemIsCorrect;

        AppContentChoiceData choiceData = new AppContentChoiceData();

        choiceData.choiceCode = data.choiceCode;

        appContentChoice     = AppContentChoices.Instance.GetByCode(data.choiceCode);
        appContentChoiceItem = null;

        if (appContentChoice != null)
        {
            foreach (AppContentChoiceItem choiceItem in appContentChoice.choices)
            {
                if (choiceItem.code == data.choiceItemCode)
                {
                    appContentChoiceItem = choiceItem;
                }
            }
        }

        choiceData.choices.Add(appContentChoiceItem);
        choiceData.choiceData = "";

        if (appContentChoicesData != null)
        {
            appContentChoicesData.SetChoice(choiceData);
        }

        currentChoiceData = choiceData;
        currentChoiceItem = appContentChoiceItem;

        SaveChoiceState();

        ChangeState(AppModeTypeChoiceFlowState.AppModeTypeChoiceResultItem);
    }