2012-05-11 18 views
0

我正在用Unity3d構建遊戲代碼的服務器,我的服務器是用Yii構建的,但是當我看到有關Yii的webservice的指南時,我看到它使用soapClient在服務器中調用函數。但是在Unity3d中,我只知道WWW和WWWForm要求服務器。那麼,有誰知道如何在Unity3d中使用webservice與Yii進行通信?
非常感謝。Unity3d和Yii webserivce

回答

1

你只需通過WWWForm

http://unity3d.com/support/documentation/ScriptReference/WWWForm.html

var highscore_url = "http://www.my-site.com/?r=MyGame/highscore"; 

而且在Yii中的控制器發送數據:\保護\控制器\ MyGameController.php

class MyGame extends Controller 
{ 
    public function actionHighscore() 
    { 
     // Here you get data from $_REQUEST ($_POST or $_GET) 
     // and use Yii's power for output some data 
     // like perl example in link upthere 
    } 

} 
+0

okei。非常感謝。 –