Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- // var newKidName : String = "Whatever" ;
- public class RigidAssign2 : MonoBehaviour {
- GameObject _camera = null;
- GameObject _mouse = null;
- GameObject _arm = null;
- GameObject _ray = null;
- GameObject camera = null;
- void OnNetworkInstantiate (NetworkMessageInfo msg) {
- if (networkView.isMine)
- {
- NetworkRigidbody _NetworkRigidbody = (NetworkRigidbody)GetComponent("NetworkRigidbody");
- _NetworkRigidbody.enabled = false;
- _camera = GameObject.Find("Main Camera");
- _camera.camera.enabled = true;
- GetComponent<MouseLook>().enabled = true;
- camera = GameObject.Find("Main CameraRemote");
- camera.GetComponent<MouseLook>().enabled = true;
- }
- else {
- name += "Remote";
- NetworkRigidbody _NetworkRigidbody2 = (NetworkRigidbody)GetComponent("NetworkRigidbody");
- _NetworkRigidbody2.enabled = true;
- camera = GameObject.Find("Main CameraRemote");
- camera.GetComponent<MouseLook>().enabled = false;
- GetComponent<FPSInputController>().enabled = false;
- GetComponent<CharacterMotor>().enabled = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement