/// <summary> /// crack will calculate fragments and prepare object for explosion /// Use this method in combination with ExplodeCracked() /// Purpose of this method is to get higher performance of explosion, Crack() will /// calculate the explosion and prepare all fragments. Calling ExplodeCracked() will /// then start the explosion (flying fragments...) immediately /// </summary> public void Crack(OnCracked callback) { ExploderUtils.Assert(!crack, "Another crack in progress!"); if (!crack) { CrackedCallback = callback; crack = true; cracked = false; Explode(null); } }
/// <summary> /// crack single object, use in combination with ExplodeCracked(...) /// </summary> /// <param name="obj">object to be cracked</param> /// <param name="callback"></param> public void CrackObject(GameObject obj, OnCracked callback) { ExploderUtils.Assert(!crack, "Another crack in progress!"); if (!crack) { CrackedCallback = callback; crack = true; cracked = false; ExplodeObject(obj, null); } }
/// <summary> /// crack will calculate fragments and prepare object for explosion /// Use this method in combination with ExplodeCracked() /// Purpose of this method is to get higher performance of explosion, Crack() will /// calculate the explosion and prepare all fragments. Calling ExplodeCracked() will /// then start the explosion (flying fragments...) immediately /// </summary> public void CrackRadius(OnCracked callback) { ExploderUtils.Assert(!crack, "Another crack in progress!"); if (!crack) { CrackedCallback = callback; crack = true; cracked = false; ExplodeRadius(null); } }