void Start() { if (cameras.transform.childCount > 0) { for (int i = 0; i < cameras.transform.childCount; i++) { camerasList.Add(cameras.transform.GetChild(i).gameObject.GetComponent <Camera> ()); vfxCameras.Add(camerasList[i].transform.GetChild(0).GetComponent <Camera>()); } if (camerasList.Count == 0) { Debug.Log("Please assign one or more Cameras in inspector"); } } else { singleCamera = cameras.GetComponent <Camera> (); if (singleCamera != null) { camerasList.Add(singleCamera); } else { Debug.Log("Please assign one or more Cameras in inspector"); } } if (VFXs.Count > 0) { effectToSpawn = VFXs[0]; } else { Debug.Log("Please assign one or more VFXs in inspector"); } if (effectName != null && VFXs.Count > 0) { effectName.text = effectToSpawn.name; } if (camerasList.Count > 0) { rotateToMouse.SetCamera(camerasList [camerasList.Count - 1]); if (use2D) { rotateToMouse.Set2D(true); } rotateToMouse.StartUpdateRay(); } else { Debug.Log("Please assign one or more Cameras in inspector"); } }
void Start() { for (int i = 0; i < cameras.transform.childCount; i++) { camerasList.Add(cameras.transform.GetChild(i).gameObject.GetComponent <Camera>()); } //Application.targetFrameRate = 60; effectToSpawn = VFXs[0]; if (effectName != null) { effectName.text = effectToSpawn.name; } rotateToMouse.SetCamera(camerasList [2]); rotateToMouse.StartUpdateRay(); }