示例#1
0
    public void initPlayer(PlayerLife P_mainPlayer)
    {
        if (!isReady4Map) {

            C_mapManager = GameObject.Find("MapManager").GetComponent<MapManager>();
            C_mapManager.initializeBeforeStart();
            C_mapManager.startMap();
            isReady4Map = true;
        }
        P_mainPlayer.StartLifeform();
        C_mapManager.setPlayerMain(P_mainPlayer);
    }
示例#2
0
    protected IEnumerator waitAndStartMap()
    {
        while (Application.isLoadingLevel) {
            Debug.Log("waiting for level");
            yield return 0f;
        }

        C_mapManager = GameObject.Find("MapManager").GetComponent<MapManager>();
        C_mapManager.initializeBeforeStart();

        if (isSingleplayer) {
            C_mapManager.startMap();

            PlayerLife F_gamer = null;
            if (F_gamer == null || !isSingleplayer) {
                F_gamer = PrefabManager.CreateLife("Player", Vector3.zero, Quaternion.identity, PrefabMode.Everyone, null) as PlayerLife;
            }

            C_mapManager.setPlayerMain(F_gamer);
            SpawnManager.Instance.SpawnLifeform(F_gamer);

        }
        isReady4Map = true;
    }