Ejemplo n.º 1
0
        public void TutorialScenarioSerialize()
        {
            TutorialScenario data         = MakeTutorialScenario(3);
            string           json         = JsonSerializer.Serialize(data);
            TutorialScenario fromJsonData = JsonSerializer.Deserialize <TutorialScenario>(json);

            Assert.AreEqual(data.scenario.Length, fromJsonData.scenario.Length);
            int count = data.scenario.Length;

            for (int i = 0; i < count; i++)
            {
                Assert.AreEqual(data.scenario[i], fromJsonData.scenario[i]);
            }
        }
Ejemplo n.º 2
0
    //---------------------------------------------------
    // Use this for initialization
    void Awake()
    {
#if SHOW_DEBUG_MESSAGES
        Debug.Log("튜토리얼 시나리오 준비");
#endif

        //  씬에 이미 인스턴스가 존재하는지 검사한다
        //  존재하는 경우 이 인스턴스는 소멸시킨다
        if (instance)
        {
            DestroyImmediate(gameObject);
            return;
        }

        //  이 인스턴스를 유효한 유일 오브젝트로 만든다
        instance = this;
    }
 /// <summary>
 /// Add a page (a new possible state) to the tutorial, but outside
 /// the default page sequence that will be used by GoToLastPage and 
 /// GoToNextPage.
 /// </summary>
 /// <param name="st">The page to add.</param>
 public extern void AddState(TutorialScenario.TutorialPage st);
 /// <summary>
 /// Start the finite state machine on the given page.
 /// </summary>
 /// <param name="initialPage">The page to start one.</param>
 public extern void StartTutorial(TutorialScenario.TutorialPage initialPage);