コード例 #1
0
    public void eventManage()
    {
        if (Input.GetMouseButtonDown(0))
        {
            Ray        ray;
            RaycastHit hit;
            if (Character.cam == Character.Cameras.FPPcamera)
            {
                ray = fpp.ScreenPointToRay(Input.mousePosition);
            }
            else
            {
                ray = tpp.ScreenPointToRay(Input.mousePosition);
            }
            if (Physics.Raycast(ray, out hit))
            {
                string Ename = hit.collider.name;
                Debug.LogError(Ename);
                if (Ename.Equals("d1") || Ename.Equals("d2") || Ename.Equals("d3") || Ename.Equals("d4") || Ename.Equals("d5") || Ename.Equals("d6"))
                {
                    Desk(hit);
                }
                else if (Ename.Equals("R3D"))
                {
                    Door();
                }
                else if (Ename.Equals("g1") || Ename.Equals("g2") || Ename.Equals("g3") || Ename.Equals("g4") || Ename.Equals("g5") ||
                         Ename.Equals("g6") || Ename.Equals("g7") || Ename.Equals("g8") || Ename.Equals("g9") || Ename.Equals("key3"))
                {
                    Bedside_table(hit);
                }
                else if (Ename.Equals("1") || Ename.Equals("2") || Ename.Equals("3") || Ename.Equals("4") || Ename.Equals("5") ||
                         Ename.Equals("6") || Ename.Equals("7") || Ename.Equals("8") || Ename.Equals("9") || Ename.Equals("reset"))
                {
                    ps = Room1.Code(hit, "946846", color, ps, bubl, show, isLocked, white, red, green);
                }
                else if (Ename.Equals("candle1") || Ename.Equals("candle2") || Ename.Equals("candle3"))
                {
                    Candle(hit);
                }
                else if (Ename.Equals("s1") || Ename.Equals("s2") || Ename.Equals("s3") || Ename.Equals("s4"))
                {
                    Bookcase(hit);
                }
                else if (Ename.Equals("Hint3"))
                {
                    Character.Items.Add("hint3");
                    hint3.SetActive(false);
                    b2.gameObject.GetComponent <Image>().sprite = i2;

                    inf.GetComponent <Text>().text = "you get hint3.";
                    StartCoroutine(clean());;
                }
                else if (Ename.Equals("switch"))
                {
                    top_on = Room1.Switch(Top, top_on);
                }
            }
        }
    }
コード例 #2
0
    public void eventManage()
    {
        if (Input.GetMouseButtonDown(0))
        {
            Ray        ray;
            RaycastHit hit;
            if (Character.cam == Character.Cameras.FPPcamera)
            {
                ray = fpp.ScreenPointToRay(Input.mousePosition);
            }
            else
            {
                ray = tpp.ScreenPointToRay(Input.mousePosition);
            }
            if (Physics.Raycast(ray, out hit))
            {
                string Ename = hit.collider.name;
                Debug.LogError(Ename);
                if (Ename.Equals("l1") || Ename.Equals("l2") || Ename.Equals("l3") || Ename.Equals("L1") || Ename.Equals("L2") || Ename.Equals("L3"))
                {
                    trash_can(hit);
                }
                else if (Ename.Equals("R4D"))
                {
                    Door();
                }
                else if (Ename.Equals("d11") || Ename.Equals("d12") || Ename.Equals("d13") || Ename.Equals("d21") || Ename.Equals("d22") ||
                         Ename.Equals("d23") || Ename.Equals("d31") || Ename.Equals("d32") || Ename.Equals("d33"))
                {
                    Desk(hit);
                }
                else if (Ename.Equals("1") || Ename.Equals("2") || Ename.Equals("3") || Ename.Equals("4") || Ename.Equals("5") ||
                         Ename.Equals("6") || Ename.Equals("7") || Ename.Equals("8") || Ename.Equals("9") || Ename.Equals("reset"))
                {
                    ps = Room1.Code(hit, "311592", color, ps, bubl, show, isLocked, white, red, green);
                }
                else if (Ename.Equals("lamp1") || Ename.Equals("lamp2") || Ename.Equals("lamp3"))
                {
                    Lamp(hit);
                }
                else if (Ename.Equals("s1") || Ename.Equals("s2") || Ename.Equals("s3") || Ename.Equals("s4") || Ename.Equals("s5") || Ename.Equals("s6"))
                {
                    Bookcase(hit);
                }
                else if (Ename.Equals("Hint4"))
                {
                    Character.Items.Add("hint4");
                    hint4.SetActive(false);
                    b2.gameObject.GetComponent <Image>().sprite = i2;

                    inf.GetComponent <Text>().text = "you get hint1.";
                    StartCoroutine(clean());
                }
                else if (Ename.Equals("switch"))
                {
                    top_on = Room1.Switch(Top, top_on);
                }
                else if (Ename.Equals("r4key1") || Ename.Equals("r4key2") || Ename.Equals("r4key3"))
                {
                    BookCaseKey(hit);
                }
                else if (Ename.Equals("pig"))
                {
                    Pig();
                }
                else if (Ename.Equals("key4"))
                {
                    Character.Items.Add("key4");
                    Destroy(key4);
                    b1.gameObject.GetComponent <Image>().sprite = i1;

                    inf.GetComponent <Text>().text = "you get key2.";
                    StartCoroutine(clean());
                }
            }
        }
    }
コード例 #3
0
ファイル: Room2.cs プロジェクト: BelialJXK/Room-escape
    public void eventManage()
    {
        if (Input.GetMouseButtonDown(0))
        {
            Ray        ray;
            RaycastHit hit;
            if (Character.cam == Character.Cameras.FPPcamera)
            {
                ray = fpp.ScreenPointToRay(Input.mousePosition);
            }
            else
            {
                ray = tpp.ScreenPointToRay(Input.mousePosition);
            }
            if (Physics.Raycast(ray, out hit))
            {
                string Ename = hit.collider.name;
                Debug.LogError(Ename);
                if (Ename.Equals("R2D"))
                {
                    Door();
                }
                else if (Ename.Equals("1") || Ename.Equals("2") || Ename.Equals("3") || Ename.Equals("4") || Ename.Equals("5") ||
                         Ename.Equals("6") || Ename.Equals("7") || Ename.Equals("8") || Ename.Equals("9") || Ename.Equals("reset"))
                {
                    ps = Room1.Code(hit, "251715", color, ps, bubl, show, isLocked, white, red, green);
                }
                else if (Ename.Equals("Hint2"))
                {
                    Character.Items.Add("hint2");
                    hint2.SetActive(false);
                    b2.gameObject.GetComponent <Image>().sprite = i2;

                    inf.GetComponent <Text>().text = "you get hint2.";
                    StartCoroutine(clean());;
                }
                else if (Ename.Equals("switch"))
                {
                    top_on = Room1.Switch(Top, top_on);
                }
                else if (Ename.Equals("key2"))
                {
                    Character.Items.Add("key2");
                    Destroy(key2);
                    b1.gameObject.GetComponent <Image>().sprite = i1;

                    inf.GetComponent <Text>().text = "you get key2.";
                    StartCoroutine(clean());
                }
                else if (Ename.Equals("casekey"))
                {
                    casekey.SetActive(false);
                    casekey.transform.localPosition = new Vector3(0.3293f, -0.061f, 0.01f);
                    casekey.transform.Rotate(new Vector3(0, -30f, 0));
                    casekey1 = true;

                    inf.GetComponent <Text>().text = "you get case key.";
                    StartCoroutine(clean());
                }
                else if (Ename.Equals("projectorL") || Ename.Equals("projectorR") || Ename.Equals("projectorM"))
                {
                    Projector(hit);
                }
                else if (Ename.Equals("B1") || Ename.Equals("B2") || Ename.Equals("B3") || Ename.Equals("B4") || Ename.Equals("B5") ||
                         Ename.Equals("B6") || Ename.Equals("B7") || Ename.Equals("B8") || Ename.Equals("B9") || Ename.Equals("B10") ||
                         Ename.Equals("B11") || Ename.Equals("B12") || Ename.Equals("T1") || Ename.Equals("T2") || Ename.Equals("T3") ||
                         Ename.Equals("T4") || Ename.Equals("T5") || Ename.Equals("T6") || Ename.Equals("T7") || Ename.Equals("T8") ||
                         Ename.Equals("T9") || Ename.Equals("T10") || Ename.Equals("T11") || Ename.Equals("T12"))
                {
                    Box(hit);
                }
                else if (Ename.Equals("s1") || Ename.Equals("s2"))
                {
                    Bookcase(hit);
                }
                else if (Ename.Equals("r1") || Ename.Equals("r2") || Ename.Equals("l1") || Ename.Equals("l2") || Ename.Equals("m"))
                {
                    Desk(hit);
                }
                else if (Ename.Equals("lamp1") || Ename.Equals("lamp2") || Ename.Equals("lamp3"))
                {
                    Lamp(hit);
                }
                else if (Ename.Equals("book"))
                {
                    Book();
                }
                else if (Ename.Equals("e1") || Ename.Equals("e2") || Ename.Equals("e3") || Ename.Equals("e4") || Ename.Equals("e5") ||
                         Ename.Equals("e6"))
                {
                    Outkey(hit);
                }
                else if (Ename.Equals("out"))
                {
                    Exit();
                }
            }
        }
    }
コード例 #4
0
    public void eventManage()
    {
        if (Input.GetMouseButtonDown(0))
        {
            Ray        ray;
            RaycastHit hit;

            if (Character.cam == Character.Cameras.FPPcamera)
            {
                ray = fpp.ScreenPointToRay(Input.mousePosition);
            }
            else
            {
                ray = tpp.ScreenPointToRay(Input.mousePosition);
            }

            if (Physics.Raycast(ray, out hit))
            {
                string Ename = hit.collider.name;
                Debug.LogError(Ename);
                if (Ename.Equals("R5D"))
                {
                    Door();
                }
                else if (Ename.Equals("1") || Ename.Equals("2") || Ename.Equals("3") || Ename.Equals("4") || Ename.Equals("5") ||
                         Ename.Equals("6") || Ename.Equals("7") || Ename.Equals("8") || Ename.Equals("9") || Ename.Equals("reset"))
                {
                    ps = Room1.Code(hit, "317469", color, ps, bubl, show, isLocked, white, red, green);
                }
                else if (Ename.Equals("Hint5"))
                {
                    Character.Items.Add("hint5");
                    hint5.SetActive(false);
                    b2.gameObject.GetComponent <Image>().sprite = i2;

                    inf.GetComponent <Text>().text = "you get hint5.";
                    StartCoroutine(clean());
                }
                else if (Ename.Equals("switch"))
                {
                    top_on = Room1.Switch(Top, top_on);
                }
                else if (Ename.Equals("key5"))
                {
                    Character.Items.Add("key5");
                    Destroy(key5);
                    b1.gameObject.GetComponent <Image>().sprite = i1;

                    inf.GetComponent <Text>().text = "you get key5.";
                    StartCoroutine(clean());
                }
                else if (Ename.Equals("11") || Ename.Equals("22") || Ename.Equals("33") || Ename.Equals("44") || Ename.Equals("55") ||
                         Ename.Equals("66") || Ename.Equals("77") || Ename.Equals("88") || Ename.Equals("99") || Ename.Equals("reset1") || Ename.Equals("0"))
                {
                    ps1 = Room1.Code(hit, "180310", color1, ps1, bubl1, show1, isLockedBox, white1, red1, green);
                }
                else if (Ename.Equals("monster1") || Ename.Equals("monster2") || Ename.Equals("bear") || Ename.Equals("pumpkin"))
                {
                    Monster(hit);
                }
                else if (Ename.Equals("projector"))
                {
                    projector();
                }
            }
        }
    }
コード例 #5
0
ファイル: Room6.cs プロジェクト: BelialJXK/Room-escape
    public void eventManage()
    {
        if (Input.GetMouseButtonDown(0))
        {
            Ray        ray;
            RaycastHit hit;
            if (Character.cam == Character.Cameras.FPPcamera)
            {
                ray = fpp.ScreenPointToRay(Input.mousePosition);
            }
            else
            {
                ray = tpp.ScreenPointToRay(Input.mousePosition);
            }
            if (Physics.Raycast(ray, out hit))
            {
                string Ename = hit.collider.name;
                Debug.LogError(Ename);
                if (Ename.Equals("LeftDoor") || Ename.Equals("RightDoor") || Ename.Equals("Bottom") || Ename.Equals("key6"))
                {
                    Wardrobe(hit);
                }
                else if (Ename.Equals("purpleLamp"))
                {
                    Character.Items.Add("purpleLamp");
                    Destroy(purple_lamp);

                    b3.gameObject.GetComponent <Image>().sprite = i3;

                    inf.GetComponent <Text>().text = "you get purple bulb.";
                    StartCoroutine(clean());
                }
                else if (Ename.Equals("R6D"))
                {
                    Door();
                }
                else if (Ename.Equals("p1") || Ename.Equals("p2") || Ename.Equals("p3") || Ename.Equals("p4") || Ename.Equals("p5") ||
                         Ename.Equals("p6") || Ename.Equals("p7") || Ename.Equals("p8") || Ename.Equals("p9") || Ename.Equals("p10") ||
                         Ename.Equals("p11") || Ename.Equals("p12"))
                {
                    Photo(hit);
                }
                else if (Ename.Equals("1") || Ename.Equals("2") || Ename.Equals("3") || Ename.Equals("4") || Ename.Equals("5") ||
                         Ename.Equals("6") || Ename.Equals("7") || Ename.Equals("8") || Ename.Equals("9") || Ename.Equals("reset"))
                {
                    ps = Room1.Code(hit, "159", color, ps, bubl, show, isLocked, white, red, green);
                }
                else if (Ename.Equals("R1") || Ename.Equals("R2") || Ename.Equals("R3") || Ename.Equals("L"))
                {
                    Desk(hit);
                }
                else if (Ename.Equals("LampR") || Ename.Equals("LampL"))
                {
                    Lamp(hit);
                }
                else if (Ename.Equals("cushion") || Ename.Equals("s1") || Ename.Equals("s2") || Ename.Equals("s3") || Ename.Equals("s4"))
                {
                    Cushion(hit);
                }
                else if (Ename.Equals("Hint6"))
                {
                    Character.Items.Add("hint6");
                    hint6.SetActive(false);
                    b2.gameObject.GetComponent <Image>().sprite = i2;

                    inf.GetComponent <Text>().text = "you get hint6.";
                    StartCoroutine(clean());
                }
                else if (Ename.Equals("switch"))
                {
                    top_on = Room1.Switch(Top, top_on);
                }
            }
        }
    }