void OnTriggerEnter(Collider t) { if (t.gameObject.CompareTag("mirror")) { changeScale.SetMirrorSize(t.gameObject.GetComponent <Mirror>().ReflectSize()); } }
//スケールの変更 void ChangeScale() { size = GetComponent <ObjectSize>().GetSize(); //ミラーサイズの取得 changeScale.SetMirrorSize(GetComponent <ObjectSize>().GetReflectSize()); ////// Vector3 targetScale = changeScale.Scale(hitMirror, size); scale = Lerp(scale, targetScale); ////// //Vector3 targetScale = changeScale.Scale(hitMirror, size); //scale = Lerp2(scaleStorage, targetScale); //Vector3 scale = changeScale.Scale(hitMirror, size/*mirrorRect, transform.position*/); //サイズの変更 transform.localScale = Vector3.Scale(scale, normalScale); //transform.localScale = Vector3.Scale(scale, normalScale); //質量の変更 GetComponent <Rigidbody>().mass = scale.x * scale.y * normalMass; ////ミラーサイズの取得 //changeScale.SetMirrorSize(GetComponent<ObjectSize>().GetReflectSize()); //Vector3 scale = changeScale.Scale(change, size/*mirrorRect, transform.position*/); ////サイズの変更 //transform.localScale = Vector3.Scale(scale, normalScale); ////質量の変更 //GetComponent<Rigidbody>().mass = scale.x * scale.y * normalMass; }