/// <summary> /// Генерация цвета по цифровому коду /// </summary> /// <param name="ID"></param> public void SetRandomType(int ID) { if (spriteRenderer == null) { spriteRenderer = GetComponent <SpriteRenderer>(); } colorID = ID; type = GetColor(); spriteRenderer.sprite = spritesOfCrystal[colorID]; }
void Update() { if (!cell.gameField.CheckMove()) { return; } if (cell.gameField.inRotate) { return; } if (cell.gameField.moveCrystals.Count != 0) { return; } if (type == TypeOfCrystal.starOfDeath && cell.targetOfDeathStar) { type = TypeOfCrystal.None; ScoreManager.AddDeathStar(); cell.destroyEffect.Activate(gameObject, true, 1000); } }
public void SetType(TypeOfCrystal type) { typeOfCrystal = type; }
public void Star(Field _field, Crystal _crystal) { field = _field; crystal = _crystal; typeOfCrystal = crystal.type; }