public bool LinkToGraph() { if (!Application.isPlaying) { Scene scene = SceneManager.GetActiveScene(); if (scene.isLoaded) { graph = scene.FindRootObject <EventGraph>(); if (graph != null) { if (!graph.ContainsEvent(this)) { graph.AddEvent(this); } return(true); } else { Debug.LogError("No EventGraph component on root objects. Removing PhysicalEvent component."); DestroyImmediate(this); } } } return(false); }
public bool LinkToGraph() { if (!Application.isPlaying) { Scene scene = SceneManager.GetActiveScene(); if (scene.isLoaded) { graph = scene.FindRootObject <EventGraph>(); if (graph != null) { if (!graph.ContainsEvent(this)) { graph.AddEvent(this); } return(true); } else { Debug.LogError("Il doit y avoir un component EventGraph sur un des gameobjects racine."); } } } return(false); }