示例#1
0
    /**
     * @Function: Card Function
     *
     * @Author: Minjung KIM
     * @Date: 2020.Mar.25
     * @History:
     *  - 2020.05.25 Minjung KIM: initial commit
     *  - 2020.05.29 Minjung KIM: ADD credit exceeded case
     *  - 2020.06.16 Minjung KIM: Block duplicate tagging
     *  - 2020.07.01 Minjung KIM: Add discount_yn
     *  - 2020.07.03 Minjung KIM: Add sound effect
     */
    void OnTriggerExit(Collider collision)
    {
        int    total            = Int32.Parse(total_amount.text);
        string tag              = collision.gameObject.tag;
        string discount_auth_yn = GameObject.Find("v_discount_auth_yn").GetComponent <Text>().text;
        string trying_to_pay    = GameObject.Find("v_trying_to_pay_yn").GetComponent <Text>().text;

        if (card_tag == false && !tag.Equals("Untagged") && tag.Equals("card") && trying_to_pay.Equals("Y"))
        {
            M_EventLogger.EventLogging(GlobalEnv.ACTOR_USER, GlobalEnv.EVENT_CATE_ACT, GlobalEnv.EVENT_TYPE_PAY, tag, "discount_yn:" + discount_auth_yn);
            card_tag = true;

            // -----------------------
            // FAIL
            // -----------------------
            if (total > GlobalEnv.ReturnBudget(lang.ToString()))
            {
                M_EventLogger.EventLogging(GlobalEnv.ACTOR_USER, GlobalEnv.EVENT_CATE_ACT, GlobalEnv.EVENT_TYPE_EXCEEDED, total.ToString(), "discount_yn:" + discount_auth_yn);

                result_message.text     = LangText.alert_err[lang];
                result_message.color    = Color.red;
                result_background.color = Color.yellow;
                M_EventLogger.EventLogging(GlobalEnv.ACTOR_SYSTEM, GlobalEnv.EVENT_CATE_SYS_MSG, GlobalEnv.EVENT_TYPE_RESULT_MSG, total.ToString(), "discount_yn:" + discount_auth_yn);
                SoundManager.instance.PlaySound(GlobalEnv.SOUND_ERROR, lang);

                card_tag = false;
                screen5.gameObject.SetActive(false);

                // release button enabled option
                GameObject.Find("v_trying_to_pay_yn").GetComponent <Text>().text    = "N";
                GameObject.Find("btn_pay").GetComponent <Button>().interactable     = true;
                GameObject.Find("btn_uncheck").GetComponent <Button>().interactable = true;
                GameObject.Find("btn_pay").GetComponent <BoxCollider>().enabled     = true;
                GameObject.Find("btn_uncheck").GetComponent <BoxCollider>().enabled = true;

                // -----------------------
                // SUCC
                // -----------------------
            }
            else
            {
                GameObject.Find("v_trying_to_pay_yn").GetComponent <Text>().text = "N";
                screen5.gameObject.SetActive(false);
                M_EventLogger.EventLogging(GlobalEnv.ACTOR_USER, GlobalEnv.EVENT_CATE_ACT, GlobalEnv.EVENT_TYPE_END, total.ToString(), "discount_yn:" + discount_auth_yn);

                result_message.text     = LangText.alert_succ[lang];
                result_message.color    = Color.blue;
                result_background.color = Color.white;
                M_EventLogger.EventLogging(GlobalEnv.ACTOR_SYSTEM, GlobalEnv.EVENT_CATE_SYS_MSG, GlobalEnv.EVENT_TYPE_RESULT_MSG, total.ToString(), "discount_yn:" + discount_auth_yn);
                SoundManager.instance.PlaySound(GlobalEnv.SOUND_SUCC, lang);

                Invoke("ChangeScreen1toScreen5After2s", 2f);
            }
        }
    }
示例#2
0
    // /* 1p: what is your goal? */ , {
    //   "친구들과 야외에서 샌드위치를 먹기 위해 쇼핑을 끝냈고, 당신은 결제만 남았습니다! \n친구가 보내준 메시지를 확인하여 성공적으로 계산을 완료해 주세요."
    //  ,"Vous venez de terminer vos achats pour manger des sandwichs à l'extérieur avec vos amis et vous n'avez laissé que le processus de paiement maintenant! Veuillez vérifier le message que votre ami a envoyé et effectuer le paiement à l'aide de la machine de paiement automatique."
    // ,"You just finished shopping to eat sandwiches outside with your friends and you just left only the payment process now! Please check the message that your friend sent and complete the make a payment using the self-checkout machine."}

    // ------------------------------------
    // MART SCENE: Notification
    // ------------------------------------
    public static string martNoti_msg2(int lang, string gameMode, string discountCode)
    {
        string n_lang   = lang.ToString();
        string msg      = "";
        string v_budget = GlobalEnv.ReturnBudget(n_lang).ToString();

        if (GlobalEnv.GAMEMODE_START.Equals(gameMode))
        {
            if (GlobalEnv.KR.Equals(n_lang))
            {
                msg = "미안. 할인코드 알려주는걸 깜빡했어. \n여기 상점 할인코드가 있는데\n 내일 만료되니까 꼭 사용해야 해. \n코드는 " + discountCode + " 야. 까먹지마! " + discountCode + " \n그리고 카드 한도 " + v_budget + "원 밖에 안남았어!";
            }
            else if (GlobalEnv.FR.Equals(n_lang))
            {
                msg = "";
            }
            else if (GlobalEnv.EN.Equals(n_lang))
            {
                msg = "Sorry. I've forgotton, \nI have a discount code for this shop and it will expire tomorrow. \nYou should use it. The code is " + discountCode + ". Do not forget " + discountCode + "!\n And I've only " + v_budget + "Euros left on a card!";
            }
        }
        else
        {
            discountCode = GlobalEnv.DISCOUNT_CODE_TEST;
            if (GlobalEnv.KR.Equals(n_lang))
            {
                msg = "[연습모드] 테스트 할인코드는 " + discountCode + "입니다.";
            }
            else if (GlobalEnv.FR.Equals(n_lang))
            {
                msg = "[FRANCE-TEST] TEST CODE IS" + discountCode + ".";
            }
            else if (GlobalEnv.EN.Equals(n_lang))
            {
                msg = "[TEST] TEST CODE IS" + discountCode + ".";
            }
        }
        return(msg);
    }