コード例 #1
0
ファイル: MenuManager.cs プロジェクト: unica-tesi-hci/holopit
    // Use this for initialization
    void Start()
    {
        menu             = GameObject.FindWithTag("Menu").gameObject;
        menuScaleOptions = GameObject.FindWithTag("MenuScaleOptions").gameObject;
        menu.SetActive(false);
        menuScaleOptions.SetActive(false);

        menuTitle                 = GameObject.FindWithTag("MenuTitle").GetComponent <TextMesh>();
        menuTitleRenderer         = menuTitle.gameObject.GetComponent <MeshRenderer>();
        menuTitle.text            = "Menu";
        menuTitle.color           = Color.white;
        menuTitleRenderer.enabled = false;

        menuTitle.transform.SetParent(menu.transform, false);

        cockpit            = GameObject.FindWithTag("Cockpit").gameObject;
        deck               = GameObject.FindWithTag("Deck");
        panel              = GameObject.FindWithTag("Panel");
        directionIndicator = GameObject.FindWithTag("DirectionalIndicator");
        markerRing         = GameObject.FindWithTag("MarkerRing").GetComponent <MarkerRing>();
        contBox            = GameObject.FindWithTag("ContainerBox").GetComponent <ContainerBox>();
        feed               = GameObject.FindWithTag("FeedbackHolograms").GetComponent <FeedbackHolograms>();
        displayText        = GameObject.FindWithTag("Text");
        boxScaling         = cockpit.GetComponent <BoxScaling>();

        isPlacing  = false;
        isScaling  = false;
        isRotating = false;
        isRemoving = false;
    }
コード例 #2
0
ファイル: TapToPlace.cs プロジェクト: unica-tesi-hci/holopit
    protected virtual void Start()
    {
        if (PlaceParentOnTap)
        {
            ParentGameObjectToPlace = GetParentToPlace();
            PlaceParentOnTap        = ParentGameObjectToPlace != null;
        }

        interpolator = EnsureInterpolator();

        if (IsBeingPlaced)
        {
            StartPlacing();
        }
        else // If we are not starting out with actively placing the object, give it a World Anchor
        {
            AttachWorldAnchor();
        }

        markerRing = GameObject.FindWithTag("MarkerRing").GetComponent <MarkerRing>();
        contBox    = GameObject.FindWithTag("ContainerBox").GetComponent <ContainerBox>();
        feed       = GameObject.FindWithTag("FeedbackHolograms").GetComponent <FeedbackHolograms>();
    }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     markerRing = GameObject.FindWithTag("MarkerRing").GetComponent <MarkerRing>();
     contBox    = GameObject.FindWithTag("ContainerBox").GetComponent <ContainerBox>();
     feed       = GameObject.FindWithTag("FeedbackHolograms").GetComponent <FeedbackHolograms>();
 }
コード例 #4
0
    private void Start()
    {
        sequence = new List <string>
        {
            "EXT_PWR_ON",
            "BAT_ON",
            "APU_MASTER_ON",
            "APU_START_ON",
            "APU_GEN_ON",
            "EXT_PWR_OFF",
            "APU_BLEED_ON",
            "PUMPS_ON",
            "ENG_SWITCH_START",
            "ENG_ON",
            "ENG_LOAD",
            "ENG_SWITCH_NORM",
            "GENERATOR_ON",
            "APU_BLEED_OFF",
            "PACK_ON",
            "APU_OFF",
            "BRAKE_RELEASE",
            "AUTOBRAKE_MAX",
            "SPOILER_ARM",
            "FLAPS",
            "PACK_OFF",
            "THROTTLE_FULL",
            "ACCELERATION",
            "TAKEOFF",
            "GEAR_OFF",
            "VELOCITY",
            "SPOILER_DISARM_AND_FLAPS",
            "VELOCITY2",
            "FLAPS2",
            "END"
        };

        sequenceIndex = 0;
        flag          = true;
        nextTask      = false;

        DirectionalIndicator = GameObject.FindWithTag("DirectionalIndicator");
        MarkerRing           = GameObject.FindWithTag("MarkerRing");
        ContainerBox         = GameObject.FindWithTag("ContainerBox");
        FeedbackHolograms    = GameObject.FindWithTag("FeedbackHolograms");
        if (DirectionalIndicator != null && MarkerRing != null && FeedbackHolograms != null)
        {
            dirInd   = DirectionalIndicator.GetComponent <HeadsUpDirectionIndicator>();
            markRing = MarkerRing.GetComponent <MarkerRing>();
            contBox  = ContainerBox.GetComponent <ContainerBox>();
            feed     = FeedbackHolograms.GetComponent <FeedbackHolograms>();
        }
        if (dirInd == null || markRing == null || contBox == null || feed == null)
        {
            Debug.Log("Cannot find 'HeadsUpDirectionIndicator', 'MarkerRing', 'ContainerBox' and/or 'FeedbackHolograms' scripts.");
        }

        GameObject audioManager = GameObject.FindWithTag("AudioManager");

        if (audioManager != null)
        {
            textToSpeech = audioManager.GetComponent <TextToSpeechManager>();
        }
        if (textToSpeech != null)
        {
            textToSpeech.Voice = TextToSpeechVoice.Default;
            textToSpeech.SpeakText("Welcome aboard the Airbus A320!");
        }
        else
        {
            Debug.Log("Cannot find TextToSpeechManager script.");
        }
        billboardText = GameObject.FindWithTag("AdviceText").GetComponent <Billboard>();

        FileDataReader.Instance.LoadObjectsProperties();

        Invoke("updateComponents", 3);
    }