Beispiel #1
0
        protected override void FixedUpdate()
        {
            base.FixedUpdate();

            SRDebugUtil.FlushFixedUpdateLines();
            SRDebugUtil.IsFixedUpdate = true;
        }
Beispiel #2
0
        protected override void Update()
        {
            base.Update();

            SRDebugUtil.FlushLines();
            SRDebugUtil.IsFixedUpdate = false;
        }
Beispiel #3
0
        public MethodReference(object target, MethodInfo method)
        {
            SRDebugUtil.AssertNotNull(target);

            _target = target;
            _method = method;
        }
Beispiel #4
0
        public FieldReference(object target, FieldInfo field)
        {
            SRDebugUtil.AssertNotNull(target);

            _target = target;
            _field  = field;
        }
Beispiel #5
0
        public PropertyReference(object target, PropertyInfo property)
        {
            SRDebugUtil.AssertNotNull(target);

            _target   = target;
            _property = property;
        }
Beispiel #6
0
        /// <summary>
        /// Create a property reference from an object target and reflection PropertyInfo.
        /// This represents a property on an object.
        /// </summary>
        public PropertyReference(object target, PropertyInfo property)
        {
            SRDebugUtil.AssertNotNull(target);
            SRDebugUtil.AssertNotNull(property);

            PropertyType = property.PropertyType;
            _property    = property;
            _target      = target;

#if NETFX_CORE
            if (_property.GetMethod != null && _property.GetMethod.IsPublic)
#else
            if (property.GetGetMethod() != null)
#endif
            {
                _getter = () => SRReflection.GetPropertyValue(target, property);
            }


#if NETFX_CORE
            if (_property.SetMethod != null && _property.SetMethod.IsPublic)
#else
            if (property.GetSetMethod() != null)
#endif
            {
                _setter = (v) => SRReflection.SetPropertyValue(target, property, v);
            }
        }
Beispiel #7
0
        /// <summary>
        /// Create a property reference from lambdas. This has no underlying reflection or object associated with it.
        /// </summary>
        public PropertyReference(Type type, Func <object> getter = null, Action <object> setter = null, Attribute[] attributes = null)
        {
            SRDebugUtil.AssertNotNull(type);

            PropertyType = type;
            _attributes  = attributes;
            _getter      = getter;
            _setter      = setter;
        }
Beispiel #8
0
        public CustomReference(Type type, string name, Func <object> get, Action <object> set)
        {
            SRDebugUtil.AssertNotNull(get);
            SRDebugUtil.AssertNotNull(set);

            _type = type;
            _name = name;
            _get  = get;
            _set  = set;
        }
Beispiel #9
0
 private void OnPostRender()
 {
     SRDebugUtil.DrawDebugFrame(Camera);
 }
Beispiel #10
0
        public MethodReference(object target, MethodInfo method)
        {
            SRDebugUtil.AssertNotNull(target);

            _method = o => method.Invoke(target, o);
        }
Beispiel #11
0
 protected void Assert(bool condition, string message = null)
 {
     SRDebugUtil.Assert(condition, message, this);
 }
Beispiel #12
0
 protected void AssertNotNull(object value, string fieldName = null)
 {
     SRDebugUtil.AssertNotNull(value, fieldName, this);
 }