WebServer7 웹서버 데이터를 유니티와 연동하기 이전에 mySQL와 restAPI로 만들었던 웹서버와 데이터 베이스를 유니티에 연동해 보자. 엑셀로 만들었던 프로토콜 문서로 mySQL을 이용하여 데이터 베이스를 만들어 정보를 저장한다. 그후 restAPI를 통해 데이터베이스에 저장되어있는 정보를 javeScript와 Node.js를 통해 웹서버로 옴겨왔었다. 우리는 javeScript와 Node.js대신 C#과 Unity를 통해 정보를 게임으로 출력할 것이다. 먼저 엑셀로 만들었던 프로토콜대로 클래스를 만든다. using System.Collections; using System.Collections.Generic; using UnityEngine; public class Protocols { public class member { public int.. 2020. 7. 28. MySQL : 수업 products 테이블 members 테이블 purchases 테이블 멤버 정보와 구매정보 연결 상품 정보랑 구매정보 연결 SQL 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 desc members; desc products; desc purchases; insert into nodejs.members(user_name, password) values('홍길동', '123'); insert into nodejs.members(user_name, password) values('임꺽정', '123'); insert into nodejs.members(user_name, password) values('이순신', '123'); insert int.. 2020. 7. 21. Node.js : npm와 express package.json { "name": "exam_07", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "express": "^4.17.1" }, "devDependencies": { "nodemon": "^2.0.4" } } www.js 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 4.. 2020. 7. 17. Node.js : postman 완성하기 restServer.js 파일에서 비어있었던 swich 문을 작성해 보았다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 const h.. 2020. 7. 17. 이전 1 2 다음