// Use this for initialization
    void Start()
    {
        isInHidingMode = false;
        inEnemyTest = false;
        actualMode = EDITMODE.CUBE;
        placementCube = cursor.transform.FindChild("PlacementCube").gameObject;
        deleteCube = cursor.transform.FindChild("DeleteCube").gameObject;
        placementSpecial = cursorSpecial.transform.FindChild("PlacementSpecial").gameObject;
        deleteSpecial = cursorSpecial.transform.FindChild("DeleteSpecial").gameObject;
        playerSpawnValid = playerSpawn.transform.FindChild("SpawnValid").gameObject;
        playerSpawnInvalid = playerSpawn.transform.FindChild("SpawnInvalid").gameObject;
        playerFinishValid = playerFinish.transform.FindChild("FinishValid").gameObject;
        playerFinishInvalid = playerFinish.transform.FindChild("FinishInvalid").gameObject;
        canonCursorValid = canonCursor.transform.FindChild("CanonValid").gameObject;
        canonCursorInvalid = canonCursor.transform.FindChild("CanonInvalid").gameObject;
        cameraEnValid = cameraEnCursor.transform.FindChild("CameraValid").gameObject;
        cameraEnInvalid = cameraEnCursor.transform.FindChild("CameraInvalid").gameObject;
        cameraRotationCursor = cameraEnCursor.transform.FindChild("CubePosition").gameObject;
        enemyHelicoValid = enemyHelicoCursor.transform.FindChild("HelicoValid").gameObject;
        enemyHelicoHover = enemyHelicoCursor.transform.FindChild("HelicoHover").gameObject;
        enemyHelicoInvalid = enemyHelicoCursor.transform.FindChild("HelicoInvalid").gameObject;
        enemyValid = enemyCursor.transform.FindChild("EnemyValid").gameObject;
        enemyHover = enemyCursor.transform.FindChild("EnemyHover").gameObject;
        enemyInvalid = enemyCursor.transform.FindChild("EnemyInvalid").gameObject;
        cursorWayValid = cursorEdit.transform.FindChild("WayEditValid").gameObject;
        cursorWayAction = cursorEdit.transform.FindChild("ActionEdit").gameObject;
        listUIEnemy = new Dictionary<Enemy, List<GameObject>>();
        listLevelSaved = new List<string>();

        actualSizeSelected = 0;
        actualActionSelected = (int)MOVE.WAIT;
        actualFileSelected = 0;

        actualLevel = new LevelEditor(maxWidth, maxHeight, maxVolume);

        for(int i = 0; i<widthLevelDefault; i++)
        {
            for(int j=0; j<heightLevelDefault; j++)
            {
                var go = (GameObject)Instantiate(cubeBase, new Vector3(j*2, 0f, i*2), cubeBase.transform.rotation);
                actualLevel.setCube(i, j, 0, go);
                go.SetActive(true);
            }
        }
    }