Как добавить звук

Импорт текстур, моделей, звуков и пр.

Как добавить звук

Сообщение Inflame 24 мар 2015, 23:44

ребята как добавить

Синтаксис:
Используется csharp
if(logedIn){
                        SelectCharacter();
                }
        }
       
        public void SendSelectedPlayer(string playerName) {
                Room room = smartFox.LastJoinedRoom;
                ISFSObject selectedPlayer= new SFSObject();
                selectedPlayer.PutUtfString("selectedPlayerName", playerName);
                ExtensionRequest request = new ExtensionRequest("selectedPlayer", selectedPlayer, room);
                smartFox.Send(request);
        }
       
        private void SelectCharacter(){
                areaHeight=340;
                int ScreenX = ((int)(Screen.width / 2) - (areaWidth / 2));
        int ScreenY = ((int)(Screen.height / 2) - (areaHeight/ 2));
                GUILayout.BeginArea (new Rect (ScreenX, ScreenY, areaWidth, areaHeight),"Login","Window");
                GUILayout.Space(38);
                pos=GUILayout.BeginScrollView(pos);
                foreach(Player player in characterList){
                        if(GUILayout.Button(player.Name)){
                                SendSelectedPlayer(player.Name);
                                UnregisterSFSSceneCallbacks();
                                Application.LoadLevel("game");
                        }
                }
                GUILayout.FlexibleSpace();
                GUILayout.EndScrollView();
                if(GUILayout.Button("Create new")){
                        CreateCharacter();
                }
                GUILayout.EndArea();
        }
       
        private void CreateCharacter(){
                UnregisterSFSSceneCallbacks();
                Application.LoadLevel("creation");
        }



prebaf ? так как данный скрипт на одной сцене
Последний раз редактировалось Inflame 25 мар 2015, 00:57, всего редактировалось 1 раз.
Inflame
UNITрон
 
Сообщения: 256
Зарегистрирован: 26 фев 2014, 21:02

Re: Как добавить звук

Сообщение Inflame 24 мар 2015, 23:47

GUILayout.Space(4);
if (GUILayout.Button("Login") || (Event.current.type == EventType.keyDown && Event.current.character == '\n'))
{
AddEventListeners();
smartFox.Connect(serverName, serverPort);
}


Как добавить звук
Inflame
UNITрон
 
Сообщения: 256
Зарегистрирован: 26 фев 2014, 21:02


Вернуться в Медиа

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 4