Пример #1
0
    private void Awake()
    {
        DontDestroyOnLoad(CM_Dispatcher.instance);
        m_JobMng   = CM_JobManager.Make();
        m_JobQueue = CM_JobQueue.Make();

        (m_Table_Dino = CM_Singleton <Table_Dino> .instance).Load();
        m_Table_Dino.gameObject.transform.parent = transform;

        (m_Table_QRCode = CM_Singleton <Table_QRCode> .instance).Load();
        m_Table_QRCode.gameObject.transform.parent = transform;

        (m_Table_Card = CM_Singleton <Table_Card> .instance).Load();
        m_Table_Card.gameObject.transform.parent = transform;

        (m_Table_Stage = CM_Singleton <Table_Stage> .instance).Load();
        m_Table_Stage.gameObject.transform.parent = transform;

        (m_Table_Deck = CM_Singleton <Table_Deck> .instance).Load();
        m_Table_Deck.gameObject.transform.parent = transform;


        // stage table 의 갯수 만큼 체크
        //m_StageClear.Clear();
        //m_StageClear.Add("stage_1", GetLocalData("stage_1", 0) == 1);
        //m_StageClear.Add("stage_2", GetLocalData("stage_2", 0) == 1);
        //m_StageClear.Add("stage_3", GetLocalData("stage_3", 0) == 1);
    }
    /// <summary>
    /// Local job manager test. Creates a new local JobManager, subscribes to
    ///  <see cref="CM_JobManager.jobAdded"/>  and  <see cref="CM_JobManager.jobRemoved"/>  events,
    /// adds a test job to the local JobManager, and finally starts, pauses, resumes, and stops this test job.
    /// This is used to show that anything you can do with the glocal JobManager you can also do with a local JobManager. This is useful
    /// if you want to create seperate JobManagers for seperate parts of your codebase.
    /// </summary>
    public void LocalJobManagerTest()
    {
        var localJobManager = CM_JobManager.Make();

        localJobManager.NotifyOnJobAdded((object sender, CM_JobManagerJobEditedEventArgs e) => {
            Debug.Log("Job added to local manager: " + e.jobEdited.id);
        }).NotifyOnJobRemoved((object sender, CM_JobManagerJobEditedEventArgs e) => {
            Debug.Log("Job removed from the local manager: " + e.jobEdited.id);
        });

        localJobManager.AddJob(GetSimpleInfiniteTestJob("Local job one", "local_job_1"));

        localJobManager.StartCoroutine("local_job_1");
        localJobManager.PauseCoroutine("local_job_1");
        localJobManager.ResumeCoroutine("local_job_1");
        localJobManager.StopCoroutine("local_job_1");
    }