Skip to content

Update to Unity 5.x#1

Merged
varshneyjayant merged 3 commits intovarshneyjayant:masterfrom
deprofundiis:Unity5
Mar 10, 2016
Merged

Update to Unity 5.x#1
varshneyjayant merged 3 commits intovarshneyjayant:masterfrom
deprofundiis:Unity5

Conversation

@mostlyjason
Copy link
Copy Markdown

Since the current examples do not work with Unity 5.x I made the
following changes to the already existing scripts, and also included a
new UnityScript file to the lot.

this has been deprecated in version 5, so I basically changed it to:

public void OnEnable(){
Application.logMessageReceived += HandleLog;
}

public void OnDisable(){
Application.logMessageReceived -= HandleLog;
}

Where we send logs when the object is active and stop when it is
inactive.

/Send WWW Form to Loggly, replace TOKEN with your unique ID from Loggly
var sendLog = new
WWW("http://logs-01.loggly.com/inputs/TOKEN/tag/Unity3D/", loggingForm);
Did two things here. The communication per se (the WWW object) is
handled on a separate function, mainly because of the coroutine
handling in c# and now I force the message to be sent with yield, ergo
removing any concurrency issues. My code:

StartCoroutine(SendData(loggingForm));

public IEnumerator SendData(WWWForm form){
//Send WWW Form to Loggly, replace TOKEN with your unique ID
from Loggly
WWW sendLog = new
WWW("http://logs-01.loggly.com/inputs/TOKEN/tag/Unity3D", form);
yield return sendLog;
}

Have fun :)

Since the current examples do not work with Unity 5.x I made the
following changes to the already existing scripts, and also included a
new UnityScript file to the lot.

* Change CharmedMatter#1 Application.RegisterLogCallback(HandleLog);

this has been deprecated in version 5, so I basically changed it to:

public void OnEnable(){
Application.logMessageReceived += HandleLog;
}

public void OnDisable(){
Application.logMessageReceived -= HandleLog;
}

Where we send logs when the object is active and stop when it is
inactive.

* Change CharmedMatter#2

/Send WWW Form to Loggly, replace TOKEN with your unique ID from Loggly
var sendLog = new
WWW("http://logs-01.loggly.com/inputs/TOKEN/tag/Unity3D/", loggingForm);
Did two things here. The communication per se (the WWW object) is
handled on a separate function, mainly because of the coroutine
handling in c# and now I force the message to be sent with yield, ergo
removing any concurrency issues. My code:

StartCoroutine(SendData(loggingForm));

public IEnumerator SendData(WWWForm form){
//Send WWW Form to Loggly, replace TOKEN with your unique ID
from Loggly
WWW sendLog = new
WWW("http://logs-01.loggly.com/inputs/TOKEN/tag/Unity3D", form);
yield return sendLog;
}

Have fun :)
Comment thread LogOutputHandler.cs Outdated
}
//Register the HandleLog function on scene start to fire on debug.log events
public void OnEnable(){
Application.logMessageReceived += HandleLog;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a consistent style for tabs?

deprofundiis and others added 2 commits March 10, 2016 00:03
Just found that Atom has a default set to look at the files and not at the editor's settings when trying to select whether hard or soft tabs.
Fixed indentation and already updated Atom's settings so it won't happen again.
@mostlyjason
Copy link
Copy Markdown
Author

@psquickitjayant can you merge this?

varshneyjayant added a commit that referenced this pull request Mar 10, 2016
@varshneyjayant varshneyjayant merged commit ecf8586 into varshneyjayant:master Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants