Esempio n. 1
0
    public VuforiaManager(Shader shader)
    {
        instance    = this;
        this.shader = shader;

        VuforiaBehaviour vb = VuforiaBehaviour.Instance;

        vb.StartEvent     += Vb_StartEvent;
        vb.OnEnableEvent  += Vb_OnEnableEvent;
        vb.OnDisableEvent += Vb_OnDisableEvent;
    }
Esempio n. 2
0
    //private Orientation orientation = Orientation.LANDSCAPE_LEFT;
    //private Orientation orientation = Orientation.LANDSCAPE_RIGHT;

    // Use this for initialization
    IEnumerator Start()
    {
        instance = this;
        manager  = new VuforiaManager(shader);
        material = new Material(shader);

        // Yield until CoroutineManager is instantiated.
        yield return(gameObject.AddComponent <CoroutineManager>());

        // Load styles.

        // TODO: Handle a lack of wifi gracefully.
        // TODO: Speed up app loading overall (compress files?).
        // TODO: FORCE RELOAD!!
        ILoader             iLoader   = ServiceLocator.getILoader();
        Reference <JObject> styleText = iLoader.getReference <JObject>(CachedLoader.SERVER_PATH + "style.json");

        yield return(iLoader.reloadCoroutine(styleText));

        JObject json = styleText.getResource();

        ServiceLocator.getILog().print(LogType.IO, "Setting styles... ");
        CrhcConstants.FONT_HEIGHT_NORMAL.set(json.Value <float>("FONT_NORMAL_HEIGHT"), NumberType.INCHES);
        CrhcConstants.FONT_HEIGHT_TITLE.set(json.Value <float>("FONT_TITLE_HEIGHT"), NumberType.INCHES);
        CrhcConstants.FONT_HEIGHT_SUBTITLE.set(json.Value <float>("FONT_SUBTITLE_HEIGHT"), NumberType.INCHES);
        CrhcConstants.FONT_HEIGHT_SOURCE.set(json.Value <float>("FONT_SOURCE_HEIGHT"), NumberType.INCHES);

        CrhcConstants.SIZE_BACK_BUTTON.set(json.Value <float>("BACK_BUTTON_SIZE"), NumberType.INCHES);
        CrhcConstants.SIZE_HOME_BUTTON.set(json.Value <float>("MAIN_BUTTON_SIZE"), NumberType.INCHES);

        CrhcConstants.SIZE_VUFORIA_FRAME.set(json.Value <float>("VUFORIA_FRAME_SIZE"), NumberType.INCHES);
        ServiceLocator.getILog().println(LogType.IO, "OK!");

        styleText.removeOwner();

        server = new Server(CachedLoader.SERVER_PATH);
        server.loadTarget("african_american_landmark_tour");
    }
Esempio n. 3
0
 void Awake()
 {
     Instance = this;
 }