Beispiel #1
0
 public void Bounds()
 {
     foreach (IOctreeObject item in ContainedObjects)
     {
         ContainerBox.Merge(item.GetOctreeBounds());
     }
 }
Beispiel #2
0
    // 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;
    }
Beispiel #3
0
    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>();
    }
Beispiel #4
0
 // Use this for initialization
 void Awake()
 {
     contBox = GameObject.FindWithTag("ContainerBox").GetComponent <ContainerBox>();
 }
Beispiel #5
0
    public void SaveObjectsProperties()
    {
        Vector3 position;
        Vector3 rotation;
        Vector3 scale;

        string[]            parameter;
        string[]            dataType;
        string[]            path;
        string[]            interaction;
        double[][]          possible_values;
        string[]            IO_Data;
        NewParameterManager newParameterManager;
        int i = 0;

        file = new JsonSaveObject();

        foreach (Transform component in cockpit.GetComponentsInChildren <Transform>())
        {
            newParameterManager = component.gameObject.GetComponent <NewParameterManager>();

            if (newParameterManager != null)
            {
                position        = component.position;
                rotation        = component.rotation.eulerAngles;
                scale           = component.localScale;
                parameter       = newParameterManager.getIDAsString();
                dataType        = newParameterManager.getDataType();
                path            = newParameterManager.getPath();
                interaction     = newParameterManager.getInteraction();
                possible_values = newParameterManager.getPossibleValues();
                IO_Data         = newParameterManager.getIOData();

                file.components.Add(new Cockpit_Component_Json(cockpit_components[i], position, rotation, scale, parameter, dataType, path, interaction, possible_values, IO_Data));
                ++i;
            }
        }

        List <FeedbackGroup> sequences = InputSequence.Instance.GetSequenceObjects();

        foreach (FeedbackGroup feed_grp in sequences)
        {
            file.feedback_group.Add(feed_grp);
        }

        ContainerBox contBox = GameObject.FindWithTag("ContainerBox").GetComponent <ContainerBox>();
        int          len     = InputSequence.Instance.getSeqLength();

        if (!contBox.BoxFromFileExists())
        {
            contBox.InitializeBoxFromFile();
        }

        Container_Box_Json[] boxFromFile = contBox.getBoxFromFile();

        for (i = 0; i < len; i++)
        {
            file.boxes.Add(boxFromFile[i]);
        }

#if !UNITY_EDITOR
        Save();
#else
        SaveUnity();
#endif

        TextManager.Instance.ShowMenuTipText("Save complete.");
    }
Beispiel #6
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>();
 }
Beispiel #7
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);
    }