Quantcast
Channel: Questions in topic: "log"
Viewing all articles
Browse latest Browse all 235

How to log the GameObject from a Scriptable Object Event

$
0
0
Hello, Need help because I did't find anything on Google with a few searchs, keywords are too vague maybe... . I have an event system within a C# struct and some ScriptableObjects using it. One ScriptableObject class has a method with a Debug.Log call. This method has to be called by a GameObject referencing the ScriptableObject (it is not an event method). . I want to debug the gameobject that called this method, but I don't know how to access any of its data from the Scriptable or the event system. . The Debug.Log stack trace is stopping at the Scriptable Object Level... >[my log message]> UnityEngine.Debug:LogWarning (object)> MyScriptableObjects:MyMethod> (MyScriptableObjects)> (at Assets/PathToMyScriptable.cs:15)> System.Reflection.MethodBase:Invoke(object,object[])> MyCustomEventEntry:b__4_0 () > (at Assets/PathToMyCustomEventEntry.cs:36). __end of stack trace__ . But I know that MyScriptableObjects:MyMethod (MyScriptableObjects) is called from a GameObject, I want to know it's ID or any data from it within the Debug.Log, is it possible ?

Viewing all articles
Browse latest Browse all 235

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>