protected override void Perform() { _sausage.PlaySound(); burn.BurnPiece(); if (Level.AllSausagesCooked(LevelStart.aLevelStarted)) { subActions.Add(new LevelStart.EndLevel(_sausage.Code)); } if (_sausage.Burnt()) { _sausage.LoseScreenOn(); } }
protected override void Perform() { var sausage = Level.CheckForSausage(_sausage.b1 + _dir); if (sausage != null && sausage != _sausage && _sausage.Code == sausage.Code) { subActions.Add(new SausageMoveAction(sausage, _dir)); } var otherSausage = sausage; sausage = Level.CheckForSausage(_sausage.b2 + _dir); if (sausage != null && sausage != otherSausage && sausage != _sausage && _sausage.Code == sausage.Code) { subActions.Add(new SausageMoveAction(sausage, _dir)); } var diff = _dir - _sausage.Dir; if (diff.x != 0 && diff.y != 0) { _sausage.Flip(_dir); } else { _sausage.Move(_dir); } if (_sausage.MustFall()) { _sausage.Sink(); _sausage.LoseScreenOn(); } if (Level.IsGrill(_sausage.b2)) { subActions.Add(new SausageBurnAction((_sausage._flipped ? _sausage.s3 : _sausage.s1).gameObject .GetComponent <Burn>())); } if (Level.IsGrill(_sausage.b1)) { subActions.Add(new SausageBurnAction((_sausage._flipped ? _sausage.s4 : _sausage.s2).gameObject .GetComponent <Burn>())); } }