void Start() { break_laser = GameObject.FindGameObjectWithTag("RController").GetComponent <LaserCaster>(); audioSource = GetComponent <AudioSource>(); audioSource.clip = Backgroundsfx; audioSource.Play(); }
//public static GameObject voice_text; void Start() { tr = GetComponent <Transform>(); rb = GetComponent <Rigidbody>(); cc = GetComponent <CharacterController>(); cam = tr.Find("OVRCameraRig/TrackingSpace/CenterEyeAnchor").GetComponent <Transform>(); break_laser = GameObject.FindGameObjectWithTag("RController").GetComponent <LaserCaster>(); }
// Start is called before the first frame update void Start() { _audio = this.gameObject.AddComponent <AudioSource>(); tr = GetComponent <Transform>(); rend = GetComponent <Renderer>(); NormalColor = GetComponent <Renderer>().material.color; laserCaster = GameObject.FindGameObjectWithTag("RController").GetComponent <LaserCaster>(); rController = GameObject.FindGameObjectWithTag("RController"); particle = GameObject.FindGameObjectWithTag("Particles"); }
//public static GameObject voice_text; void Start() { tr = GetComponent <Transform>(); rb = GetComponent <Rigidbody>(); cc = GetComponent <CharacterController>(); // InputController의 하위에 있는 CenterEyeAnchor(카메라의 중앙)의 위치값을 가져온다. cam = tr.Find("OVRCameraRig/TrackingSpace/CenterEyeAnchor").GetComponent <Transform>(); //IBM 왓슨에 가져온 텍스트를 담은 3D_Text(Prefabs)를 넣어준다(특정 이벤트 발생시 인스턴스화하기 위해) Birth_Text = Resources.Load <GameObject>("3D_TEXT"); // 도형을 깨기위해 레이저의 스크립트를 불러올 그릇 만들기 break_laser = GameObject.FindGameObjectWithTag("RController").GetComponent <LaserCaster>(); }
public void ReflectLaser(Vector3 hitPos, GameObject pe) { parentEmitter = pe; plc = parentEmitter.GetComponent <LaserCaster>(); laserTimeOutCounter = MAX_LASER_TIMEOUT; reflectionLaser.laserOrientation = laserReflections[plc.laserOrientation, mirrorOrientation]; reflectionLaser.laserEnabled = true; Vector3 testPoint = new Vector3(-transform.InverseTransformPoint(hitPos).x, transform.InverseTransformPoint(hitPos).y); reflectionLaser.emitterOffset = testPoint + reflectionLaser.baseEmitterOffset; //reflectionLaser.emitterOffset = transform.TransformPoint(reflectionLaser.baseEmitterOffset) - hitPos; //Debug.Log("eo " + reflectionLaser.emitterOffset); //Debug.Log("beot " + transform.TransformPoint(reflectionLaser.baseEmitterOffset)); //Debug.Log("hp " + hitPos); }
// Use this for initialization void Start() { reflectionLaser = GetComponentInChildren <LaserCaster>(); reflectionLaser.laserEnabled = false; Debug.Log(laserReflections[2, 0]); }