Updated DataTypes doc

This commit is contained in:
Chris Langsenkamp 2019-12-04 16:07:28 -05:00
parent 0e1bc8110f
commit 05dd3b6660

View File

@ -45,7 +45,7 @@ Sometimes you might want to send a polymorphic data type to your commands. Mirro
```cs ```cs
class Item class Item
{ {
public String name; public string name;
} }
class Weapon : Item class Weapon : Item
@ -62,7 +62,7 @@ class Armor : Item
class Player : NetworkBehaviour class Player : NetworkBehaviour
{ {
[Command] [Command]
public void CmdEquip(Item item) void CmdEquip(Item item)
{ {
if (item is Weapon weapon) if (item is Weapon weapon)
{ {
@ -75,7 +75,7 @@ class Player : NetworkBehaviour
} }
} }
public OnGUI() void OnGUI()
{ {
if (isLocalPlayer) if (isLocalPlayer)
{ {
@ -94,7 +94,7 @@ class Player : NetworkBehaviour
{ {
name = "Gold Armor", name = "Gold Armor",
hitPoints= 100, hitPoints= 100,
Level = 3 level = 3
}); });
} }
} }