Arrêt de Unity lors de la compilation (Photon Chat)

Questions techniques liées à l’utilisation d'Unity (et n'entrant pas dans le cadre d'une des sections suivantes)
Xtz_JoC
Messages : 3
Inscription : 22 Juin 2019 16:19

Arrêt de Unity lors de la compilation (Photon Chat)

Message par Xtz_JoC » 22 Juin 2019 16:29

Bonjour,
Petit problème : Unity s’arrête de fonctionner sans message d’erreur ou autre Debug Error.
Cela se produit alors que Unity compile après avoir fait un build du projet ou modifié un script.
La roue de compilation tourne, puis tout se stop, Unity ne répond plus mais Windows ne fait pas apparaître de problème type : « Unity ne répond pas … »
Je suis obligé de le fermer via le gestionnaire des taches car la fenêtre ne répond plus du tout. Même en attendant un quart d’heure, Unity ne décoince pas …
De plus, le problème est là depuis la création d’un script en particulier. Ce script utilise Photon Chat.
Auriez vous des explications à ce phénomène ?

Le script en question :

Code : Tout sélectionner

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Chat;
using ExitGames.Client.Photon;
using Photon.Pun;
using Photon.Realtime;

public class Chat : MonoBehaviour, IChatClientListener
{
    public void DebugReturn(DebugLevel level, string message)
    {
        if (level == ExitGames.Client.Photon.DebugLevel.ERROR)
        {
            Debug.LogError(message);
        }
        else if (level == ExitGames.Client.Photon.DebugLevel.WARNING)
        {
            Debug.LogWarning(message);
        }
        else
        {
            Debug.Log(message);
        }
    }

    public void OnChatStateChange(ChatState state)
    {
    }

    public void OnConnected()
    {
        Debug.Log("Connected");
        chatClient.Subscribe(new string[] { "test" }, 0);
    }

    public void OnDisconnected()
    {
        Debug.Log("Disconnected");
    }

    public void OnGetMessages(string channelName, string[] senders, object[] messages)
    {
        Debug.Log("Received message from channel : " + channelName + " that say : " + messages[0]);
    }

    public void OnPrivateMessage(string sender, object message, string channelName)
    {
    }

    public void OnStatusUpdate(string user, int status, bool gotMessage, object message)
    {
    }

    public void OnSubscribed(string[] channels, bool[] results)
    {
        Debug.Log("Subscribed");
    }

    public void OnUnsubscribed(string[] channels)
    {
    }

    public void OnUserSubscribed(string channel, string user)
    {
        Debug.Log("User Subscribed");
    }

    public void OnUserUnsubscribed(string channel, string user)
    {
    }



    ChatClient chatClient;
    AppSettings chatAppSettings;

    private void Start()
    {
        chatClient = new ChatClient(this);
        chatClient.ChatRegion = "EU";
        chatAppSettings = PhotonNetwork.PhotonServerSettings.AppSettings;
        this.chatClient.UseBackgroundWorkerForSending = true;
        chatClient.Connect(chatAppSettings.AppIdChat, "1.0", new Photon.Chat.AuthenticationValues("Player"));
    }

    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.P))
        {
            chatClient.PublishMessage("test", "This is a test");
        }
        chatClient.Service();
    }
}

Avatar de l’utilisateur
Max
Messages : 8764
Inscription : 30 Juil 2011 13:57
Contact :

Re: Arrêt de Unity lors de la compilation (Photon Chat)

Message par Max » 22 Juin 2019 17:37

Bonjour,

Le fichier Log, il dit quoi ?
Image
Pas d'aide par MP, le forum est là pour ça.
En cas de doute sur les bonnes pratiques à adopter sur le forum, consulter la Charte et sa FAQ

Xtz_JoC
Messages : 3
Inscription : 22 Juin 2019 16:19

Re: Arrêt de Unity lors de la compilation (Photon Chat)

Message par Xtz_JoC » 22 Juin 2019 18:05

Où puis je trouver ce fichier ?
J'ai regardé dans le répertoire : C:\Users\username\AppData\Local\Unity\Editor\
Et voici le conteneu
{"level":"info","message":"Starting Server","timestamp":"2019-06-22T14:09:26.868Z"}
{"level":"info","message":"Health Request received","timestamp":"2019-06-22T14:09:27.289Z"}

Avatar de l’utilisateur
Max
Messages : 8764
Inscription : 30 Juil 2011 13:57
Contact :

Re: Arrêt de Unity lors de la compilation (Photon Chat)

Message par Max » 22 Juin 2019 18:10

Oui, le fichier est EditorLog.txt.
Mais il devrait comporter bien plus d'éléments que ce que tu liste au dessus...
Image
Pas d'aide par MP, le forum est là pour ça.
En cas de doute sur les bonnes pratiques à adopter sur le forum, consulter la Charte et sa FAQ

Xtz_JoC
Messages : 3
Inscription : 22 Juin 2019 16:19

Re: Arrêt de Unity lors de la compilation (Photon Chat)

Message par Xtz_JoC » 22 Juin 2019 19:26

J'ai seulement un fichier Editor.txt ou Editor-prev.txt
Editor.txt contient comme dernières lignes :
-----CompilerOutput:-stdout--exitcode: 0--compilationhadfailure: False--outfile: Temp/Assembly-CSharp.dll
Compilation succeeded - 11 warning(s)
-----CompilerOutput:-stderr----------
Assets/Scripts/InventoryScripts/ItemTransferManager.cs(338,25): warning CS0219: The variable `temp' is assigned but its value is never used
Assets/Scripts/CarScript/CarController.cs(14,41): warning CS0649: Field `CarController.frontPassengerW' is never assigned to, and will always have its default value `null'
Assets/Scripts/CarScript/CarController.cs(14,58): warning CS0649: Field `CarController.backDriverW' is never assigned to, and will always have its default value `null'
Assets/Scripts/CarScript/CarController.cs(14,71): warning CS0649: Field `CarController.backPassengerW' is never assigned to, and will always have its default value `null'
Assets/Scripts/CarScript/CarController.cs(17,37): warning CS0649: Field `CarController.frontPassengerT' is never assigned to, and will always have its default value `null'
Assets/Scripts/CarScript/CarController.cs(17,54): warning CS0649: Field `CarController.backDriverT' is never assigned to, and will always have its default value `null'
Assets/Scripts/CarScript/CarController.cs(17,67): warning CS0649: Field `CarController.backPassengerT' is never assigned to, and will always have its default value `null'
Assets/Scripts/MultiplayerScripts/MainMenu.cs(14,41): warning CS0649: Field `MainMenu.joinNameField' is never assigned to, and will always have its default value `null'
Assets/Scripts/MultiplayerScripts/MainMenu.cs(14,56): warning CS0649: Field `MainMenu.playerNameField' is never assigned to, and will always have its default value `null'
Assets/Scripts/MultiplayerScripts/PhotonRoom.cs(14,24): warning CS0414: The private field `PhotonRoom.pv' is assigned but its value is never used
Assets/Scripts/PlayerScripts/PlayerUIManager.cs(23,28): warning CS0649: Field `PlayerUIManager.radImg' is never assigned to, and will always have its default value `null'
-----EndCompilerOutput---------------
- Finished compile Library/ScriptAssemblies/Assembly-CSharp.dll
Symbols will be read from Temp\Assembly-CSharp.dll.mdb
Script Module: Assembly-CSharp.dll
Pass: 0 took 13 milliseconds
Pass: 1 took 69 milliseconds
- Starting compile Library/ScriptAssemblies/Assembly-CSharp-Editor.dll
- Finished compile Library/ScriptAssemblies/Assembly-CSharp-Editor.dll
Assets/Scripts/InventoryScripts/ItemTransferManager.cs(338,25): warning CS0219: The variable `temp' is assigned but its value is never used

(Filename: Assets/Scripts/InventoryScripts/ItemTransferManager.cs Line: 338)

Assets/Scripts/CarScript/CarController.cs(14,41): warning CS0649: Field `CarController.frontPassengerW' is never assigned to, and will always have its default value `null'

(Filename: Assets/Scripts/CarScript/CarController.cs Line: 14)

Assets/Scripts/CarScript/CarController.cs(14,58): warning CS0649: Field `CarController.backDriverW' is never assigned to, and will always have its default value `null'

(Filename: Assets/Scripts/CarScript/CarController.cs Line: 14)

Assets/Scripts/CarScript/CarController.cs(14,71): warning CS0649: Field `CarController.backPassengerW' is never assigned to, and will always have its default value `null'

(Filename: Assets/Scripts/CarScript/CarController.cs Line: 14)

Assets/Scripts/CarScript/CarController.cs(17,37): warning CS0649: Field `CarController.frontPassengerT' is never assigned to, and will always have its default value `null'

(Filename: Assets/Scripts/CarScript/CarController.cs Line: 17)

Assets/Scripts/CarScript/CarController.cs(17,54): warning CS0649: Field `CarController.backDriverT' is never assigned to, and will always have its default value `null'

(Filename: Assets/Scripts/CarScript/CarController.cs Line: 17)

Assets/Scripts/CarScript/CarController.cs(17,67): warning CS0649: Field `CarController.backPassengerT' is never assigned to, and will always have its default value `null'

(Filename: Assets/Scripts/CarScript/CarController.cs Line: 17)

Assets/Scripts/MultiplayerScripts/MainMenu.cs(14,41): warning CS0649: Field `MainMenu.joinNameField' is never assigned to, and will always have its default value `null'

(Filename: Assets/Scripts/MultiplayerScripts/MainMenu.cs Line: 14)

Assets/Scripts/MultiplayerScripts/MainMenu.cs(14,56): warning CS0649: Field `MainMenu.playerNameField' is never assigned to, and will always have its default value `null'

(Filename: Assets/Scripts/MultiplayerScripts/MainMenu.cs Line: 14)

Assets/Scripts/MultiplayerScripts/PhotonRoom.cs(14,24): warning CS0414: The private field `PhotonRoom.pv' is assigned but its value is never used

(Filename: Assets/Scripts/MultiplayerScripts/PhotonRoom.cs Line: 14)

Assets/Scripts/PlayerScripts/PlayerUIManager.cs(23,28): warning CS0649: Field `PlayerUIManager.radImg' is never assigned to, and will always have its default value `null'

(Filename: Assets/Scripts/PlayerScripts/PlayerUIManager.cs Line: 23)

Reloading assemblies after finishing script compilation.
Begin MonoManager ReloadAssembly

Répondre

Revenir vers « Unity le logiciel »