internal void CreateTypeSphere(LevelSphere.Type type = LevelSphere.Type.nomal) { LevelSphere levelSphere; if (SphereCreateParent.childCount != 0) { levelSphere = SphereCreateParent.GetChild(0).GetComponent <LevelSphere>(); levelSphere.SphereType = type; levelSphere.anchoredPosition3D(new Vector3(0, -100, 0)).localScale(1); } else { levelSphere = CreateSphere(SphereCreateParent, 0, new Vector3(0, -100, 0), type); } levelSphere.m_Circle.enabled = false; }
internal LevelSphere CreateSphere(Transform parent, double value, Vector2 pos, LevelSphere.Type type = LevelSphere.Type.nomal) { LevelSphere Clone = ObjectPool.Instance.Spawn <LevelSphere>("m_Sphere", parent); Clone.m_Rigidbody.constraints = ~RigidbodyConstraints2D.FreezePositionX; Clone.SphereType = type; if (type == LevelSphere.Type.nomal) { Clone.SphereNum = (float)value; } id++; Clone.id = id; Clone.anchoredPosition3D(pos).localScale(1); Clone.name = "Sphere_" + value; return(Clone); }