示例#1
0
 void Start()
 {
     TestingButton   = GetComponent <VRTK_PhysicsPusher>();
     testingRenderer = transform.Find("TestingCube").GetComponent <MeshRenderer>();
     currentMaterial = 0;
     colorSwitching  = false;
 }
示例#2
0
    void Start()
    {
        OxygenController = GameObject.Find("OxygenDisplays").GetComponent <OxygenControl>();

        //buttons

        GreenButton   = GameObject.Find("BONSAI_ROOM/OxygenPanel/OxygenGreenButton").GetComponentInChildren <VRTK_PhysicsPusher>();
        MagentaButton = GameObject.Find("BONSAI_ROOM/OxygenPanel/OxygenMagentaButton").GetComponentInChildren <VRTK_PhysicsPusher>();
        CyanButton    = GameObject.Find("BONSAI_ROOM/OxygenPanel/OxygenCyanButton").GetComponentInChildren <VRTK_PhysicsPusher>();
        YellowButton  = GameObject.Find("BONSAI_ROOM/OxygenPanel/OxygenYellowButton").GetComponentInChildren <VRTK_PhysicsPusher>();
        RedButton     = GameObject.Find("BONSAI_ROOM/OxygenPanel/OxygenRedButton").GetComponentInChildren <VRTK_PhysicsPusher>();
        BlueButton    = GameObject.Find("BONSAI_ROOM/OxygenPanel/OxygenBlueButton").GetComponentInChildren <VRTK_PhysicsPusher>();

        ClockWiseButton        = GameObject.Find("BONSAI_ROOM/OxygenPanel/OxygenClockWiseButton").GetComponentInChildren <VRTK_PhysicsPusher>();
        CounterClockWiseButton = GameObject.Find("BONSAI_ROOM/OxygenPanel/OxygenCounterClockWiseButton").GetComponentInChildren <VRTK_PhysicsPusher>();

        LampColours = new Color[4];

        //initial oxygen state here
        LampColours[0] = Color.yellow;
        LampColours[1] = Color.red;
        LampColours[2] = Color.green;
        LampColours[3] = Color.blue;

        currentlySelectedLamp = 1;

        //oxygen lamps and colours

        FirstLamp  = GameObject.Find("BONSAI_ROOM/BonsaiLamps/FirstLamp").GetComponent <Light>();
        SecondLamp = GameObject.Find("BONSAI_ROOM/BonsaiLamps/SecondLamp").GetComponent <Light>();
        ThirdLamp  = GameObject.Find("BONSAI_ROOM/BonsaiLamps/ThirdLamp").GetComponent <Light>();
        FourthLamp = GameObject.Find("BONSAI_ROOM/BonsaiLamps/FourthLamp").GetComponent <Light>();


        // shows on the panel on the side which lamp is selected currently

        SelectedLampIndicator = GameObject.Find("BONSAI_ROOM/OxygenPanel/SelectedLampIndicators").GetComponent <Animator>();

        FirstLampBeam  = GameObject.Find("BONSAI_ROOM/OxygenPanel/SelectedLampIndicators/FirstLampBeam").GetComponent <MeshRenderer>().material;
        SecondLampBeam = GameObject.Find("BONSAI_ROOM/OxygenPanel/SelectedLampIndicators/SecondLampBeam").GetComponent <MeshRenderer>().material;
        ThirdLampBeam  = GameObject.Find("BONSAI_ROOM/OxygenPanel/SelectedLampIndicators/ThirdLampBeam").GetComponent <MeshRenderer>().material;
        FourthLampBeam = GameObject.Find("BONSAI_ROOM/OxygenPanel/SelectedLampIndicators/FourthLampBeam").GetComponent <MeshRenderer>().material;

        LampGreen   = GameObject.Find("BONSAI_ROOM/LampColours/LampGreen").GetComponent <MeshRenderer>().material.color;
        LampMagenta = GameObject.Find("BONSAI_ROOM/LampColours/LampMagenta").GetComponent <MeshRenderer>().material.color;
        LampCyan    = GameObject.Find("BONSAI_ROOM/LampColours/LampCyan").GetComponent <MeshRenderer>().material.color;
        LampYellow  = GameObject.Find("BONSAI_ROOM/LampColours/LampYellow").GetComponent <MeshRenderer>().material.color;
        LampRed     = GameObject.Find("BONSAI_ROOM/LampColours/LampRed").GetComponent <MeshRenderer>().material.color;
        LampBlue    = GameObject.Find("BONSAI_ROOM/LampColours/LampBlue").GetComponent <MeshRenderer>().material.color;

        //initialize lamp beams here
        FirstLampBeam.color  = LampYellow;
        SecondLampBeam.color = LampRed;
        ThirdLampBeam.color  = LampGreen;
        FourthLampBeam.color = LampMagenta;

        //booleans

        lampJustChanged = false;
    }
示例#3
0
 private void Awake()
 {
     MarkerResetButton = GetComponentInChildren <VRTK_PhysicsPusher>();
     Marker            = GameObject.Find("Marker");
     ResetLocation     = gameObject.transform.Find("ResetLocation").transform;
     reseted           = false;
     storedSnapZone    = null;
 }
示例#4
0
 protected virtual void Start()
 {
     Button        = GetComponentInChildren <VRTK_PhysicsPusher>();
     open          = false;
     close         = false;
     RotatingJoint = gameObject.transform;
     opened        = false;
     closed        = true;
 }
    void Start()
    {
        OpenBoxSnap = GetComponent <VRTK_SnapDropZone>();
        Marker      = GameObject.Find("Marker");

        MarkerReleaseButton = GameObject.Find("MarkerReleaseButton").GetComponent <VRTK_PhysicsPusher>();

        markerCanSnap = true;
    }
示例#6
0
 void Start()
 {
     shaftlightButton = GetComponent <VRTK_PhysicsPusher>();
     MaintenanceLight = GameObject.Find("MaintenanceSpotLight");
     MaintenanceSpot  = MaintenanceLight.GetComponent <Light>();
     lightOn          = false;
     processing       = false;
     ShaftLightSound  = GetComponent <AudioSource>();
     ScarySound       = GameObject.Find("ScarySound").GetComponent <AudioSource>();
     scared           = false;
 }
 protected virtual void OnEnable()
 {
     buttonEvents = GetComponent <VRTK_PhysicsPusher>();
     if (buttonEvents != null)
     {
         buttonEvents.MaxLimitReached += MaxLimitReached;
     }
     artbuttonEvents = GetComponent <VRTK_ArtificialPusher>();
     if (artbuttonEvents != null)
     {
         artbuttonEvents.MaxLimitReached += MaxLimitReached;
     }
 }
示例#8
0
 protected virtual void SetPositionTarget(VRTK_BaseControllable obj, float newTarget)
 {
     if (obj.GetType() == typeof(VRTK_PhysicsPusher))
     {
         VRTK_PhysicsPusher physicsObj = obj as VRTK_PhysicsPusher;
         physicsObj.positionTarget = newTarget;
     }
     else if (obj.GetType() == typeof(VRTK_ArtificialPusher))
     {
         VRTK_ArtificialPusher artificialObj = obj as VRTK_ArtificialPusher;
         artificialObj.SetPositionTarget(newTarget);
     }
 }
示例#9
0
 protected virtual void SetStayPressed(VRTK_BaseControllable obj, bool state)
 {
     if (obj.GetType() == typeof(VRTK_PhysicsPusher))
     {
         VRTK_PhysicsPusher physicsObj = obj as VRTK_PhysicsPusher;
         physicsObj.stayPressed = state;
     }
     else if (obj.GetType() == typeof(VRTK_ArtificialPusher))
     {
         VRTK_ArtificialPusher artificialObj = obj as VRTK_ArtificialPusher;
         artificialObj.SetStayPressed(state);
     }
 }
示例#10
0
 void Start()
 {
     MiddleShaftButton = GetComponent <VRTK_PhysicsPusher>();
     MiddleHatchAnim   = GameObject.Find("GateMiddle").GetComponent <Animator>();
     notOpen           = true;
 }
示例#11
0
    protected virtual void Start()
    {
        machineryActive = false;

        //MONITOR SCREEN
        MonitorScreen = GameObject.Find("MonitorCanvas/Scrollparent/Viewport/MonitorScreen").GetComponent <TextMeshProUGUI>();

        bar = GameObject.Find("MonitorCanvas/Scrollparent/Scrollbar").GetComponent <Scrollbar>();

        //CONTROL VARIABLES
        buttonBeingPressed = false;

        characterCount = 0;

        addedCharacters = new StringBuilder();

        idle = false;

        //ALPHABET
        A = transform.Find("A_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        B = transform.Find("B_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        C = transform.Find("C_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        D = transform.Find("D_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        E = transform.Find("E_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        F = transform.Find("F_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        G = transform.Find("G_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        H = transform.Find("H_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        I = transform.Find("I_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        J = transform.Find("J_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        K = transform.Find("K_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        L = transform.Find("L_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        M = transform.Find("M_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        N = transform.Find("N_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        O = transform.Find("O_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        P = transform.Find("P_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        Q = transform.Find("Q_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        R = transform.Find("R_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        S = transform.Find("S_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        T = transform.Find("T_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        U = transform.Find("U_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        V = transform.Find("V_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        W = transform.Find("W_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        X = transform.Find("X_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        Y = transform.Find("Y_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        Z = transform.Find("Z_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        Å = transform.Find("Å_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        Ä = transform.Find("Ä_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        Ö = transform.Find("Ö_Container").GetComponentInChildren <VRTK_PhysicsPusher>();


        //CONTROL BUTTONS
        BackSpace = transform.Find("BACKSPACE_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        CapsLock  = transform.Find("CAPSLOCK_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        Enter     = transform.Find("ENTER_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        Space     = transform.Find("SPACE_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        Delete    = transform.Find("DELETE_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        Escape    = transform.Find("ESC_Container").GetComponentInChildren <VRTK_PhysicsPusher>();

        Down = transform.Find("DOWN_Container").GetComponentInChildren <VRTK_PhysicsPusher>();
        Up   = transform.Find("UP_Container").GetComponentInChildren <VRTK_PhysicsPusher>();

        //STARTLINE fixes text lining up correctly
        MonitorScreen.text = "MelterPC_1@DESKTOP-MELT EYE128 /e" + Environment.NewLine + "$" + " ";
    }
示例#12
0
 void Start()
 {
     Lampbutton = GetComponent <VRTK_PhysicsPusher>();
     clicked    = false;
 }
示例#13
0
    void Start()
    {
        ButtonCyan   = GameObject.Find("OctoCyan").GetComponent <MeshRenderer>().material;
        ButtonYellow = GameObject.Find("OctoYellow").GetComponent <MeshRenderer>().material;
        ButtonGreen  = GameObject.Find("OctoGreen").GetComponent <MeshRenderer>().material;
        ButtonRed    = GameObject.Find("OctoRed").GetComponent <MeshRenderer>().material;

        RedLight = transform.Find("RedLight").GetChild(0).GetComponent <VRTK_PhysicsPusher>();
        RedButtonMeshMaterial = transform.Find("RedLight").GetChild(0).GetChild(1).GetComponent <MeshRenderer>();
        RedButtonMeshMaterial.material.EnableKeyword("_EMISSION");
        GreenLight = transform.Find("GreenLight").GetChild(0).GetComponent <VRTK_PhysicsPusher>();
        GreenButtonMeshMaterial = transform.Find("GreenLight").GetChild(0).GetChild(1).GetComponent <MeshRenderer>();
        GreenButtonMeshMaterial.material.EnableKeyword("_EMISSION");
        CyanLight = transform.Find("CyanLight").GetChild(0).GetComponent <VRTK_PhysicsPusher>();
        CyanButtonMeshMaterial = transform.Find("CyanLight").GetChild(0).GetChild(1).GetComponent <MeshRenderer>();
        CyanButtonMeshMaterial.material.EnableKeyword("_EMISSION");
        YellowLight = transform.Find("YellowLight").GetChild(0).GetComponent <VRTK_PhysicsPusher>();
        YellowButtonMeshMaterial = transform.Find("YellowLight").GetChild(0).GetChild(1).GetComponent <MeshRenderer>();
        YellowButtonMeshMaterial.material.EnableKeyword("_EMISSION");
        OctopusAttention = transform.Find("OctopusAttention").GetChild(0).GetComponent <VRTK_PhysicsPusher>();
        OctopusAttentionButtonMeshMaterial = transform.Find("OctopusAttention").GetChild(0).GetChild(1).GetComponent <MeshRenderer>();
        OctopusAttentionButtonMeshMaterial.material.EnableKeyword("_EMISSION");

        combinationNumber     = 0;
        colourCode            = new string[4];
        currentMarkedLocation = null;
        currentTableObject    = null;
        codeEntered           = false;
        buttonRegistering     = false;
        hologramInProgress    = false;
        octoAnimInProgress    = false;
        AttentionLight        = transform.Find("AttentionLight").GetComponent <Light>();
        RedLightSource        = transform.Find("RedLightSource").GetComponent <Light>();
        YellowLightSource     = transform.Find("YellowLightSource").GetComponent <Light>();
        GreenLightSource      = transform.Find("GreenLightSource").GetComponent <Light>();
        CyanLightSource       = transform.Find("CyanLightSource").GetComponent <Light>();
        CodeCube1             = transform.Find("CodeCube1").gameObject;
        CodeCube2             = transform.Find("CodeCube2").gameObject;
        CodeCube3             = transform.Find("CodeCube3").gameObject;
        CodeCube4             = transform.Find("CodeCube4").gameObject;

        Marker = GameObject.Find("Marker");

        OpenBox = GameObject.Find("OpenBox");

        ResearchPool = GameObject.Find("Research_melterpool");

        ConveyorBelt = GameObject.Find("Research_Conveyor_belt");

        Siren = GameObject.Find("Research_siren");

        MagneticFenceContainer = GameObject.Find("MagneticFenceContainer");

        OpenBoxSnapZone1 = OpenBox.transform.Find("OpenBoxSnapZone1").GetComponent <VRTK_SnapDropZone>();
        OpenBoxSnapZone2 = OpenBox.transform.Find("OpenBoxSnapZone2").GetComponent <VRTK_SnapDropZone>();
        OpenBoxSnapZone3 = OpenBox.transform.Find("OpenBoxSnapZone3").GetComponent <VRTK_SnapDropZone>();
        OpenBoxSnapZone4 = OpenBox.transform.Find("OpenBoxSnapZone4").GetComponent <VRTK_SnapDropZone>();

        ConveyorSnapZone1 = ConveyorBelt.transform.Find("ResearchConveyorSnapZone1").GetComponent <VRTK_SnapDropZone>();
        ConveyorSnapZone2 = ConveyorBelt.transform.Find("ResearchConveyorSnapZone2").GetComponent <VRTK_SnapDropZone>();

        MagneticFenceSnapZone = GameObject.Find("MagneticFenceSnapZone").GetComponent <VRTK_SnapDropZone>();

        PoolSnapZone = ResearchPool.transform.Find("ResearchPoolSnapzone").GetComponent <VRTK_SnapDropZone>();

        SirenSnapZone = Siren.transform.Find("SirenSnapzone").GetComponent <VRTK_SnapDropZone>();

        ResearchSnapZoneOpenBox = GameObject.Find("ResearchSnapZoneOpenBox").GetComponent <VRTK_SnapDropZone>();

        ResearchSnapZonePool = GameObject.Find("ResearchSnapZonePool").GetComponent <VRTK_SnapDropZone>();

        ResearchSnapZoneConveyor = GameObject.Find("ResearchSnapZoneConveyor").GetComponent <VRTK_SnapDropZone>();

        ResearchSnapZoneSiren = GameObject.Find("ResearchSnapZoneSiren").GetComponent <VRTK_SnapDropZone>();

        OpenBoxAnim = GameObject.Find("OpenBoxAnimated").GetComponent <Animator>();

        ConveyorAnim = GameObject.Find("Research_Conveyor_Animated").GetComponent <Animator>();

        PoolAnim = GameObject.Find("Research_Pool_Lid_Animated").GetComponent <Animator>();

        SirenAnim = GameObject.Find("Research_siren_Animated").GetComponent <Animator>();

        OctopusAnim = GameObject.Find("OCTOPUS").GetComponent <Animator>();

        YellowButtonSound = transform.Find("YellowLight/YellowButton").GetComponent <AudioSource>();

        RedButtonSound = transform.Find("RedLight/RedButton").GetComponent <AudioSource>();

        CyanButtonSound = transform.Find("CyanLight/CyanButton").GetComponent <AudioSource>();

        GreenButtonSound = transform.Find("GreenLight/GreenButton").GetComponent <AudioSource>();

        OctopusAttentionButtonSound = transform.Find("OctopusAttention/AttentionButton").GetComponent <AudioSource>();

        MarkerAttachSound = Marker.GetComponent <AudioSource>();

        OpenBoxMarkerGhostColliderContainer1 = OpenBox.transform.Find("MarkerGhostCollider1").gameObject;
        OpenBoxMarkerGhostColliderContainer2 = OpenBox.transform.Find("MarkerGhostCollider2").gameObject;
        OpenBoxMarkerGhostColliderContainer3 = OpenBox.transform.Find("MarkerGhostCollider3").gameObject;
        OpenBoxMarkerGhostColliderContainer4 = OpenBox.transform.Find("MarkerGhostCollider4").gameObject;

        ConveyorMarkerGhostCollider1Container = ConveyorBelt.transform.Find("ConveyorMarkerGhostCollider1").gameObject;
        ConveyorMarkerGhostCollider2Container = ConveyorBelt.transform.Find("ConveyorMarkerGhostCollider2").gameObject;

        SirenMarkerGhostColliderContainer = Siren.transform.Find("SirenMarkerGhostCollider").gameObject;

        MelterMarkerGhostColliderContainer = ResearchPool.transform.Find("MelterMarkerGhostCollider").gameObject;

        MagneticFenceMarkerGhostColliderContainer = MagneticFenceSnapZone.transform.Find("MagneticFenceMarkerGhostCollider").gameObject;
    }
示例#14
0
 // Use this for initialization
 void Start()
 {
     pp            = GetComponent <VRTK_PhysicsPusher>();
     previousState = pp.IsResting();
 }
示例#15
0
 void Start()
 {
     OctoDoorbutton = GetComponent <VRTK_PhysicsPusher>();
     doorMoving     = false;
 }