public static bool ReturnOrnament(Ornament ornament, bool skipRemoveFromList = false) { if (ornament) { switch (ornament.GetOrnamentType()) { case OrnamentType.Flower: FlowerPool.GetInstance().ReturnToPool(ornament.gameObject, skipRemoveFromList); break; case OrnamentType.Candle: CandlePool.GetInstance().ReturnToPool(ornament.gameObject, skipRemoveFromList); break; case OrnamentType.Heart: HeartPool.GetInstance().ReturnToPool(ornament.gameObject, skipRemoveFromList); break; case OrnamentType.Statue:; StatuePool.GetInstance().ReturnToPool(ornament.gameObject, skipRemoveFromList); break; default: Debug.LogError("Something Went Wrong"); break; } return(true); } else { return(false); } }
protected override void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } base.Awake(); }