public override object Clone() { var condition = new FamilyCondition(); condition.type = type; condition.value = value; return(condition); }
private void FamilyConditionField(FamilyCondition condition) { condition.type = (FamilyValueType)EditorGUILayout.EnumPopup(condition.type); condition.@operator = (RelationalOperator)EditorGUILayout.EnumPopup(condition.@operator); switch (condition.type) { case FamilyValueType.MemberType: condition.value = (int)(FamilyType)EditorGUILayout.EnumPopup((FamilyType)((int)condition.value)); break; case FamilyValueType.Gone: condition.value = EditorGUILayout.Toggle(condition.value == 1) ? 1 : 0; break; case FamilyValueType.Hunger: condition.value = EditorGUILayout.IntField((int)condition.value); break; case FamilyValueType.DyingRate: case FamilyValueType.MentalHealth: condition.value = EditorGUILayout.FloatField(condition.value); break; } }