Just discovered, that an ongui construct doesn´t work any more in unity3 when using stripping.
Error Message in xCode:
MissingMethodException: Method not found: 'Default constructor not found...ctor() of UnityEngine.GUI+ScrollViewState'.
at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in <filename unknown>:0
at System.Activator.CreateInstance (System.Type type) [0x00000] in <filename unknown>:0
at UnityEngine.IDList.GetStateObject (System.Type t, Int32 controlID) [0x00000] in <filename unknown>:0
at UnityEngine.GUIUtility.GetStateObject (System.Type t, Int32 controlID) [0x00000] in <filename unknown>:0
at UnityEngine.GUI.BeginScrollView (Rect position, Vector2 scrollPosition, Rect viewRect, Boolean alwaysShowHorizontal, Boolean alwaysShowVertical, UnityEngine.GUIStyle horizontalScrollbar, UnityEngine.GUIStyle verticalScrollbar, UnityEngine.GUIStyle background) [0x00000] in <filename unknown>:0
at UnityEngine.GUI.BeginScrollView (Rect position, Vector2 scrollPosition, Rect viewRect) [0x00000] in <filename unknown>:0
at HelpGroup.OnGUI () [0x00000] in <filename unknown>:0
(Filename: Line: -1)
this is inside a c script like this:
using UnityEngine;
using System.Collections;
public class HelpGroup : MonoBehaviour {
private Vector2 scrollPos = Vector2.zero;
private float scrollPositionTextDelta = 0f;
private Rect scrollPosRect;
private Rect scrollContentRect;
private Rect scrollContentSize;
private Texture2D textureToScroll;
public GUISkin scrollGuiSkin;
void OnGUI () {
GUI.skin = scrollGuiSkin;
scrollPos = GUI.BeginScrollView (scrollPosRect, scrollPos, scrollContentRect);
if (GetPreferences.useHD == true) {
GUI.DrawTexture(scrollContentSize, textureToScroll, ScaleMode.ScaleToFit, true, 0.5f);
} else {
GUI.Label(scrollContentSize, textureToScroll);
}
GUI.EndScrollView();
}
the same works, when stripping is disabled. Anybody had something like this before?
Edit:
Ok, the problem persists even when i stripp the onGUI function down to:
void OnGUI () {
GUI.BeginScrollView (scrollPosRect, scrollPos, scrollContentRect);
GUI.EndScrollView();
}
however, when i dont use the ScrollView but use other GUI things there is no problem. Example:
void OnGUI () {
GUI.DrawTexture(scrollContentSize, textureToScroll, ScaleMode.ScaleToFit, true, 0.5f);
}
Unfortunatly this goes down to the most simple stripping methode, so i cannot strip code at all.
Settings were roughly, ARMv6, .net2 subset and stripping: any methode.