Exemplo n.º 1
0
    // Use this for initialization
    void InitGame()
    {
        gameTouchController = new GameTouchController();

        //创建角色
        GameObject roleObj = Resources.Load("Prefabs/MapObj/InGameRole") as GameObject;

        roleObj = Instantiate(roleObj);
        role    = roleObj.GetComponent <InGameRole>();

        roleObj.transform.position = new Vector3(0, GetGameRect().y + 5, 0);

        gameEffectManager = new GameEffectManager();

        //
        inGameLevelManager = new InGameLevelManager();
        inGameLevelManager.Init();

        inGameUIManager = new InGameUIManager();
        inGameUIManager.Init();

        int selmodel = PlayerPrefs.GetInt(GameConst.USERDATANAME_MODEL, 0);

        modelManager = InGameBaseModel.Create(selmodel);
        modelManager.Init();

        inGameColorManager = new InGameColorManager();
        inGameColorManager.Init();

        gameState = enGameState.playing;
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        gameTouchController = new GameTouchController();

        //创建角色
        GameObject roleObj = Resources.Load("Prefabs/MapObj/InGameRole") as GameObject;

        roleObj = Instantiate(roleObj);
        role    = roleObj.GetComponent <InGameRole>();

        //地面
        GameObject touchPlaneObj = Resources.Load("Prefabs/MapObj/TouchPlane") as GameObject;

        touchPlane = Instantiate(touchPlaneObj);


        GameObject groundPlaneObj = Resources.Load("Prefabs/MapObj/GroundPlane") as GameObject;

        groundPlane = Instantiate(groundPlaneObj);
        //
        inGameLevelManager = new InGameLevelManager();
        inGameLevelManager.Init();

        inGameUIManager = new InGameUIManager();
        inGameUIManager.Init();

        int selmodel = PlayerPrefs.GetInt(GameConst.USERDATANAME_MODEL, 0);

        modelManager = InGameBaseModel.Create(selmodel);
        modelManager.Init();

        gameState = enGameState.playing;
    }
Exemplo n.º 3
0
    // Use this for initialization
    void InitGame()
    {
        gameTouchController = new GameTouchController();

        //创建角色
        GameObject roleObj = Resources.Load("Prefabs/MapObj/InGameRole") as GameObject;

        roleObj = Instantiate(roleObj);
        role    = roleObj.GetComponent <InGameRole>();

        roleObj.transform.position = new Vector3(0, GetGameRect().y + 5, 0);

        gameEffectManager = new GameEffectManager();

        //
        inGameLevelManager = new InGameLevelManager();
        inGameLevelManager.Init();

        inGameUIManager = new InGameUIManager();
        inGameUIManager.Init();

        int selmodel = PlayerPrefs.GetInt(GameConst.USERDATANAME_MODEL, 0);

        modelManager = InGameBaseModel.Create(selmodel);
        modelManager.Init();

        InGameColorManager.GetInstance().Init();
        inGameUIManager.gamePadManager.scoreslabel.SetColor(InGameColorManager.GetInstance().bgColor);

        gameState = enGameState.playing;

        int teachCount = PlayerPrefs.GetInt("teachcount", 0);

        if (teachCount < 2)
        {
            GameObject teachObj = Resources.Load("Prefabs/UI/TeachLayer") as GameObject;
            teachObj = Instantiate(teachObj);
            PlayerPrefs.SetInt("teachcount", teachCount + 1);
        }
    }
Exemplo n.º 4
0
    // Use this for initialization
    void InitGame()
    {
        gameTouchController = new GameTouchController();

        //创建角色
        GameObject roleObj = Resources.Load("Prefabs/MapObj/InGameRole") as GameObject;

        roleObj = Instantiate(roleObj);
        role    = roleObj.GetComponent <InGameRole>();
        role.Init();

        role.transform.position = new Vector3(0, 0.5f, 0);
        //role.Jump(new Vector3(0f, 1f));

        role.SetCameraPos();

        //gameEffectManager = new GameEffectManager();

        //
        inGameLevelManager = new InGameLevelManager();
        inGameLevelManager.Init();

        inGameUIManager = new InGameUIManager();
        inGameUIManager.Init();

        int selmodel = PlayerPrefs.GetInt(GameConst.USERDATANAME_MODEL, 0);

        modelManager = InGameBaseModel.Create(selmodel);
        modelManager.Init();

        inGameColorManager = new InGameColorManager();
        inGameColorManager.Init();

        //gameState = enGameState.playing;

        GameObject teachObj = Resources.Load("Prefabs/UI/TeachLayer") as GameObject;

        teachObj = Instantiate(teachObj);
    }