예제 #1
0
 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);
 }
예제 #2
0
 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);
 }