public void UpdateSwap() { var prefab = GetPrefab(); if (clone != null) { if (clonePrefab == prefab) { return; } LeanHelper.Destroy(clone.gameObject); clone = null; clonePrefab = null; } if (Prefabs != null && Prefabs.Count > 0) { clone = Instantiate(prefab); clone.transform.SetParent(transform, false); clonePrefab = prefab; } }