[PunRPC]\u3068\u8a18\u8ff0\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059<\/strong><\/span>\u3002<\/p>\n[PunRPC]\u3068\u8a18\u8ff0\u3055\u308c\u305f\u5f8c\u306e\u95a2\u6570\u306fRPC\u3068\u3057\u3066\u547c\u3073\u51fa\u3055\u308c\u308b\u95a2\u6570\u3068\u3057\u3066\u8a8d\u8b58\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n
RPC\u4f7f\u7528\u4f8b<\/h2>\n
\u4ee5\u4e0b\u306fChapter10\u306eCharacterControlScript.cs\u306e\u653b\u6483\u6642\u306b\u5b9f\u884c\u3055\u308c\u308b\u51e6\u7406\u3067\u3059\u3002<\/p>\n
\u30dc\u30fc\u30eb\u306e\u751f\u6210\u3092RPC\u3092\u7528\u3044\u3066\u884c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n
\/\/\u30dc\u30fc\u30eb\u653b\u6483\r\n void AttackControl()\r\n {\r\n if (Input.GetButtonDown(\"Fire1\"))\r\n {\r\n \/\/\u653b\u6483\u30ed\u30c3\u30af\u958b\u59cb\r\n AttackLock = true;\r\n StartCoroutine(_ballattack(1f));\r\n }\r\n }\r\n\r\n IEnumerator _ballattack(float pausetime)\r\n {\r\n \/\/RPC\u3067\u30dc\u30fc\u30eb\u751f\u6210\r\n myPV.RPC(\"BallInst\", PhotonTargets.AllViaServer, transform.position + transform.up, transform.rotation);\r\n \/\/\u653b\u6483\u786c\u76f4\u306e\u305f\u3081pausetime\u3060\u3051\u5f85\u3064\r\n yield return new WaitForSeconds(pausetime);\r\n \/\/\u653b\u6483\u30ed\u30c3\u30af\u89e3\u9664\r\n AttackLock = false;\r\n }\r\n\r\n [PunRPC]\/\/\u30dc\u30fc\u30eb\u751f\u6210\r\n void BallInst(Vector3 instpos, Quaternion instrot, PhotonMessageInfo info)\r\n {\r\n \/\/\u30dc\u30fc\u30eb\u3092\u751f\u6210\r\n GameObject Ball = Instantiate(BallPrefab, instpos, instrot) as GameObject;\r\n Ball.GetComponent<BallManageScript>().Attacker = info.sender; \/\/\u30dc\u30fc\u30eb\u306b\u81ea\u5206\u306ePhotonPlayer\u60c5\u5831\u3092\u4e57\u305b\u308b\r\n }<\/pre>\n\u81ea\u30d7\u30ec\u30a4\u30e4\u30fc\u304c\u653b\u6483\u3057\u305f\u969b\u306b\u306f\u5168\u3066\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\uff30\uff23\u4e0a\u3067\u30dc\u30fc\u30eb\u306e\u751f\u6210\u3092\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001”BallInst\u95a2\u6570”\u3092RPC\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n
\u307e\u305f\u3001\u7403\u306ePrefab\u3092\u751f\u6210\u3059\u308b\u4f4d\u7f6e\u3068\u65b9\u5411\u3092\u5f15\u6570\u3068\u3057\u3066\u6e21\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"
\u3053\u306e\u8a18\u4e8b\u3067\u306f\u540c\u671f\u65b9\u6cd5\u306e\uff11\u3064\u3067\u3042\u308bRPC(\u30ea\u30e2\u30fc\u30c8\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u30fc\u30b3\u30fc\u30eb)\u306b\u3064\u3044\u3066\u8aac\u660e\u3044\u305f\u3057\u307e\u3059\u3002 RPC(\u30ea\u30e2\u30fc\u30c8\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u2015\u30b3\u30fc\u30eb)\u3068\u306f \u96e3\u3057\u3044\u8aac\u660e\u3067\u3082\u826f\u3044\u65b9\u306f\u3069\u3046\u305e\u4ee5\u4e0b\u306e\u30ea\u30f3\u30af\u304b\u3089Photon\u516c\u5f0f … <\/p>\n","protected":false},"author":1,"featured_media":432,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,5],"tags":[],"_links":{"self":[{"href":"http:\/\/uniblo.biz\/wp-json\/wp\/v2\/posts\/392"}],"collection":[{"href":"http:\/\/uniblo.biz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/uniblo.biz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/uniblo.biz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/uniblo.biz\/wp-json\/wp\/v2\/comments?post=392"}],"version-history":[{"count":18,"href":"http:\/\/uniblo.biz\/wp-json\/wp\/v2\/posts\/392\/revisions"}],"predecessor-version":[{"id":429,"href":"http:\/\/uniblo.biz\/wp-json\/wp\/v2\/posts\/392\/revisions\/429"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/uniblo.biz\/wp-json\/wp\/v2\/media\/432"}],"wp:attachment":[{"href":"http:\/\/uniblo.biz\/wp-json\/wp\/v2\/media?parent=392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/uniblo.biz\/wp-json\/wp\/v2\/categories?post=392"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/uniblo.biz\/wp-json\/wp\/v2\/tags?post=392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}