Exemplo n.º 1
0
    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;
    }
Exemplo n.º 2
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);
    }
 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);
      */
 }