// Start is called before the first frame update void Start() { //各種オブジェクトを取得 mainSystem = GameObject.Find("Main System").GetComponent <MainScript>(); DBAdapter = GameObject.Find("Database Adapter").GetComponent <TMSDatabaseAdapter>(); calib_system = GameObject.Find("B-sen Calibration System").GetComponent <BsenCalibrationSystem>(); }
// Start is called before the first frame update void Start() { //各オブジェクトの取得 mainSystem = GameObject.Find("Main System").GetComponent <MainScript>(); refrigerator = GameObject.Find("refrigerator_link"); ar_camera = GameObject.Find("First Person Camera"); greentea = GameObject.Find("greentea_bottle_x_link"); cancoffee = GameObject.Find("cancoffee_x_link"); soysauce = GameObject.Find("soysauce_bottle_black_x_link"); //オブジェクトを辞書に登録 goods_data_dictionary.Add(7004, new GoodsData()); goods_data_dictionary.Add(7006, new GoodsData()); goods_data_dictionary.Add(7009, new GoodsData()); goods_data_dictionary[7004].obj = greentea; goods_data_dictionary[7006].obj = cancoffee; goods_data_dictionary[7009].obj = soysauce; //オブジェクトにShader変更スクリプトを追加 //オブジェクトの状態をfalseに //オブジェクトに消費期限表示用の3Dテキスト追加 foreach (GoodsData goods in goods_data_dictionary.Values) { goods.obj.AddComponent <ShaderChange>(); goods.state_bool = false; goods.text3d = (GameObject)Instantiate(Resources.Load("TextMeshPro")); goods.text3d.transform.SetParent(goods.obj.transform, false); goods.text3d.transform.localPosition = new Vector3(0.0f, 0.15f, 0.0f); TextMeshPro TMP = goods.text3d.GetComponent <TextMeshPro>(); TMP.fontSize = 0.6f; TMP.text = ""; goods.text3d.SetActive(false); } //位置合わせするや~つを配置 coordinates_adapter = Instantiate(new GameObject()); coordinates_adapter.name = "Coordinates Adapter"; coordinates_adapter.transform.SetParent(refrigerator.transform, false); //データベースと通信するやつ DBAdapter = GameObject.Find("Database Adapter").GetComponent <TMSDatabaseAdapter>(); //キャリブシステム calib_system = GameObject.Find("B-sen Calibration System").GetComponent <BsenCalibrationSystem>(); //冷蔵庫にもShader変更スクリプトを追加 refrigerator.AddComponent <ShaderChange>(); refrigerator_shaderchange = refrigerator.GetComponent <ShaderChange>(); //rostmsのShader変更スクリプト rostms_shaderchange = GameObject.Find("rostms").GetComponent <ShaderChange>(); }