/// <summary> /// Initializes a new instance of the /// <see cref="PropertyBackingFieldDrawer+HashableSerializedProperty"/> struct. /// </summary> /// <param name="path">Path.</param> /// <param name="target">Target.</param> public HashableSerializedProperty(string path, Object target) : this() { m_PropertyPath = path; m_TargetObject = target; // store the hash upon construction, in case the object is killed later m_Hash = ObjectX.GenerateHashCode(m_PropertyPath.GetHashCode(), m_TargetObject.GetHashCode()); }
public void SingleOrDefaultByIdTest() { DB.DeleteAll <ObjectX>(); var id1 = new ObjectX() { ObjectXId = Guid.NewGuid().ToString(), Name = "lover", NulldateTime = DateTime.Now, NullMoney = 45.23M }; DB.Insert(id1); Assert.IsNotNull(DB.SingleOrDefaultById <ObjectX>(id1.ObjectXId)); }
/// <summary> /// Displays the anchor handles. /// </summary> /// <returns> /// <see langword="true"/>, if anchor handles was displayed, <see langword="false"/> otherwise. /// </returns> /// <param name="joint">Joint.</param> /// <param name="bindpose">Bindpose.</param> /// <returns><see langword="true"/> if the handles changed; otherwise, <see langword="false"/>.</returns> public static bool DisplayAnchorHandles(Joint joint, Matrix4x4 bindpose) { Vector3 anchor = joint.anchor; if (SceneGUI.BeginHandles(joint, "Change Anchor")) { Matrix4x4 oldMatrix = Handles.matrix; Handles.matrix = Matrix4x4.TRS(joint.transform.position, joint.transform.rotation, Vector3.one); anchor = TransformHandles.Translation( ObjectX.GenerateHashCode(joint.GetHashCode(), s_AnchorHandleHash), anchor, Quaternion.identity, 0.5f ); Handles.matrix = oldMatrix; } if (SceneGUI.EndHandles()) { joint.anchor = anchor; return(true); } return(false); }
/// <summary> /// Initializes the <see cref="SerializedPropertyX"/> class. /// </summary> static SerializedPropertyX() { // get all of the GUIDrawer types List <System.Type> drawerTypes = ObjectX.AllTypes.Where(t => t.IsSubclassOf(typeof(GUIDrawer))).ToList(); // associate object/attribute types with their respective drawers foreach (System.Type drawerType in drawerTypes) { CustomPropertyDrawer[] attrs = ObjectX.GetCustomAttributes <CustomPropertyDrawer>(drawerType); if (attrs.Length > 0) { System.Type baseType = customPropertyDrawerTypeField.GetValue(attrs[0]) as System.Type; Dictionary <System.Type, System.Type> registrationTable = typeof(DecoratorDrawer).IsAssignableFrom(drawerType) ? decoratorsForEachType : drawersForEachType; if (!registrationTable.ContainsKey(baseType)) { registrationTable.Add(baseType, drawerType); } else { registrationTable[baseType] = drawerType; } if ((bool)customPropertyDrawerUseForChildrenField.GetValue(attrs[0])) { foreach (System.Type type in ObjectX.AllTypes) { if (!registrationTable.ContainsKey(type) && type.IsSubclassOf(baseType)) { registrationTable.Add(type, drawerType); } } } } } }
public override int GetHashCode() { return(ObjectX.GenerateHashCode(this.Locale.GetHashCode(), this.Text.GetHashCode())); }
public override bool Equals(object obj) { return(ObjectX.Equals(ref this, obj)); }
public override bool Equals(object obj) { return(ObjectX.Equals <OrdinalName>(ref this, obj)); }
public override int GetSerializedPropertiesHash() { // Only generate a hash code from values that will be serialized. return(ObjectX.GenerateHashCode(m_MaxHealth.GetHashCode(), this.Name.GetHashCode())); }
public override int GetHashCode() { return(ObjectX.GenerateHashCode(m_Index.GetHashCode(), this.Name.GetHashCode())); }
/// <summary> /// Serves as a hash function for a <see cref="CylinderProperties"/> object. /// </summary> /// <returns> /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a /// hash table. /// </returns> public override int GetHashCode() { return(ObjectX.GenerateHashCode(this.Height.GetHashCode(), this.Radius.GetHashCode())); }
/// <summary> /// Serves as a hash function for a <see cref="JointAngularLimits"/> object. /// </summary> /// <returns> /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a /// hash table. /// </returns> public override int GetHashCode() { return(ObjectX.GenerateHashCode( m_XMax.GetHashCode(), m_XMin.GetHashCode(), m_YMax.GetHashCode(), m_ZMax.GetHashCode() )); }