//Check you slice a fruit or not , and slice it! public void Slice(GameObject _Fruit, Weapon weapon) { SlicedHull slicedObject = Sliceed(_Fruit, weapon.slicePanel, sliceMaterial); if (slicedObject != null) { if (_Fruit.CompareTag("fruit")) { _Fruit.SetActive(false); Fruit fruit = _Fruit.GetComponent <Fruit>(); pooler.ReycleFruit(fruit); if (fruit.particleTyp == particleType.Explosion) { soundManager.BombSound(); weapon.Vibrate(0.5f); } else if (fruit.particleTyp == particleType.Ice) { soundManager.FrozenSound(); uIManager.IncreaseScore(4); weapon.Vibrate(0.2f); } else { soundManager.SplashFruit(); uIManager.IncreaseScore(1); weapon.Vibrate(0.1f); } } else if (_Fruit.CompareTag("button")) { weapon.Vibrate(0.1f); uIManager.BeforeSelectButton(); soundManager.SplashFruit(); StartCoroutine(Countdown(_Fruit)); } pooler.GetParticle(_Fruit.GetComponent <Fruit>().particleTyp, _Fruit.transform.position, _Fruit.transform.rotation); GameObject upperPart = slicedObject.CreateUpperHull(_Fruit); GameObject lowPart = slicedObject.CreateLowerHull(_Fruit); AddComponents(upperPart); AddComponents(lowPart); } else { Debug.Log("null"); } }