Last active
August 29, 2015 14:20
-
-
Save suakig/90c2e46827834385d76c to your computer and use it in GitHub Desktop.
EndMonoBehaviourSample.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class EndMonoBehaviourSample : EndMonoBehaviour | |
{ | |
private Hashtable table = new Hashtable(); | |
private void Start() | |
{ | |
iTween.MoveTo(gameObject, iTween.Hash("x", 20, "looptype", iTween.LoopType.loop)); | |
Invoke ("make", 0.1f); | |
//Destroy(this.gameObject, 1.0); | |
//で削除すると、削除途中に終了した時、OnApplicationQuitが呼ばれない | |
//また、非アクティブ状態のまま終了した場合も呼ばれない | |
Invoke ("delete", 1.0f); | |
iTween.Pause (); | |
} | |
void make() | |
{ | |
GameObject ga = new GameObject (); | |
ga.AddComponent(this.GetType()); | |
} | |
void delete() | |
{ | |
Destroy (this.gameObject); | |
} | |
protected override void OnDisableNotApplicationQuit() | |
{ | |
Debug.Log ("OnDisableNotApplicationQuit"); | |
} | |
protected override void OnDestroyNotApplicationQuit() | |
{ | |
iTween.Stop (this.gameObject); | |
Debug.Log ("OnDestroyNotApplicationQuit"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment