Esempio n. 1
0
    void OnGUI()
    {
        MonoBehaviour[] mobs = Resources.FindObjectsOfTypeAll <MonoBehaviour>();
        for (int i = 0; i < mobs.Length; ++i)
        {
            bool        hasDrawnLabelForThisMob = false;
            FieldInfo[] objectFields            = mobs[i].GetType().GetFields();
            for (int j = 0; j < objectFields.Length; ++j)
            {
                DebugAttribute attr = Attribute.GetCustomAttribute(objectFields[j], typeof(DebugAttribute)) as DebugAttribute;
                if (attr != null)
                {
                    if (!hasDrawnLabelForThisMob)
                    {
                        EditorGUI.indentLevel = 0;

                        EditorGUILayout.Space();
                        EditorGUILayout.Space();

                        EditorGUILayout.LabelField(mobs[i].gameObject.name, EditorStyles.boldLabel);
                        hasDrawnLabelForThisMob = true;
                    }

                    EditorGUI.indentLevel = 1;
                    DrawField(objectFields[j], mobs[i]);
                }
            }
        }
    }
Esempio n. 2
0
 public void TestSetup()
 {
     _mocks             = new MockRepository();
     _mockHttpContext   = _mocks.StrictMock <HttpContextBase>();
     _mockRequest       = _mocks.StrictMock <HttpRequestBase>();
     _mockResponse      = _mocks.StrictMock <HttpResponseBase>();
     _mockFilterContext = _mocks.StrictMock <ActionExecutedContext>();
     _filter            = new DebugAttribute();
     _mocks.ReplayAll();
     _mockFilterContext.Expect(fc => fc.HttpContext).Return(_mockHttpContext);
     _mockHttpContext.Expect(hc => hc.Request).Return(_mockRequest);
 }