Skip to content

Update to Unity 5.x #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

deprofundiis
Copy link

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 :)

deprofundiis and others added 3 commits March 4, 2016 18:20
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 :)
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.
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.

1 participant