Example #1
0
    public static void RefreshInstance(ref PlayerPun player, PlayerPun Prefab)
    {
        Debug.Log("RefreshInstance");
        var position = Vector3.zero;
        var rotation = Quaternion.identity;

        if (player != null)
        {
            position = player.transform.position;
            rotation = player.transform.rotation;
            PhotonNetwork.Destroy(player.gameObject);
        }

        player = PhotonNetwork.Instantiate(Prefab.gameObject.name, position, rotation).GetComponent <PlayerPun>();
    }
Example #2
0
 void Start()
 {
     LocalPlayer = PhotonNetwork.Instantiate("Dodgeanimated", Vector3.zero, Quaternion.identity).GetComponent <PlayerPun>();
     //  PlayerPun.RefreshInstance(ref LocalPlayer, PlayerPrefab);
     //  LocalPlayer = PhotonNetwork.Instantiate("Player", Vector3.zero, Quaternion.identity).GetComponent<PlayerPun>();
 }