示例#1
0
    private void CreateUI()
    {
        pc1Canvas.mainCanvas =
            Instantiate(Resources.Load(ResourcesPath.Ui("PC1Canvas")), GameObject.Find(CanvasName.UI).transform) as GameObject;
        pc1Canvas.mainCanvas.name = "PC1Canvas";
        pc1Canvas.mainCanvas.AddComponent <PlayerUI>().playerSlot = PlayerSlot.PC1;

        pc2Canvas.mainCanvas =
            Instantiate(Resources.Load(ResourcesPath.Ui("PC2Canvas")), GameObject.Find(CanvasName.UI).transform) as GameObject;
        pc2Canvas.mainCanvas.name = "PC2Canvas";
        pc2Canvas.mainCanvas.AddComponent <PlayerUI>().playerSlot = PlayerSlot.PC2;
    }
示例#2
0
    protected override IEnumerator Start()
    {
        // f:初期設定
        PlayerManager     plm  = PlayerManager.Inst;
        SoundManager      sm   = SoundManager.Inst;
        AppearManager     am   = AppearManager.Inst;
        PauseManager      pm   = PauseManager.Inst;
        ResultManager     rm   = ResultManager.Inst;
        BackGroundManager bm   = BackGroundManager.Inst;
        GameManager       gm   = GameManager.Inst;
        PlayerUIManager   puim = PlayerUIManager.Inst;

        // f:

        Debug.Log("1:target_loadingを生成する。");
        Instantiate(Resources.Load("Prefabs/target_loading"), GameObject.Find("LoadingCanvas").transform).name = "target_loading";

        plm.Starting();

        // TimeLimitの生成
        Instantiate(Resources.Load(ResourcesPath.Ui("TimeLimitCanvas")), GameObject.Find(CanvasName.UI).transform);

        sm.Starting();
        am.Starting();
        // yield return new WaitUntil(() => plm.MyProc.started && sm.MyProc.started && am.MyProc.started);

        yield return(pm.Starting());

        rm.Starting();
        bm.Starting();

        GameManager.SetPCName(CharacterSelectManager.PC1Name ?? PC1Name, PlayerSlot.PC1);
        GameManager.SetPCName(CharacterSelectManager.PC2Name ?? PC2Name, PlayerSlot.PC2);
        gm.Starting();

        yield return(new WaitUntil(() => GameManager.Pc1Player.MyProc.started && GameManager.Pc2Player.MyProc.started));

        puim.Starting();

        MyProc.started = true;

        Destroy(gameObject);
    }