Esempio n. 1
0
    public void CreateStage()
    {
        _stageData = DataManager.Instance.stageData.list[(int)Random.Range(0, 10.0f)];
           //그리드를 WorldToScreenPoint로 바꿔주기ㅁ
        for (int i = 0; i < 7; i++)
        {
            if (_stageData.pos[i] != 0)
            {
                Vector3 SpawnPos = new Vector3((i-3) * gridX, gridY, 0);
                spawningMonster.GetComponent<MonsterFSM>().monsterLevel = level;
                spawningMonster.GetComponent<MonsterFSM>().no = step;
                spawningMonster.GetComponent<MonsterFSM>().elite = _stageData.pos[i];
                Instantiate(spawningMonster, SpawnPos, Quaternion.Euler(0, 0, 0));

            }

        }

        step++;

        if (step > 34)
        {
            step = 1;
            level++;
        }
    }
Esempio n. 2
0
 public override BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData)
 {
     NintendoLand.TileTypes.Bee bee = tileType as NintendoLand.TileTypes.Bee;
     return(new Bee()
     {
         index = bee.index
     });
 }
Esempio n. 3
0
 public override BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData)
 {
     NintendoLand.TileTypes.Hole hole = tileType as NintendoLand.TileTypes.Hole;
     return(new Hole()
     {
         state = (Size)stage.holeDefinitions[hole.definitionIndex]
     });
 }
Esempio n. 4
0
 public override BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData)
 {
     NintendoLand.TileTypes.Goal goal = tileType as NintendoLand.TileTypes.Goal;
     return(new Goal()
     {
         levelTarget = goal.levelTarget, bonusGoalInput = new TextBox()
     });
 }
Esempio n. 5
0
 public override BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData)
 {
     NintendoLand.TileTypes.Spike spike = tileType as NintendoLand.TileTypes.Spike;
     return(new Spike()
     {
         state = (SpikeStartState)spike.state
     });
 }
Esempio n. 6
0
 public override BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData)
 {
     NintendoLand.TileTypes.RotatingObject rotatingObject = tileType as NintendoLand.TileTypes.RotatingObject;
     return(new RotatingObject()
     {
         index = rotatingObject.index, orbitters = new List <BaseObject>(), pivotInput = new ComboBox()
     });
 }
Esempio n. 7
0
        public override BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData)
        {
            NintendoLand.TileTypes.Fruit fruit = tileType as NintendoLand.TileTypes.Fruit;
            var fruitMappings     = stage.fruitAssociations[fruit.index - 1].Values;
            var fruitTypeMappings = fruitMappings.Select(fruitMapping => fruitData.FruitByID[fruitMapping].FruitType);
            var fruitTypes        = new HashSet <FruitData.FruitType>(fruitTypeMappings.SelectMany(mapping => mapping.Values).Select(entry => (FruitData.FruitType)entry));

            return(new Fruit()
            {
                selectedFruitTypes =
                    ((FruitData.FruitType[])Enum.GetValues(typeof(FruitData.FruitType))).ToDictionary(
                        enumValue => enumValue, enumValue => fruitTypes.Contains(enumValue))
            });
        }
Esempio n. 8
0
        public override BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData)
        {
            NintendoLand.TileTypes.OrderedFruit orderedFruit = tileType as NintendoLand.TileTypes.OrderedFruit;
            var orderedFruitMappings     = stage.orderedFruitDefinition[orderedFruit.order - 1].Values;
            var orderedFruitTypeMappings = orderedFruitMappings.Select(fruitMapping => fruitData.FruitByID[fruitMapping].FruitType);
            var orderedFruits            = new HashSet <FruitData.FruitType>(orderedFruitTypeMappings.SelectMany(mapping => mapping.Values).Select(entry => (FruitData.FruitType)entry));

            return(new OrderedFruit()
            {
                order = orderedFruit.order,
                selectedFruitTypes =
                    ((FruitData.FruitType[])Enum.GetValues(typeof(FruitData.FruitType))).ToDictionary(
                        enumValue => enumValue, enumValue => orderedFruits.Contains(enumValue))
            });
        }
Esempio n. 9
0
 public override BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData)
 {
     return(new Start());
 }
Esempio n. 10
0
 public abstract BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData);
Esempio n. 11
0
    /// <summary>
    /// Stage 정보를 ScriptableObject만듬
    /// </summary>
    static void MakeStageData()
    {
        //SciprtableObject를 생성
        StageData data = ScriptableObject.CreateInstance<StageData>();
        //ScriptableObject를 파일로 만듬
        AssetDatabase.CreateAsset((ScriptableObject)data, stageExportPath);
        //수정 불가능하게 설정(에디터에서 수정 하게 하려면 주석처리)
        data.hideFlags = HideFlags.NotEditable;

        //자료를 삭제(초기화)
        data.list.Clear();

        //CSVRead
        List<Dictionary<string,object>> csvData = CSVReader.Read("CSV/Stage");

        for (int i = 0; i < csvData.Count; i++)
        {
            StageData.Stage temp = new StageData.Stage();
            //여기에 추가Name,stage,no,maxHP,moveSpeed,ave,feature1,feature2
            temp.type = (int)csvData[i]["type"];
            temp.pos[0] = (int)csvData[i]["0"];
            temp.pos[1] = (int)csvData[i]["1"];
            temp.pos[2] = (int)csvData[i]["2"];
            temp.pos[3] = (int)csvData[i]["3"];
            temp.pos[4] = (int)csvData[i]["4"];
            temp.pos[5] = (int)csvData[i]["5"];
            temp.pos[6] = (int)csvData[i]["6"];

            data.list.Add(temp);

        }

        //위에서 생성된 SciprtableObject의 파일을 찾음
        ScriptableObject obj =
            AssetDatabase.LoadAssetAtPath(stageExportPath, typeof(ScriptableObject)) as ScriptableObject;
        //디스크에 쓰기
        EditorUtility.SetDirty(obj);
    }
Esempio n. 12
0
 void Awake()
 {
     _stageData = DataManager.Instance.stageData.list[step - 1];
 }