Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

custom class object sent over RPC

$
0
0
Hello!

What are the possible approaches to sending an object of my custom class over RPC instead of sending lots of byte/short/string parameters?

Sending 13 parameters in RPC looks a bit sad :o.
[System.Serializable]
public class PlayerInfo
{
    public string name = "LittlePig";
    public int hp;
    public int health_original = 100;

    public float armor = 0;
    public bool dead = false;
    public int frags = 0;
    public int deaths = 0;

    public int actorID = -1;
    public int view_id = -1;
    public int level = -1;
    public int skill_level = -1;
    public TeamName team_name;

    public bool is_observer = false;
}

thanks,
Slav

Viewing all articles
Browse latest Browse all 15755

Trending Articles