void OnDestroy() { // this works for the real game run, where OnApplicationQuit doesn't // seem to be called. Debug.Log("Object is being destroyed"); LightstreamerSingleton.Stop(tableKey); }
void Start() { oneOverZigs = 1f / (float)zigs; particleEmitter.emit = false; particleEmitter.Emit(zigs); particles = particleEmitter.particles; Debug.Log("Start called for: " + this + ", " + this.GetInstanceID()); lock (typeof(LightningBolt)) { GameObject obj = GameObject.Find("LightstreamerText" + boltCounter); Debug.Log("Found TextMesh? => LightstreamerText" + boltCounter + "? => " + (obj != null)); boltCounter++; if (obj != null) { suscribedItemName = "item" + boltCounter; string[] items = { suscribedItemName }; textMesh = (TextMesh)obj.GetComponent("TextMesh"); textMeshFound = true; textMeshStr = suscribedItemName; currentTextMeshStr = ""; tableKey = LightstreamerSingleton.Startup(this, items); } } // try to create a TextMesh over the object //TextMesh mesh = new TextMesh(); //mesh.transform.position = new Vector3(this.transform.position.x, // this.transform.position.y, // this.transform.position.z); // mesh.text = "Hello"; //gameObject.AddComponent(mesh); // mesh. target.position; }
void OnApplicationQuit() { Debug.Log("Application is quitting"); LightstreamerSingleton.Stop(tableKey); }