コード例 #1
0
    }     //End of GetPath

    #endregion


    public static void CallFunction(List <GameObject> objs, string scriptName, string functionName, List <Object> parameters)
    {
        foreach (GameObject obj in objs)
        {
            MonoBehaviour c = (MonoBehaviour)obj.GetComponent(scriptName.ToString());
            //MethodInfo m = c.GetType().GetMethod(functionName);

            c.BroadcastMessage(functionName.ToString());

            //c.functionName() ;
        }
    }
コード例 #2
0
 public static void BroadcastMessage( MonoBehaviour sender, string methodName )
 {
     #if DEBUG
     Debug.Log(
         string.Format(
             @"{0}{1}.BroadcastMessage( ""{2}"" );",
             LiveConsoleLogAttribute.Get( LiveConsoleLogAttribute.Attribute.Message ),
             sender.gameObject.name,
             methodName
         ),
         sender
         );
     #endif
     sender.BroadcastMessage( methodName, SendMessageOptions.DontRequireReceiver );
 }
コード例 #3
0
 private void Log(string status)
 {
     Debug.Log(status);
     parent.BroadcastMessage("OnUpdateStatus", status);
 }
コード例 #4
0
 private void OnTriggerEnter(Collider other)
 {
     m_target.BroadcastMessage("OnTriggerEnter", other);
 }