Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
neogeek committed Mar 9, 2021
0 parents commit cfca408
Show file tree
Hide file tree
Showing 16 changed files with 541 additions and 0 deletions.
270 changes: 270 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
# editorconfig.org
root = true

[*.cs]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{json,md}]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

# CSharp and Visual Basic code style settings:
[*.cs]
dotnet_style_require_accessibility_modifiers = always:suggestion
dotnet_style_readonly_field = true:warning

# CSharp and Visual Basic code style settings:
[*.cs]
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_auto_properties = true:suggestion

# CSharp code style settings:
[*.cs]
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion

# CSharp code style settings:
[*.cs]
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:suggestion
csharp_style_expression_bodied_indexers = true:suggestion
csharp_style_expression_bodied_accessors = true:suggestion

# CSharp code style settings:
[*.cs]
csharp_style_inlined_variable_declaration = true:suggestion

# CSharp code style settings:
[*.cs]
csharp_prefer_braces = true:silent

# .NET formatting settings:
[*.cs]
dotnet_sort_system_directives_first = true

# CSharp formatting settings:
[*.cs]
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true

# CSharp formatting settings:
[*.cs]
csharp_indent_case_contents = true
csharp_indent_switch_labels = true

# CSharp formatting settings:
[*.cs]
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false

# CSharp formatting settings:
[*.cs]
csharp_preserve_single_line_statements = false
csharp_preserve_single_line_blocks = false

# Rider Specific Settings:

## Blank Lines

[*.cs]
csharp_blank_lines_around_region = 1
csharp_blank_lines_inside_region = 1
csharp_blank_lines_before_single_line_comment = 1
csharp_keep_blank_lines_in_declarations = 1
csharp_remove_blank_lines_near_braces_in_declarations = false
csharp_blank_lines_after_start_comment = 1
csharp_blank_lines_between_using_groups = 0
csharp_blank_lines_after_using_list = 0
csharp_blank_lines_around_namespace = 1
csharp_blank_lines_inside_namespace = 1
csharp_blank_lines_around_type = 1
csharp_blank_lines_inside_type = 1
csharp_blank_lines_around_field = 1
csharp_blank_lines_around_single_line_field = 1
csharp_blank_lines_around_property = 1
csharp_blank_lines_around_single_line_property = 1
csharp_blank_lines_around_auto_property = 1
csharp_blank_lines_around_single_line_auto_property = 1
csharp_blank_lines_around_invocable = 1
csharp_blank_lines_around_single_line_invocable = 1
csharp_blank_lines_around_local_method = 1
csharp_keep_blank_lines_in_code = 1
csharp_remove_blank_lines_near_braces_in_code = false
csharp_blank_lines_around_local_method = 1
csharp_blank_lines_around_single_line_local_method = 1
csharp_blank_lines_before_control_transfer_statements = 1
csharp_blank_lines_after_control_transfer_statements = 1
csharp_blank_lines_before_block_statements = 1
csharp_blank_lines_after_block_statements = 1
csharp_blank_lines_before_multiline_statements = 1
csharp_blank_lines_after_multiline_statements = 1

## Brace Layout

[*.cs]
csharp_type_declaration_braces = next_line
csharp_indent_inside_namespace = true
csharp_invocable_declaration_braces = next_line
csharp_anonymous_method_declaration_braces = next_line
csharp_accessor_owner_declaration_braces = next_line
csharp_accessor_declaration_braces = next_line
csharp_case_block_braces = next_line
csharp_initializer_braces = next_line
csharp_other_braces = next_line
csharp_allow_comment_after_lbrace = false
csharp_empty_block_style = multiline

## Code Style

csharp_for_built_in_types = use_var
csharp_for_simple_types = use_var
csharp_for_other_types = use_var
csharp_prefer_explicit_discard_declaration = true
csharp_instance_members_qualify_members = none
csharp_instance_members_qualify_declared_in = this_class
csharp_default_private_modifier = explicit
csharp_default_internal_modifier = explicit

## Line Breaks

[*.cs]
csharp_place_type_attribute_on_same_line = false
csharp_place_method_attribute_on_same_line = false
csharp_place_accessorholder_attribute_on_same_line = false
csharp_place_accessor_attribute_on_same_line = false
csharp_place_field_attribute_on_same_line = false

csharp_keep_existing_declaration_block_arrangement = false
csharp_place_abstract_accessorholder_on_single_line = true
csharp_place_simple_accessorholder_on_single_line = false
csharp_place_accessor_with_attrs_holder_on_single_line = true
csharp_place_simple_accessor_on_single_line = true
csharp_place_simple_method_on_single_line = false

## Spaces

[*.cs]
csharp_extra_spaces = remove_all
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_before_typeof_parentheses = false
csharp_space_before_default_parentheses = false
csharp_space_before_checked_parentheses = false
csharp_space_before_sizeof_parentheses = false
csharp_space_before_nameof_parentheses = false
csharp_space_between_keyword_and_expression = true
csharp_space_between_keyword_and_type = true
csharp_space_within_if_parentheses = false
csharp_space_within_while_parentheses = false
csharp_space_within_catch_parentheses = false
csharp_space_within_switch_parentheses = false
csharp_space_within_for_parentheses = false
csharp_space_within_foreach_parentheses = false
csharp_space_within_using_parentheses = false
csharp_space_within_lock_parentheses = false
csharp_space_within_fixed_parentheses = false
csharp_space_within_parentheses = false
csharp_space_between_typecast_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_within_typeof_parentheses = false
csharp_space_within_default_parentheses = false
csharp_space_within_checked_parentheses = false
csharp_space_within_sizeof_parentheses = false
csharp_space_within_nameof_parentheses = false
csharp_space_before_open_square_brackets = false
csharp_space_between_square_brackets = false
csharp_space_between_empty_square_brackets = false
csharp_space_before_type_parameter_angle = false
csharp_space_before_type_argument_angle = false
csharp_space_within_type_parameter_angles = false
csharp_space_within_type_argument_angles = false;
csharp_space_before_singleline_accessorholder = true
csharp_space_in_singleline_accessorholder = true
csharp_space_between_accessors_in_singleline_property = true
csharp_space_within_empty_braces = true
csharp_space_in_singleline_method = true
csharp_space_in_singleline_anonymous_method = true
csharp_space_within_single_line_array_initializer_braces = true
csharp_space_around_assignment_op = true
csharp_space_around_logical_op = true
csharp_space_around_equality_op = true
csharp_space_around_relational_op = true
csharp_space_around_bitwise_op = true
csharp_space_around_additive_op = true
csharp_space_around_multiplicative_op = true
csharp_space_around_shift_op = true
csharp_space_around_nullcoalescing_op = true
csharp_space_around_arrow_op = true
csharp_space_after_logical_not_op = false
csharp_space_after_unary_minus_op = false
csharp_space_after_unary_plus_op = false
csharp_space_after_ampersand_op = false
csharp_space_after_asterik_op = false
csharp_space_near_postfix_and_prefix_op = false
csharp_space_before_ternary_quest = true
csharp_space_after_ternary_quest = true
csharp_space_before_ternary_colon = true
csharp_space_after_ternary_colon = true
csharp_space_before_comma = false
csharp_space_after_comma = true
csharp_space_before_semicolon_in_for_statement = false
csharp_space_after_semicolon_in_for_statement = true
csharp_space_before_semicolon = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_before_type_parameter_constraint_colon = true
csharp_space_after_type_parameter_constraint_colon = true
csharp_space_before_colon_in_case = false
csharp_space_after_colon_in_case = true
csharp_space_before_attribute_colon = true
csharp_space_after_attribute_colon = true
csharp_space_between_attribute_sections = true
csharp_space_between_square_brackets = false
csharp_space_after_attributes = true
csharp_space_after_cast = false
csharp_space_around_dot = false
csharp_space_around_lambda_arrow = true
csharp_space_before_pointer_asterik_declaration = false
csharp_space_before_nullable_mark = false
csharp_space_around_alias_eq = true
csharp_space_before_trailing_comment = true
csharp_space_after_operator_keyword = true

## Resharper

[*.cs]
resharper_check_namespace_highlighting = do_not_show
resharper_inconsistent_naming_highlighting = do_not_show
resharper_member_can_be_private_global_highlighting = do_not_show
resharper_unused_member_global_highlighting = do_not_show
resharper_introduce_optional_parameters_global_highlighting = do_not_show
resharper_delegate_subtraction_highlighting = do_not_show
3 changes: 3 additions & 0 deletions CandyCoded.env.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "CandyCoded.env"
}
7 changes: 7 additions & 0 deletions CandyCoded.env.asmdef.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Editor/CandyCoded.env.Editor.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "CandyCoded.env.Editor",
"references": [
"GUID:0022c094e0c7f481288196a6d3e9ce33"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
3 changes: 3 additions & 0 deletions Editor/CandyCoded.env.Editor.asmdef.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Editor/Scripts.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions Editor/Scripts/BuildTools.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright (c) Scott Doxey. All Rights Reserved. Licensed under the MIT License. See LICENSE in the project root for license information.

using System;
using System.IO;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;

namespace CandyCoded.env.Editor
{

public class BuildTools : IPreprocessBuildWithReport, IPostprocessBuildWithReport
{

public int callbackOrder { get; }

private bool _resourcesDirCreated;

public void OnPreprocessBuild(BuildReport report)
{

if (File.Exists(env.runtimeFilePath))
{

throw new Exception($"{env.runtimeFilePath} already exists. Remove this file before continuing.");

}

if (!Directory.Exists(env.resourcesDirPath))
{

Directory.CreateDirectory(env.resourcesDirPath);

_resourcesDirCreated = true;

}

FileUtil.CopyFileOrDirectory(env.editorFilePath, env.runtimeFilePath);

}

public void OnPostprocessBuild(BuildReport report)
{

FileUtil.DeleteFileOrDirectory(_resourcesDirCreated ? env.resourcesDirPath : env.runtimeFilePath);

_resourcesDirCreated = false;

}

}

}
3 changes: 3 additions & 0 deletions Editor/Scripts/BuildTools.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cfca408

Please sign in to comment.