Hi Randy, thank you for response. I found something. No matter what I create the new project or new scene is fine. If I use the DMM script (Only this MascotMaker.cs), the problem will appear.
First, I turn off the script, then start to play, analytics is fine. The event can uploading and success. Then, I turn on the script, analytics can’t uploading. And the console haven’t any error log.
In this script, I check the Awake and test, until line 22, the problem will appear, Form.Show() will use System.Windows.Forms.Control.
System.Windows.Forms Version=4.0.0.0
void Awake()
{
CheckInstance();
if (mainWindowHandle == IntPtr.Zero)
{
System.Diagnostics.Process curProcess = System.Diagnostics.Process.GetCurrentProcess();
//int processId = curProcess.Id;
//Microsoft.VisualBasic.Interaction.AppActivate(processId);
SetForegroundWindow(curProcess.Handle);
mainWindowHandle = GetActiveWindow();
}
cam = transform.GetComponent<Camera>();
rend = transform.GetComponent<Renderer>();
cam.clearFlags = CameraClearFlags.SolidColor;
Form = new MascotForm();
Form.Show();
// formDummy = new Form();
// formDummy.FormBorderStyle = FormBorderStyle.None;
// formDummy.Opacity = 0.0;
// formDummy.Show();
// Invoke("closeDummy", 0.01f);
// if (PlayOnAwake)
// {
// isRender = true;
// }
// else
// {
// isRender = false;
// Form.Hide();
// }
// mascotMakerMaterial = (Material)Resources.Load("MascotMakerMaterial", typeof(Material));
// Debug.Assert(mascotMakerMaterial != null, "mascotMakerMaterial is not found!", transform);
// mascotMakerMaterialChromakey = (Material)Resources.Load("MascotMakerMaterialChromakey", typeof(Material));
// Debug.Assert(mascotMakerMaterialChromakey != null, "MascotMakerMaterialChromakey is not found!", transform);
// mascotMakerTexture = new RenderTexture((int)MascotFormSize.x, (int)MascotFormSize.y, 24, RenderTextureFormat.ARGB32);
// Debug.Assert(mascotMakerTexture != null, "MascotMakerTexture is not found!", transform);
// mascotMakerTexture.antiAliasing = (int)AntiAliasing;
// mascotFormSizePre = MascotFormSize;
// antiAliasingPre = AntiAliasing;
// ChromaKeyColor = new UnityEngine.Color(ChromaKeyColor.r, ChromaKeyColor.g, ChromaKeyColor.b, 0.0f);
// cam.backgroundColor = new UnityEngine.Color(ChromaKeyColor.r, ChromaKeyColor.g, ChromaKeyColor.b, 0.0f);
// mascotMakerMaterialChromakey.color = new UnityEngine.Color(ChromaKeyColor.r, ChromaKeyColor.g, ChromaKeyColor.b, 0.0f);
// ChromaKeyRange = Mathf.Clamp(ChromaKeyRange, 0.002f, 1.0f);
// chromaKeyRangePre = ChromaKeyRange;
// mascotMakerMaterialChromakey.SetFloat("_Amount", chromaKeyRangePre);
// if (ChromaKeyCompositing)
// {
// rend.material = mascotMakerMaterialChromakey;
// }
// else
// {
// rend.material = mascotMakerMaterial;
// }
// rend.sharedMaterial.mainTexture = mascotMakerTexture;
// cameraTexture = new Texture2D(mascotMakerTexture.width, mascotMakerTexture.height, TextureFormat.ARGB32, false);
// cam.targetTexture = mascotMakerTexture;
// CvSize size = new CvSize(mascotMakerTexture.width, mascotMakerTexture.height);
// img = Cv.CreateImage(size, BitDepth.U8, 4);
// scaleVector = new Vector3(1.0f, -1.0f, 1.0f);
// isMouseHover = false;
// Form._LeftMouseDown += LeftMouseDown;
// Form._LeftMouseUp += LeftMouseUp;
// Form._RightMouseUp += RightMouseUp;
// Form._MiddleMouseUp += MiddleMouseUp;
// offsetX = 0;
// offsetY = 0;
// isLeftMouseDown = false;
// frameColor = new CvScalar(255, 0, 0, 128);
}