예제 #1
0
    public void init(CellType _cellType,BombType _cellBombType,CellColor _cellColor)
    {
        string spritePath = _cellType.ToString() +_cellBombType.ToString()+ _cellColor.ToString();

        Sprite newSprite = Resources.Load("Sprite/Cells/"+spritePath,typeof(Sprite)) as Sprite;
        GetComponent<SpriteRenderer>().sprite = newSprite;
    }
예제 #2
0
    IEnumerator DoUpdateCell(float delayTime)
    {
        yield return(new WaitForSeconds(delayTime));

        string spritePath = _unitType.ToString() + _bombType.ToString() + _unitColor.ToString();

        Sprite newSprite = Resources.Load("Sprite/Cells/" + spritePath, typeof(Sprite)) as Sprite;

        GetComponent <SpriteRenderer>().sprite = newSprite;
    }
예제 #3
0
    private BombAsset LoadBombAssetOrPanic(BombType type)
    {
        string path = BOMB_OBJECTS_PATH_PREFIX + type.ToString() /*+ ASSET_FILE_TYPE*/;

        BombAsset bombAsset = Resources.Load<BombAsset>(path);

        if(bombAsset == null)
            throw new System.Exception("Load BombAsset of BombType: " + type + " from path: " + path + " failed");

        return bombAsset;
    }
예제 #4
0
 public void ChangeBombTypeFrequence(BombType ut, int freq)
 {
     var e = _root.Elements("Game").Where(c => String.Compare(Type.ToString(), c.Attribute("type").Value) == 0).Descendants("Upgrades");//.FirstOrDefault(c => String.Compare(ut.ToString(), c.Element("Upgrade").Value) == 0);
     XElement theut = null;
     foreach (var element in e.Elements("BombType").Where(element => String.Compare(ut.ToString(), element.Value) == 0))
     {
         theut = element;
     }
     if (theut != null)
     {
         theut.Attribute("currentFreq").Value = freq + "";
     }
 }
예제 #5
0
파일: Bomb.cs 프로젝트: Evilsmevil/PacBomb
 Color GetBombColour(BombType type)
 {
     switch(type)
     {
     case BombType.speed:
         return speedCol;
     case BombType.blastpower:
         return blastCol;
     case BombType.threatlvl:
         return threatCol;
     case BombType.timeslow:
         return timeCol;
     default:
         Debug.LogError("Unknown bomb colour requested " + type.ToString());
         return Color.white;
     }
 }