Example #1
0
 void Awake()
 {
     LocScr.setLaguage(Application.systemLanguage.ToString());
     instance = this;
     roomIdx  = 0;
     MyConst.init();
 }
 public static void PopulateQuestion(IQuestionProvider provider)
 {
     questionList.Clear();
     wrongChoices.Clear();
     questionList = provider.GetQuestionList();
     wrongChoices = MyConst.GetWrongChoices();
 }
 void Start()
 {
     if (isDebug)
     {
         MyConst.Init();
         IQuestionProvider provider = new QuestionCSVProvider();
         QuestionBuilder.PopulateQuestion(provider);
         debugUI.SetActive(true);
         debugUI.transform.position = Vector3.zero;
     }
 }
Example #4
0
 void OnMouseDrag()
 {
     vec    = roomCamera.instance.cam.ScreenToWorldPoint(Input.mousePosition);
     vec.z  = 0;
     vec.y += 0.5f;
     transform.position = vec;
     if (MyConst.equal(vec, fin, 0.6f))
     {
         gameObject.SetActive(false);
         RoomUI.instance.b_right.SetActive(true);
     }
 }
Example #5
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Application.Quit();
        }

        if (MyConst.minRoud((pl_tr.position.x + 8) / 16f) != roomIdx)
        {
            roomIdx = MyConst.minRoud((pl_tr.position.x + 8) / 16f);
            roomCamera.instance.moveToId(roomIdx, 0);
        }
    }
Example #6
0
    void OnMouseDrag()
    {
        if (!can)
        {
            return;
        }
        Vector3 vec = roomCamera.instance.cam.ScreenToWorldPoint(Input.mousePosition);

        vec.z  = 0;
        vec.y += 0.5f;
        transform.position = vec;
        if (MyConst.equal(vec, fin, 0.6f))
        {
            gameObject.SetActive(false);
            RoomUI.instance.b_left.SetActive(true);
            roomScr.instance.didProgress();
        }
    }
Example #7
0
    void Update()
    {
        vec = Input.mousePosition;
        //vec.y += CS;
        //CS = Screen.width / 16;

        /*
         * if (Input.GetMouseButtonDown(0))
         * {
         *  flag = MyConst.equal(leftButton.transform.position, vec, CS);
         *  dx = leftButton.transform.position.x - vec.x;
         *  dy = leftButton.transform.position.y - vec.y;
         * }*/

        if (flag)
        {
            vec.y += dy;
            vec.x += dx;
            if (MyConst.equal(vec, pos2, CS * 0.7f) && !flag2)
            {
                flag2 = true;
                upButton.SetActive(true);
                leftButton.SetActive(false);
            }
            else
            {
                da  = (MyConst.dist(pos2, leftButton.transform.position) / allD);
                da  = (da < 0) ? 0 : (da > 1) ? 1: da;
                da  = 1 - da;
                da *= -90;
                leftButton.transform.rotation = Quaternion.Euler(new Vector3(0, 0, da));
                leftButton.transform.position = vec;
            }
        }

        if (Input.GetMouseButtonUp(0))
        {
            flag = false;
        }
    }
Example #8
0
 void Start()
 {
     MyConst.Init();
     playerName.text = PlayerPrefs.GetString("PlayerInputName", "");
     MyConst.SetPlayerName(playerName.text);
 }
Example #9
0
 public void StartButton()
 {
     MyConst.SetPlayerName(playerName.text);
     PlayerPrefs.SetString("PlayerInputName", playerName.text);
     SystemScreenController.Instance.ShowScreen("ScreenMainMenu");
 }
    /// Load skill list from parsed CSV
    public static List <CharacterModel> GetCharacterList()
    {
        List <CharacterModel> characterList = MyConst.GetCharacterList();

        return(characterList);
    }
Example #11
0
 public List <QuestionRowModel> GetQuestionList()
 {
     return(MyConst.GetQuestionList());
 }