예제 #1
0
    private void onFinishLoadLevel()
    {
        GameObject ui    = GameObject.Find("GameUI");
        Transform  panel = ui.transform.FindChild("Camera/UpdatePatch");

        panel.gameObject.SetActive(false);

        //必须在level加载完之后才有Camera.main
        //必须在初始化之后
        Iplayer player = PlayerManager.Instance.LocalAccount;

        player.OnFSMStateChange(EntityFreeFSM.Instance);
        AudioManager.Instance.StopHeroAudio();


        GameMethod.CreateCharacterController(player);         //controller move重要

        //GameObject terrian = GameObject.Find ("GameObject");
        //mPlayerObj.transform.parent = terrian.transform;
    }
    private void onFinishLoadLevel()
    {
        GameObject ui    = GameObject.Find("GameUI");
        Transform  panel = ui.transform.FindChild("Camera/UpdatePatch");

        panel.gameObject.SetActive(false);

        //必须在level加载完之后才有Camera.main
        //必须在初始化之后
        Iplayer player = PlayerManager.Instance.LocalAccount;
        //set target这个实现方法放在FreeFSM前面,因为FressFSM会update camera,需要有target才好update
        GameObject mainCamera = GameObject.FindGameObjectWithTag("MainCamera");

        mainCamera.GetComponent <SmoothFollow> ().target = player.objTransform;

        player.OnFSMStateChange(EntityFreeFSM.Instance);
        AudioManager.Instance.StopHeroAudio();


        GameMethod.CreateCharacterController(player);         //controller move重要

        //GameObject terrian = GameObject.Find ("GameObject");
        //mPlayerObj.transform.parent = terrian.transform;
    }