void Start() { ioc = Camera.main.transform.GetComponent <IOCcam>(); iocActive = ioc.enabled; Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; }
public override void Init() { try { iocCam = Camera.main.GetComponent <IOCcam>(); terrain = GetComponent <Terrain>(); this.enabled = true; } catch (Exception e) { this.enabled = false; Debug.Log(e.Message); } }
public override void Init() { try { iocCam = Camera.main.GetComponent <IOCcam>(); hit = new RaycastHit(); currentLayer = gameObject.layer; h = new RaycastHit(); this.enabled = true; } catch (Exception e) { this.enabled = false; Debug.Log(e.Message); } }
public override void Init() { try { iocCam = Camera.main.GetComponent <IOCcam>(); shadowDistance = QualitySettings.shadowDistance * 2f; currentLayer = gameObject.layer; prevDist = 0f; prevHitTime = Time.time; sleeping = true; h = new RaycastHit(); this.enabled = true; } catch (Exception e) { this.enabled = false; Debug.Log(e.Message); } }
void Awake() { shadowDistance = QualitySettings.shadowDistance * 2f; //for (int i = 0; i < _camera.Length; i++) //{ iocCam = _camera.GetComponent <IOCcam>(); //} if (iocCam == null) { this.enabled = false; } else { prevDist = 0f; prevHitTime = Time.time; sleeping = true; h = new RaycastHit(); } }
void GenerateLevel() { IOCcam ioc = Camera.main.transform.GetComponent <IOCcam>(); ioc.enabled = false; Vector3 prefabPos; GameObject go; GameObject[] gos = GameObject.FindObjectsOfType(typeof(GameObject)) as GameObject[]; foreach (GameObject g in gos) { if (g.layer == 8 & g.tag == "ioc") { Destroy(g); } } for (var i = 0; i < PrefabNum; i++) { prefabPos = new Vector3(Random.Range(50f, 950f), 0f, Random.Range(50f, 950f)); go = Instantiate(Prefabs[Random.Range(0, Prefabs.Length)], prefabPos, Quaternion.identity) as GameObject; go.transform.Rotate(Vector3.up, Random.Range(0f, 360f)); } ioc.enabled = true; }
void Start() { iocCam = Camera.main.GetComponent <IOCcam>(); if (iocCam == null) { this.enabled = false; return; } if (Lod1 != 0) { lod_1 = Lod1; } else { lod_1 = iocCam.lod1Distance; } if (Lod2 != 0) { lod_2 = Lod2; } else { lod_2 = iocCam.lod2Distance; } if (LodMargin != 0) { lodMargin = LodMargin; } else { lodMargin = iocCam.lodMargin; } prevDist = 0f; if (transform.Find("Lod_0")) { lods = 1; rs0 = transform.Find("Lod_0").GetComponentsInChildren <Renderer>(false); if (transform.Find("Lod_1")) { lods++; rs1 = transform.Find("Lod_1").GetComponentsInChildren <Renderer>(false); if (transform.Find("Lod_2")) { lods++; rs2 = transform.Find("Lod_2").GetComponentsInChildren <Renderer>(false); } } } else { lods = 0; } rs = GetComponentsInChildren <Renderer>(false); if (iocCam == null || iocCam.enabled == false) { this.enabled = false; ShowLod(1); } else { switch (LodOnly) { case false: HideAll(); break; case true: ShowLod(3000f); break; } } prevHitTime = Time.time; sleeping = true; }
void Awake() { shadowDistance = QualitySettings.shadowDistance * 2f; iocCam = Camera.main.GetComponent<IOCcam>(); if(iocCam == null) { this.enabled = false; } else { prevDist = 0f; prevHitTime = Time.time; sleeping = true; } }
void Start() { ioc = Camera.main.transform.GetComponent <IOCcam>(); iocActive = ioc.enabled; }
void Start() { ioc = Camera.main.transform.GetComponent<IOCcam>(); iocActive = ioc.enabled; }