Exemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     Sat_V2 = GameObject.Find("Sat_V2");
     sw_obj = GameObject.Find("swap_object_support").GetComponent <swapObject>();
 }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        // Move pointer (Finger indicator)

        GameObject           Test_button = GameObject.Find("Test_button");
        test_camera_image_V2 test_camera_image_V2_script = Test_button.GetComponent <test_camera_image_V2>();

        Vector3 coord = test_camera_image_V2_script.cameraToWorldCoord(x_coord + 30, y_coord - 40);

        GameObject finger_indicator = GameObject.Find("Finger Indicator");

        finger_indicator.transform.position = coord;

        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        // Detect action

        if (Globals.action)
        {
            sw_obj = GameObject.Find("swap_object_support").GetComponent <swapObject>();

            if (Globals.select_engine && Globals.inside_engine == false)
            {
                // Select the object to swap (Saturn V and F1 Engine)
                GameObject Sat_V     = GameObject.Find("Sat_V2");
                GameObject F1_engine = GameObject.Find("Engine");

                // Swap object
                sw_obj.swap(Sat_V, F1_engine);

                Globals.inside_engine = true;
                removeButton();
            }
            else if (Globals.select_payload && Globals.inside_payload == false)
            {
                Globals.inside_payload = true;
                GameObject.Find("Back_button").transform.position = new Vector3(-718, 345, 1977.315f);

                sw_obj.swap(GameObject.Find("Payload_button"), GameObject.Find("LEM_button"));
                sw_obj.swap(GameObject.Find("Engine_button"), GameObject.Find("Skylab_button"));
            }
            else if (Globals.select_LEM && Globals.inside_payload)
            {
                // Select the object to swap (Saturn V and LEM)
                GameObject Sat_V = GameObject.Find("Sat_V2");
                GameObject LEM   = GameObject.Find("LEM");

                // Swap object
                sw_obj.swap(Sat_V, LEM);

                Globals.inside_LEM = true;
                removeButton();
            }
            else if (Globals.select_skylab && Globals.inside_payload)
            {
                // Select the object to swap (Saturn V and Skylab)
                GameObject Sat_V  = GameObject.Find("Sat_V2");
                GameObject Skylab = GameObject.Find("Skylab");

                // Swap object
                sw_obj.swap(Sat_V, Skylab);

                Globals.inside_skylab = true;
                removeButton();
            }

            Globals.action = false;
        }
    }