Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class FixThings : MonoBehaviour
- {
- public NetworkView nv;
- public Camera cam;
- public AudioListener listener;
- public GameObject fp;
- public GameObject tp;
- void OnEnable()
- {
- DontDestroyOnLoad(this.gameObject);
- }
- void Awake()
- {
- DontDestroyOnLoad(this.gameObject);
- }
- // Use this for initialization
- void Start()
- {
- DontDestroyOnLoad(this.gameObject);
- if (nv.isMine)
- {
- cam.enabled = true;
- listener.enabled = true;
- fp.SetActive(true);
- tp.SetActive(false);
- }
- else
- {
- cam.enabled = false;
- listener.enabled = false;
- fp.SetActive(false);
- tp.SetActive(true);
- }
- this.enabled = false;
- }
- void Update()
- {
- if (nv.isMine)
- {
- cam.enabled = true;
- listener.enabled = true;
- fp.SetActive(true);
- tp.SetActive(false);
- }
- else
- {
- cam.enabled = false;
- listener.enabled = false;
- fp.SetActive(false);
- tp.SetActive(true);
- }
- this.enabled = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement