Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using BeardedManStudios.Network;
- public class DemoMove : NetworkedMonoBehavior
- {
- //protected override void Update()
- //{
- // base.Update();
- // if (Input.GetKeyDown(KeyCode.Space))
- // {
- // if (IsOwner)
- // transform.position += Vector3.up;
- // else
- // Debug.Log("You do not own this object!");
- // }
- //}
- protected override void OwnerUpdate()
- {
- base.OwnerUpdate();
- if (Input.GetKeyDown(KeyCode.Space))
- {
- transform.position += Vector3.up;
- }
- }
- protected override void NonOwnerUpdate()
- {
- base.NonOwnerUpdate();
- if (Input.GetKeyDown(KeyCode.Space))
- {
- Debug.Log("You do not own this object!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement