Using the photon engine for Unity online game Development (ii)--photon Common class Introduction

Source: Internet
Author: User

using the photon engine for Unity online game Development (ii)--photon Common class IntroductionPhotonPUNUnityOnline game developmentphoton Common class Introduction:Ipuncallback
    • The Pungipuncallback interface defines a number of callback functions related to the Photon network connection.
    • These callback functions are called by the game client when the network connection state changes.
Punbehaviour
    • Punbehaviour in the Photon namespace
    • Punbehavioud inherits Photon.monobehaviour, implements Puncallback interface
    • Photon.monobehavioud Inheritance Unityengine.monobehaviour
photonnetwork

Photonnetwork is a static class in pun that contains the functions used to send requests to the photon server, as well as the properties that hold the player's information:

    • Photonnetwork.connectusingsettings (): Connect photon Server
    • Photonnetwork.joinlobby (): Join the game hall at Materserver
    • Photonnetwork.createroom (): Create a game room in the lobby of the game
    • Photonnetwork.leaveroom (): Return to Game hall from game room
    • Photonnetwork.instantiate (): Create a client-controlled game object
    • Photonnetwork.room: The client enters the game room
Photonplayer

The Photon player class represents players in Photon network traffic.

    • photonpiayer.id : player ID, with Photon server assignment
    • Photonplayer.name : Player's nickname, players can set their own nickname
    • Photonplayer.islocal: Whether the player is a local client player
    • Photonpiayer.customproperties: Player's Custom properties
other

Photonnetwork-documentation:

    • Photonview: Managing communication between clients in a game room
    • Roomlnfo: Property information for game rooms
    • Serversettings: Server Settings
    • Typedlobbylnfo: Property information for the game Hall

Using the photon engine for Unity online game Development (ii)--photon Common class Introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.