Exemplo n.º 1
0
        //private static ExternalDatabase db = new ExternalDatabaseSQLitePlugin();

        public static void Init()
        {
            if (db != null)
            {
                db.Open(Data.GetInstance());
            }
        }
Exemplo n.º 2
0
        public override GameState OnStart(QuizMain game_instance)
        {
            game_instance.ResetQuestionTimer();
            game_instance.DisplayQuestion(Data.GetInstance().Progress);

            return(null);
        }
Exemplo n.º 3
0
 public static void Save()
 {
     if (db != null)
     {
         db.SaveData(Data.GetInstance());
     }
 }
Exemplo n.º 4
0
        public override GameState OnStart(QuizMain game_instance)
        {
            Data       game_data = Data.GetInstance();
            QuizConfig config    = game_data.GetConfig();

            Debug.Log("config question lists " + config.QuestionLists.Count);

            foreach (QuestionListConfig qlist in config.QuestionLists)
            {
                game_instance.AddToList(qlist.ListSize, qlist.ListDifficulty, qlist.ListSubjects.ToArray(), qlist.Uniform);
                //game_data.ReportSubjects(
            }

            foreach (int special_index in config.SpecialQuestions)
            {
                game_instance.SetSpecial(special_index);
            }



            game_instance.SetButtonEnable(Action.Next, false);

            game_data.MaxProgress = game_instance.QuestionListSize;

            return(null);
        }
Exemplo n.º 5
0
 protected override void Display(bool display)
 {
     if (!Data.GetInstance().ShowSubjectScore)
     {
         base.Display(false);
         return;
     }
 }
Exemplo n.º 6
0
        protected override void Display(bool display)
        {
            if (!Data.GetInstance().ShowSubjectScore)
            {
                base.Display(false);
                return;
            }


            SubjectCounter counter = Data.GetInstance().GetSubjectCounter(subject_index);

            //Debug.Log (display);
            if (counter != null && display == true)
            {
                GetComponent <TextMesh>().text = (counter.subject + " " + counter.count);
                //Debug.Log (GetComponent<TextMesh>().text);
                renderer.enabled = true;
            }

            else
            {
                renderer.enabled = false;
            }
        }
Exemplo n.º 7
0
        //private Question[] question_list;


        // Use this for initialization
        void Start()
        {
            game_data = Data.GetInstance();

            //if (questions_txt != null)
            //{
            if (game_data.Library == null)
            {
                if (LoadBySql == true)
                {
                    game_data.InitLibrary(QuestionReaderSql.ReadQuestions(sql_table));
                }
                else
                {
                    game_data.InitLibrary(QuestionReaderTxt.ReadQuestions(questions_txt));
                }
                //
            }

            return;
            //}
            //else
            //		Debug.LogError("Question file not referenced in Loader");
        }
Exemplo n.º 8
0
 protected override void SendEvent()
 {
     Data.GetInstance().SetConfig(config);
     EventManager.GetInstance().ReadEvent(ButtonEvent.Start);
 }
Exemplo n.º 9
0
 protected override void Awake()
 {
     game_data   = Data.GetInstance();
     text_render = GetComponent <Text>();
     //text = GetComponent<TextMesh>();
 }
Exemplo n.º 10
0
 public virtual void Awake()
 {
     game_data = Data.GetInstance();
 }
Exemplo n.º 11
0
        //public int[]		   Timers;

        //public List<GameObject[]> Batches;

        // Use this for initialization
        void Awake()
        {
            Data.GetInstance().UpdateScore();
        }
Exemplo n.º 12
0
 protected virtual void Awake()
 {
     game_data = Data.GetInstance();
     //text = GetComponent<TextMesh>();
 }