Beispiel #1
0
    public HelpBar(string assetPath)
    {
        background = (Texture2D) Resources.Load(assetPath + "BAR_top_help");

        barHeight = background.height;
        container = ScaledRect.Rect(0, 0, ScaledRect.FullScreenRect.width, barHeight);
        textRect = ScaledRect.Rect(0, 0, ScaledRect.FullScreenRect.width, barHeight);

        textStyle = new GUIStyle();

        HELP_centerMarker = (Texture2D) Resources.Load(assetPath + "HELP_centerMarker");
        HELP_chooseItem = (Texture2D) Resources.Load(assetPath + "HELP_chooseItem");
        HELP_delete = (Texture2D) Resources.Load(assetPath + "HELP_delete");
        HELP_drag = (Texture2D) Resources.Load(assetPath + "HELP_drag");
        //HELP_lock = (Texture2D) Resources.Load(assetPath + "HELP_lock");
        HELP_switchToFreeze = (Texture2D) Resources.Load(assetPath + "HELP_switchToFreeze");

        mi = Camera.mainCamera.GetComponent<MainInterface>();

        jman = Camera.mainCamera.GetComponent<JeffARManager>();
        jman.Locked += () => {Locked = true;};
        jman.Lost += () => {Locked = false;};

        mi.AmountFurniture += (furnCount) => {this.furnCount = furnCount;};

        visible = UserOptions.GetPersistantHelpState();
    }
Beispiel #2
0
    void Start()
    {
        origin = transform.localPosition;
        if(iPhone.generation == iPhoneGeneration.iPad2Gen || iPhone.generation == iPhoneGeneration.iPadMini1Gen || Application.isEditor){
            transform.localScale *= 0.75f;
        }
        depth = Camera.main.WorldToViewportPoint(transform.position).z;

        Jman = Camera.mainCamera.GetComponent<JeffARManager>();

        green = (Texture2D) Resources.Load("UI/Tracker/FEEDBACK_green");
        yellow = (Texture2D) Resources.Load("UI/Tracker/FEEDBACK_yellow");
        red = (Texture2D) Resources.Load("UI/Tracker/FEEDBACK_red");
    }
    // Use this for initialization
    void Start()
    {
        markerScale = new float[]{Marker1Scale, Marker2Scale, Marker3Scale, Marker4Scale};
        if(Startup.GetGeneration() == "iPad2"){
            minX /= 2;
            maxX /= 2;
            minY /= 2;
            maxY /= 2;
            MaxHeightCheck /= 2;
            MaxFurniture = 3;
        }
        menu = GameObject.Find ("PeekARGUIObject").GetComponent<PeekGUI>();
        menu.DeleteBtn += () => {
            mode = Mode.Delete;};
        menu.CancelDelete += () => {mode = Mode.Manip;};
        menu.InfoClick += () => Startup.AddWelcomeScreen();
        menu.ClearBtn += () => DeleteAll();

        camManager = this.GetComponent<JeffARManager>();

        tplane = TouchPlane.GroundPlane(camera);

        camManager.Locked 	+= () => {

            camState = MarkerState.Locked;

        };
        camManager.Lost 	+= () => {

            camState = MarkerState.Lost;
        };
    }
    public CameraControls(string baseAssetPath)
    {
        assetPath = baseAssetPath + assetPath;

        style = new GUIStyle();
        background = (Texture2D) Resources.Load(assetPath + "CLUSTER_small");

         jman = Camera.mainCamera.GetComponent<JeffARManager>();
        jman.Locked += () => {Locked = true;};
        jman.Lost += () => {Locked = false;};

        GUIStyle buttonStyle = new GUIStyle();

        GUIStyle snapStyle = new GUIStyle(buttonStyle);
        snapStyle.normal.background = (Texture2D) Resources.Load(assetPath + "BTN_snapshot_avail");
        snapStyle.active.background = (Texture2D) Resources.Load(assetPath + "BTN_snapshot_active");

        snapshotRect = ScaledRect.Rect(0, 0, snapStyle.normal.background.width,snapStyle.normal.background.height);
        snapshotButton = new Button(snapStyle, snapshotRect);
        snapshotButton.click += () => snapClick();

        GUIStyle freezeStyle = new GUIStyle(buttonStyle);
        freezeStyle.normal.background = (Texture2D) Resources.Load(assetPath + "BTN_freeze_avail");
        freezeStyle.active.background = (Texture2D) Resources.Load(assetPath + "BTN_freeze_active");

        GUIStyle freezeToggleStyle = new GUIStyle(buttonStyle);
        freezeToggleStyle.normal.background = (Texture2D) Resources.Load(assetPath + "BTN_freeze_active");
        freezeToggleStyle.active.background = (Texture2D) Resources.Load(assetPath + "BTN_freeze_active");

        freezeRect = ScaledRect.Rect(0,snapStyle.normal.background.height,freezeStyle.normal.background.width,freezeStyle.normal.background.height);

        freezeButton = new Button(freezeStyle, freezeToggleStyle, freezeRect);
        freezeButton.click += () => freezeModeClick();

        GUIStyle liveStyle = new GUIStyle(buttonStyle);
        liveStyle.normal.background = (Texture2D) Resources.Load(assetPath + "BTN_live_avail");
        liveStyle.active.background = (Texture2D) Resources.Load(assetPath + "BTN_live_active");

        GUIStyle liveToggleStyle = new GUIStyle(buttonStyle);
        liveToggleStyle.normal.background = (Texture2D) Resources.Load(assetPath + "BTN_live_active");
        liveToggleStyle.active.background = (Texture2D) Resources.Load(assetPath + "BTN_live_active");

        liveRect = ScaledRect.Rect(0, snapStyle.normal.background.height + freezeStyle.normal.background.height, liveStyle.normal.background.width,liveStyle.normal.background.height);
        liveButton = new Button(liveStyle, liveToggleStyle, liveRect);
        liveButton.click += () => liveModeClick();

        liveButton.toggled = true;

        freezeLabel =  (Texture2D) Resources.Load(assetPath + "STATE_freezeEnabled");
        liveLabel =  (Texture2D) Resources.Load(assetPath + "STATE_liveEnabled");

        labelRect = ScaledRect.Rect(35, snapStyle.normal.background.height + freezeStyle.normal.background.height + (liveStyle.normal.background.height), freezeLabel.width, freezeLabel.height);
        //labelRect = ScaledRect.Rect(0, 0, freezeLabel.width, freezeLabel.height);

        trackerLabelRedTex = (Texture2D) Resources.Load(assetPath + "FEEDBACK_red_text");
        trackerLabelYellowTex = (Texture2D) Resources.Load(assetPath + "FEEDBACK_yellow_text");
        trackerLabelGreenTex = (Texture2D) Resources.Load(assetPath + "FEEDBACK_green_text");

        trackerLabelRect = ScaledRect.Rect((ScaledRect.FullScreenRect.width/2) - 275, snapStyle.normal.background.height + freezeStyle.normal.background.height + (liveStyle.normal.background.height), trackerLabelRedTex.width, trackerLabelRedTex.height);

        containerRect = ScaledRect.Rect(73, 900, ScaledRect.FullScreenRect.width, snapStyle.normal.background.height + freezeStyle.normal.background.height + liveStyle.normal.background.height + liveLabel.height);

        backgroundRect = ScaledRect.Rect(0, 0, background.width, background.height);

        checkRect = ScaledRect.Rect(0, 1536 - (liveStyle.normal.background.height * 3), freezeLabel.width, liveStyle.normal.background.height * 3);
    }