I am adding spheres at pointer clicked event but it seems that I am working on a virtual copy. I tried to see whether the destructor is called but it is not
I am adding spheres at pointer clicked event but it seems that I am working on a virtual copy or local copy. I tried to see whether the destructor is called but it is not for the object class I am using
com.microsoft.mixedreality.toolkit.foundation@f2323a9b7aec\Services\InputSystem\MixedRealityInputModule.cs
Modified MixedRealityInputModule.cs
void IMixedRealityPointerHandler.OnPointerClicked(MixedRealityPointerEventData eventData)
I am pushing the spheres in a list and counting them , but it seems that the counter is always 0. static int spheresCount = 0; private static List spheres = new List(); public void CreateSphere(Vector3 center) GameObject sphereobj = GameObject.CreatePrimitive(PrimitiveType.Sphere);//Capsule sphereobj.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f); sphereobj.transform.position = center; sphereobj.GetComponent().material = SphereYelllowMaterial; sphereobj.tag = "sphere_add_" + spheresCount.ToString();
spheresCount += 1;
spheres.Add(sphereobj);
Debug.Log(" " + System.Reflection.MethodBase.GetCurrentMethod().Name + " " + "spheres layer=" + sphereobj.layer);
Debug.Log(" " + System.Reflection.MethodBase.GetCurrentMethod().Name + " " + spheresCount);
Debug.Log(" " + System.Reflection.MethodBase.GetCurrentMethod().Name + " " + "sphere center=" + center.ToString());
Debug.Log(" " + System.Reflection.MethodBase.GetCurrentMethod().Name + " " + "sphere.layer=" + spheres[spheresCount].layer.ToString());
Debug.Log(System.Reflection.MethodBase.GetCurrentMethod().Name + " " + "sphere");
Debug.Log(" " + System.Reflection.MethodBase.GetCurrentMethod().Name + " " + spheresCount);// ----> not even shown
Am I missing a configuration? I tried marking the variables as volatile But still no improvement
private volatile static List<GameObject> spheres = new List<GameObject>(5);
static UInt16 spheresCount = 0;