public void SetStyle( AsNotify.MSG_BOX_TYPE type, AsNotify.MSG_BOX_ICON icon) { switch( type) { case AsNotify.MSG_BOX_TYPE.MBT_OK: { ok.gameObject.SetActiveRecursively( false); cancel.gameObject.SetActiveRecursively( false); center.gameObject.SetActiveRecursively( true); } break; case AsNotify.MSG_BOX_TYPE.MBT_CANCEL: { ok.gameObject.SetActiveRecursively( false); cancel.gameObject.SetActiveRecursively( false); center.gameObject.SetActiveRecursively( true); } break; case AsNotify.MSG_BOX_TYPE.MBT_OKCANCEL: center.gameObject.SetActiveRecursively( false); break; case AsNotify.MSG_BOX_TYPE.MBT_NOTHING: { cancel.gameObject.SetActiveRecursively( false); ok.gameObject.SetActiveRecursively( false); center.gameObject.SetActiveRecursively( false); } break; default: Debug.Log( "Invalid messagebox type"); break; } }
void Awake() { instance = this; m_RootObject = new GameObject( "MessageBox"); DontDestroyOnLoad( m_RootObject); }