///////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// LoadBasics
        /// # Load basics
        /// </summary>
        ///////////////////////////////////////////////////////////////////////////////////////////////////////
        protected void LoadBasics()
        {
            configSaver = new ConfigSaver();


            meshDecalPrefab = AssetDatabase.LoadAssetAtPath(BasicDefines.MESH_DECAL_PREFAB_PATH, typeof(GenericMeshDecal)) as GenericMeshDecal;

            if (!meshDecalPrefab)
            {
                Debug.Log("NOTE -> no meshDecalPrefab, verify folder: " + BasicDefines.MESH_DECAL_PREFAB_PATH);
            }

            projectedDecalPrefab = AssetDatabase.LoadAssetAtPath(BasicDefines.PROJECTED_DECAL_PREFAB_PATH, typeof(GenericProjectorDecal)) as GenericProjectorDecal;

            if (!projectedDecalPrefab)
            {
                Debug.Log("NOTE -> no projectedDecalPrefab, verify folder: " + BasicDefines.MESH_DECAL_PREFAB_PATH);
            }

            if (EditorBasicFunctions.GetPrefabList().Count > 0)
            {
                genericObject = EditorBasicFunctions.GetPrefabList()[0];
            }
        }
        ///////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// HandleProjectedDecalsMode
        /// # To insert projected decals in scene using mouse
        /// </summary>
        ///////////////////////////////////////////////////////////////////////////////////////////////////////
        void HandleProjectedDecalsMode()
        {
            if ((GetEditorTimeDiff() > 0.1f) && EditorBasicFunctions.GetMouseButtonDown(0) && EditorBasicFunctions.GetInsertModeKeyPressed() && !GetDoingSomethingSpecial())
            {
                previousEditorTime = EditorApplication.timeSinceStartup;

                //Debug.Log ("Event.current.mousePosition: " + Event.current.mousePosition);

                Ray        ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition);
                RaycastHit hit;

                if (Physics.Raycast(ray, out hit))
                {
                    if (lastProjectedDecalsHitPoint.ToString() == hit.point.ToString())
                    {
                        //Debug.Log ("NOTE: same point duplicate -> lastProjectedDecalsHitPoint: " + lastProjectedDecalsHitPoint);
                    }
                    else
                    {
                        //Debug.Log ("lastProjectedDecalsHitPoint A: " + lastProjectedDecalsHitPoint);

                        lastProjectedDecalsHitPoint = hit.point;

                        //Debug.Log ("New Decal");
                        //Debug.Log ("Hit position: " + hit.point);
                        //Debug.Log ("Collider Name: " + hit.collider.name);

                        GenericProjectorDecal actualProjectedDecal = Instantiate(projectedDecalPrefab.gameObject).GetComponent <GenericProjectorDecal> () as GenericProjectorDecal;
                        actualProjectedDecal.SetOldParameters(projectedDecalPrefab.transform.localScale, projectedDecalPrefab.GetComponent <Projector> ().orthographicSize, projectedDecalPrefab.GetComponent <Projector> ().aspectRatio);

                        //Debug.Log (actualProjectedDecal.material.mainTexture.name);

                        actualProjectedDecal.transform.position = hit.point + 0.3f * hit.normal;

                        Vector3 finalScale = Random.Range(actualProjectedDecal.scaleRange.x, actualProjectedDecal.scaleRange.y) * actualProjectedDecal.transform.localScale;

                        float textureAspectRatio = (float)actualProjectedDecal.material.mainTexture.width / (float)actualProjectedDecal.material.mainTexture.height;

                        finalScale.x = textureAspectRatio * finalScale.x;

                        actualProjectedDecal.transform.localScale = finalScale;

                        actualProjectedDecal.transform.LookAt(hit.point);

                        actualProjectedDecal.transform.Rotate(new Vector3(0, 0, Random.Range(actualProjectedDecal.rotationRange.x, actualProjectedDecal.rotationRange.y)));

                        actualProjectedDecal.name = actualProjectedDecal.Generate(BasicDefines.PROJECTED_DECAL_BASE_NAME, GetSeedForInstancies(), true, actualProjectedDecal.material.name);

                        //Debug.Log ("actualProjectedDecal.attachToCollisionObject: " + actualProjectedDecal.attachToCollisionObject);

                        if (actualProjectedDecal.attachToCollisionObject)
                        {
                            //Debug.Log ("Parent name: " + hit.collider.name);
                            actualProjectedDecal.transform.parent = hit.collider.transform;
                        }
                        else
                        {
                            GameObject decalsContainer = BasicFunctions.CreateContainerIfNotExists(BasicDefines.PROJECTED_DECAL_CONTAINER_NAME);
                            actualProjectedDecal.transform.parent = decalsContainer.transform;
                        }

                        actualProjectedDecal.UpdateShape();

                        actualObjectToForceSelect = actualProjectedDecal.gameObject;
                    }
                }
            }
        }
        ///////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// DrawProjectedDecalElements
        /// # Draw all projected decal elements
        /// </summary>
        ///////////////////////////////////////////////////////////////////////////////////////////////////////
        public static Material DrawProjectedDecalElements(GenericProjectorDecal decal, bool comeFromEditor, Rect position, ConfigSaver configSaver)
        {
            if (decal)
            {
                EditorBasicFunctions.DrawEditorBox("Insert projected decals: Options", Color.white, position);

                if (!configSaver.parameters.hideBasicHelp)
                {
                    EditorBasicFunctions.DrawEditorBox("NOTE: Projected decals are experimental, they work but not perfectly!\n" + GetInsertModeHelpString() + " them", Color.yellow, position);
                }

                EditorGUILayout.Separator();

                configSaver.parameters.showProjectedDecalsConfigOptions = EditorGUILayout.Foldout(configSaver.parameters.showProjectedDecalsConfigOptions, new GUIContent("Show projected decals configuration options", "Show projected decals configuration options"));

                if (!configSaver.parameters.showProjectedDecalsConfigOptions)
                {
                    EditorGUILayout.Separator();
                }
                else
                {
                    EditorBasicFunctions.DrawEditorBox("Configuration", Color.yellow, position);

                    EditorGUILayout.Separator();

                    decal.attachToCollisionObject = EditorGUILayout.Toggle(new GUIContent("Attach to father", "Attach created decal to hit object"), decal.attachToCollisionObject);

                    if (comeFromEditor)
                    {
                        EditorGUILayout.Separator();

                        decal.scaleRange   = EditorGUILayout.Vector2Field(new GUIContent("Scale range", "Randomize decal scale between 2 values"), decal.scaleRange, new GUILayoutOption[] { GUILayout.Width(0.5f * position.width) });
                        decal.scaleRange.x = Mathf.Clamp(decal.scaleRange.x, 0.01f, 10);
                        decal.scaleRange.y = Mathf.Clamp(decal.scaleRange.y, 0.01f, 10);

                        EditorGUILayout.Separator();

                        decal.rotationRange   = EditorGUILayout.Vector2Field(new GUIContent("Rotation range", "Randomize decal rotation between 2 values"), decal.rotationRange, new GUILayoutOption[] { GUILayout.Width(0.5f * position.width) });
                        decal.rotationRange.x = Mathf.Clamp(decal.rotationRange.x, 0, 360);
                        decal.rotationRange.y = Mathf.Clamp(decal.rotationRange.y, 0, 360);
                    }

                    EditorGUILayout.Separator();
                    EditorGUILayout.Separator();
                }

                EditorBasicFunctions.DrawEditorBox("Choose projected decal!", Color.white, position);
                EditorGUILayout.Separator();
                EditorGUILayout.Separator();

                decal.material = EditorBasicFunctions.ShowObjectField <Material> ("Actual selected material ", decal.material);

                decal.material = EditorBasicFunctions.DrawProjectedDecalMaterialList(decal.material, Screen.width);

                EditorGUILayout.Separator();
                EditorGUILayout.Separator();

                if (decal.material)
                {
                    List <Sprite> spriteListFromTexture = EditorBasicFunctions.GetSpriteListFromTexture(decal.material.mainTexture);

                    if (spriteListFromTexture.Count > 0)
                    {
                        decal.sprite = spriteListFromTexture [0];
                    }

                    if (!comeFromEditor)
                    {
                        EditorBasicFunctions.DrawEditorBox("Info", Color.white, position);

                        EditorGUILayout.Separator();
                    }

                    return(decal.material);
                }
            }


            return(null);
        }