コード例 #1
0
 public SpwanedItemDefenition(JSONObject jsonObject)
 {
     ID = int.Parse(jsonObject["id"].ToString());
     string[] forceVectorStringArray = jsonObject["forceVector"].ToString().Replace("\"", "").Split(","[0]);
     ForceVector = new Vector2(float.Parse(forceVectorStringArray[0]), float.Parse(forceVectorStringArray[1]));
     XPosition = float.Parse(jsonObject["xPosition"].ToString());
     SpwanedColor = (eSpwanedColorType)int.Parse(jsonObject["colorType"].ToString());
 }
コード例 #2
0
 private eChromieType ColorForSpwanColorType(eSpwanedColorType spwanColorType)
 {
     eChromieType colorType = eChromieType.None;
     switch (spwanColorType)
     {
         case eSpwanedColorType.RandomCorner:
             {
                 colorType = _selectedChromies[Random.Range(0, _selectedChromies.Length)];
                 break;
             }
         case eSpwanedColorType.BottomLeft:
             {
                 colorType = _selectedChromies[3];
                 break;
             }
         case eSpwanedColorType.TopLeft:
             {
                 colorType = _selectedChromies[0];
                 break;
             }
         case eSpwanedColorType.TopRight:
             {
                 colorType = _selectedChromies[1];
                 break;
             }
         case eSpwanedColorType.BottomRight:
             {
                 colorType = _selectedChromies[2];
                 break;
             }
     }
     return colorType;
 }
コード例 #3
0
    private static Texture2D TeaxtureForSpwanItem(eSpwanedColorType spwanedItemColorType, WavesEditor wavesEditor)
    {
        Texture2D texture = null;
        switch (spwanedItemColorType)
        {
            case eSpwanedColorType.BottomLeft:
                {
                    texture = wavesEditor._leftBottomTexture;
                    break;
                }
            case eSpwanedColorType.BottomRight:
                {
                    texture = wavesEditor._rightBottomTexture;
                    break;
                }
            case eSpwanedColorType.RandomCorner:
                {
                    texture = wavesEditor._randomTexture;
                    break;
                }
            case eSpwanedColorType.TopLeft:
                {
                    texture = wavesEditor._leftTopTexture;
                    break;
                }
            case eSpwanedColorType.TopRight:
                {
                    texture = wavesEditor._rightTopTexture;
                    break;
                }
        }

        return texture;
    }
コード例 #4
0
ファイル: WavesEditor.cs プロジェクト: Barnaff/Chromania
 private void AddNewSpwanItem(eSpwanedColorType spwanItemType)
 {
     if (_currentSequance != null && _currentWave != null)
     {
         SpawnedItemDataObject newSpwanItem = new SpawnedItemDataObject();
         newSpwanItem.SpwanedColor = spwanItemType;
         newSpwanItem.XPosition = 0;
         newSpwanItem.ForceVector = new Vector2(0, 100);
         _currentWave.SpawnedItems.Add(newSpwanItem);
     }
 }
コード例 #5
0
    private static void AddItem(WavesEditor wavesEditor, eSpwanedColorType spwnaedItemType)
    {
        if (wavesEditor._currentWave != null)
        {
            if (wavesEditor._currentWave.SpawnedItems == null)
            {
                wavesEditor._currentWave.SpawnedItems = new List<SpawnedItemDataObject>();
            }

            SpawnedItemDataObject newItem = new SpawnedItemDataObject();
            newItem.SpwanedColor = spwnaedItemType;
            newItem.ForceVector = new Vector2(0, 144);

            wavesEditor._currentWave.SpawnedItems.Add(newItem);
        }
    }