コード例 #1
0
ファイル: Room2.cs プロジェクト: BelialJXK/Room-escape
    private void Desk(RaycastHit hit)
    {
        switch (hit.collider.name)
        {
        case "r1":
            r1.transform.localPosition = new Vector3(0.7785438f, -0.04612518f, -0.45f);
            StartCoroutine(Room1.Position(3.0f, r1, new Vector3(0.7785438f, -0.04612518f, -0.2429063f)));
            break;

        case "r2":
            r2.transform.localPosition = new Vector3(0.7785438f, -0.1423045f, -0.45f);
            StartCoroutine(Room1.Position(3.0f, r2, new Vector3(0.7785438f, -0.1423045f, -0.2429063f)));
            break;

        case "l1":
            l1.transform.localPosition = new Vector3(0.02821602f, -0.04612518f, -0.45f);
            StartCoroutine(Room1.Position(3.0f, l1, new Vector3(0.02821602f, -0.1423045f, -0.2429063f)));
            break;

        case "l2":
            l2.transform.localPosition = new Vector3(0.02821602f, -0.1423045f, -0.45f);
            StartCoroutine(Room1.Position(3.0f, l2, new Vector3(0.02821602f, -0.1423045f, -0.2429063f)));
            break;

        case "m":
            m.transform.localPosition = new Vector3(0.4033799f, -0.04612518f, -0.45f);
            StartCoroutine(Room1.Position(3.0f, m, new Vector3(0.4033799f, -0.04612518f, -0.2429063f)));
            break;
        }
    }
コード例 #2
0
ファイル: Room6.cs プロジェクト: BelialJXK/Room-escape
    private void Desk(RaycastHit hit)
    {
        switch (hit.collider.name)
        {
        case "L":
            L.transform.localPosition = new Vector3(0.308f, 0.7983999f, 0.8f);
            StartCoroutine(Room1.Position(4.0f, L, new Vector3(0.308f, 0.7983999f, 0.4344f)));
            break;

        case "R1":
            R1.transform.localPosition = new Vector3(-0.4864f, 0.8023999f, 0.8f);
            StartCoroutine(Room1.Position(4.0f, R1, new Vector3(-0.4864f, 0.8023999f, 0.4344f)));
            break;

        case "R2":
            R2.transform.localPosition = new Vector3(-0.4864f, 0.5743999f, 0.8f);
            StartCoroutine(Room1.Position(4.0f, R2, new Vector3(-0.4864f, 0.5743999f, 0.4344f)));
            break;

        case "R3":
            R3.transform.localPosition = new Vector3(-0.4864f, 0.3104f, 0.8f);
            StartCoroutine(Room1.Position(4.0f, R3, new Vector3(-0.4864f, 0.3104f, 0.4344f)));
            break;
        }
    }
コード例 #3
0
    private void trash_can(RaycastHit hit)
    {
        switch (hit.collider.name)
        {
        case "L1":
            L1.transform.Rotate(new Vector3(0, 180f, 0));
            StartCoroutine(Center.Rotation(5.0f, L1, new Vector3(0, -180f, 0)));
            l_1.transform.localPosition = new Vector3(1f, -0.3f, 0);
            StartCoroutine(Room1.Position(4.0f, l_1, new Vector3(0, 0.4736f, 0)));
            break;

        case "L2":
            L2.transform.Rotate(new Vector3(0, 180f, 0));
            StartCoroutine(Center.Rotation(5.0f, L2, new Vector3(0, -180f, 0)));
            l_2.transform.localPosition = new Vector3(1f, -0.3f, 0);
            StartCoroutine(Room1.Position(4.0f, l_2, new Vector3(0, 0.4736f, 0)));
            break;

        case "L3":
            L3.transform.Rotate(new Vector3(0, 180f, 0));
            StartCoroutine(Center.Rotation(5.0f, L3, new Vector3(0, -180f, 0)));
            l_3.transform.localPosition = new Vector3(1f, -0.3f, 0);
            StartCoroutine(Room1.Position(4.0f, l_3, new Vector3(0, 0.4736f, 0)));
            break;
        }
    }
コード例 #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("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);
                }
            }
        }
    }
コード例 #5
0
        public List <Room1> ReadRoomsFromID(int id)
        {
            List <Room1> rooms = new List <Room1>();

            if (connect.State == ConnectionState.Open)
            {
                command = new SqlCommand("Select * from Constraintt where constraint_id ='" + id + "'", connect);
                try
                {
                    reader = command.ExecuteReader();
                    while (reader.Read())
                    {
                        Room1 room = new Room1();

                        room.@ref = reader[3].ToString();

                        rooms.Add(room);
                    }
                    reader.Close();
                }
                catch (Exception)
                {
                    reader.Close();
                }
            }

            return(rooms);
        }
コード例 #6
0
    public override State Update()
    {
        IceSlime2AI iceSlime2AI = (IceSlime2AI)GetAI();
        IceSlime2   iceSlime2   = (IceSlime2)iceSlime2AI.getCharacter();
        GameObject  myBody      = iceSlime2.GetGameObject();
        float       distance    = Vector3.Distance(myBody.transform.position, iceSlime2.currentTarget.transform.position);

        //如果有目标在视野内,则移动向目标,直到可以攻击到目标
        if (distance < iceSlime2.getAttr().getAttackRange())
        {
            myBody.GetComponent <Rigidbody2D>().velocity = Vector3.zero;
            return(State.SUCESSED);
        }

        Room1 room = (Room1)myBody.GetComponentInParent(typeof(Room1));
        float dx   = myBody.transform.position.x;
        float dy   = myBody.transform.position.y;

        if (dx >= room.transform.position.x + room.max_X || dx <= room.transform.position.x - room.max_X)
        {
            myBody.GetComponent <Rigidbody2D>().velocity = new Vector2(0, myBody.GetComponent <Rigidbody2D>().velocity.y);
        }
        if (dy >= room.transform.position.y + room.max_Y || dy <= room.transform.position.y - room.max_Y)
        {
            myBody.GetComponent <Rigidbody2D>().velocity = new Vector2(myBody.GetComponent <Rigidbody2D>().velocity.x, 0);
        }

        Vector3 dir = (iceSlime2.currentTarget.transform.position - myBody.transform.position).normalized;

        myBody.GetComponent <Rigidbody2D>().velocity = dir * GetAI().getCharacter().getAttr().getSpeed() * Time.deltaTime;
        return(State.RUNNING);
    }
コード例 #7
0
    private void Desk(RaycastHit hit)
    {
        switch (hit.collider.name)
        {
        case "d1":
            d1.transform.localPosition = new Vector3(0.2510861f, 0.7788424f, 0.5f);
            StartCoroutine(Room1.Position(4.0f, d1, new Vector3(0.2510861f, 0.7788424f, 0.2488438f)));
            break;

        case "d2":
            d2.transform.localPosition = new Vector3(-0.2510089f, 0.7788424f, 0.5f);
            StartCoroutine(Room1.Position(4.0f, d2, new Vector3(-0.2510089f, 0.7788424f, 0.2488438f)));
            break;

        case "d3":
            d3.transform.localPosition = new Vector3(0.2510861f, 0.7788424f, 0.5f);
            StartCoroutine(Room1.Position(4.0f, d3, new Vector3(0.2510861f, 0.7788424f, 0.2488438f)));
            break;

        case "d4":
            d4.transform.localPosition = new Vector3(-0.2510089f, 0.7788424f, 0.5f);
            StartCoroutine(Room1.Position(4.0f, d4, new Vector3(-0.2510089f, 0.7788424f, 0.2488438f)));
            break;

        case "d5":
            d5.transform.localPosition = new Vector3(0.2510861f, 0.7788424f, 0.5f);
            StartCoroutine(Room1.Position(4.0f, d5, new Vector3(0.2510861f, 0.7788424f, 0.2488438f)));
            break;

        case "d6":
            d6.transform.localPosition = new Vector3(-0.2510089f, 0.7788424f, 0.5f);
            StartCoroutine(Room1.Position(4.0f, d6, new Vector3(-0.2510089f, 0.7788424f, 0.2488438f)));
            break;
        }
    }
コード例 #8
0
        public void OnUpdate(GameTime gameTime)
        {
            Room1.OnUpdate(gameTime);
            Room2.OnUpdate(gameTime);
            Room3.OnUpdate(gameTime);

            Title.OnUpdate(gameTime);

            ProcessInput();
        }
コード例 #9
0
ファイル: ClassesTests.cs プロジェクト: Caraul/Olimpics
        public void Room1Test()
        {
            var room1     = new Room1("1 2 0 7 2 1 -3 0 -2 3 -1");
            var variables = new int[4] {
                2, 3, 4, 5
            };

            room1.WalkedThrough(variables);
            Assert.AreEqual(variables[0], 15);
        }
コード例 #10
0
        private static Area[] GetAreas()
        {
            var area1 = Room1.GetRoom();
            var area2 = Room2.GetRoom();
            var area3 = Room3.GetRoom();
            var area4 = Room4.GetRoom();

            return(new Area[4] {
                area1, area2, area3, area4
            });
        }
コード例 #11
0
    private void Bedside_table(RaycastHit hit)
    {
        switch (hit.collider.name)
        {
        case "g1":
            g1.transform.Rotate(new Vector3(-90, 0, 0));
            StartCoroutine(Center.Rotation(5.0f, g1, new Vector3(90, 0, 0)));
            break;

        case "g2":
            g2.transform.localPosition = new Vector3(0, 0.7195432f, 0.3f);
            StartCoroutine(Room1.Position(4.0f, g2, new Vector3(0, 0.7195432f, 0f)));
            break;

        case "g3":
            g3.transform.localPosition = new Vector3(0, 0.5698911f, 0.3f);
            StartCoroutine(Room1.Position(4.0f, g3, new Vector3(0, 0.5698911f, 0)));
            break;

        case "g4":
            g4.transform.localPosition = new Vector3(0, 0.4227006f, 0.3f);
            StartCoroutine(Room1.Position(4.0f, g4, new Vector3(0, 0.4227006f, 0)));
            break;

        case "g5":
            g5.transform.localPosition = new Vector3(0, 0.2434302f, 0.3f);
            StartCoroutine(Room1.Position(4.0f, g5, new Vector3(0, 0.2434302f, 0)));
            break;

        case "g6":
            g6.transform.localPosition = new Vector3(0.1634076f, 1.013223f, 0.08f);
            StartCoroutine(Room1.Position(4.0f, g6, new Vector3(0.1634076f, 1.013223f, -0.06280849f)));
            break;

        case "g7":
            g7.transform.localPosition = new Vector3(0.1634076f, 0.9257064f, 0.08f);
            StartCoroutine(Room1.Position(4.0f, g7, new Vector3(0.1634076f, 0.9257064f, -0.06280849f)));
            break;

        case "g8":
            g8.transform.localPosition = new Vector3(0.1634076f, 0.8402296f, 0.08f);
            StartCoroutine(Room1.Position(4.0f, g8, new Vector3(0.1634076f, 0.8402296f, -0.06280849f)));
            break;

        case "key3":
            Character.Items.Add("key3");
            Destroy(key3);
            b1.gameObject.GetComponent <Image>().sprite = i1;

            inf.GetComponent <Text>().text = "you get key2.";
            StartCoroutine(clean());
            break;
        }
    }
コード例 #12
0
 public bool Equals(Aisle other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Room0.Equals(other.Room0) && Room1.Equals(other.Room1));
 }
コード例 #13
0
    private void GoToNextRoom()
    {
        Room2.PlayerEnterInRoom();
        Room1.DeInitRoom();
        FindObjectOfType <TestMovement>().OnRoomEnter(); // tmp need player singletone

        foreach (Door door in Room2.Doors)
        {
            if (door.OnNode == FindObjectOfType <TestMovement>().CurrentNode)
            {
                door.TransitionMade = true;
            }
        }
    }
コード例 #14
0
    private void Desk(RaycastHit hit)
    {
        switch (hit.collider.name)
        {
        case "d11":
            d11.transform.localPosition = new Vector3(0, 0, 0.3f);
            StartCoroutine(Room1.Position(4.0f, d11, new Vector3(0, 0, 0)));
            break;

        case "d12":
            d12.transform.localPosition = new Vector3(-0.4988959f, -0.02291433f, 0.3f);
            StartCoroutine(Room1.Position(4.0f, d12, new Vector3(-0.4988959f, -0.02291433f, 0.003327618f)));
            break;

        case "d13":
            d13.transform.localPosition = new Vector3(-0.4988959f, -0.2234892f, 0.5f);
            StartCoroutine(Room1.Position(4.0f, d13, new Vector3(-0.4988959f, -0.2234892f, 0.003327618f)));
            break;

        case "d21":
            d21.transform.localPosition = new Vector3(0, 0, 0.3f);
            StartCoroutine(Room1.Position(4.0f, d21, new Vector3(0, 0, 0)));
            break;

        case "d22":
            d22.transform.localPosition = new Vector3(-0.4988959f, -0.02291433f, 0.3f);
            StartCoroutine(Room1.Position(4.0f, d22, new Vector3(-0.4988959f, -0.02291433f, 0.003327618f)));
            break;

        case "d23":
            d23.transform.localPosition = new Vector3(-0.4988959f, -0.2234892f, 0.3f);
            StartCoroutine(Room1.Position(4.0f, d23, new Vector3(-0.4988959f, -0.2234892f, 0.003327618f)));
            break;

        case "d31":
            d31.transform.localPosition = new Vector3(0, 0, 0.3f);
            StartCoroutine(Room1.Position(4.0f, d31, new Vector3(0, 0, 0)));
            break;

        case "d32":
            d32.transform.localPosition = new Vector3(-0.4988959f, -0.02291433f, 0.3f);
            StartCoroutine(Room1.Position(4.0f, d32, new Vector3(-0.4988959f, -0.02291433f, 0.003327618f)));
            break;

        case "d33":
            d33.transform.localPosition = new Vector3(-0.4988959f, -0.2234892f, 0.3f);
            StartCoroutine(Room1.Position(4.0f, d33, new Vector3(-0.4988959f, -0.2234892f, 0.003327618f)));
            break;
        }
    }
コード例 #15
0
    private void BeginGame()
    {
        if (roomType == 1)
        {
            room1Instance = Instantiate(room1Prefab);
        }

        botPositions = new List <Vector3> {
        };
        savedBotIDs  = new List <int>();

        //⚠️ Using Instantiate is problematic
        //SpawnBot();
    }
コード例 #16
0
        /// <summary>
        /// 接続している反対側の部屋を取得
        /// </summary>
        /// <param name="origin"></param>
        /// <returns></returns>
        /// <exception cref="MazeException"></exception>
        public Room GetCounterSide(Room origin)
        {
            // 自分ではない方を返す
            if (Room0.Equals(origin))
            {
                return(Room1);
            }

            if (Room1.Equals(origin))
            {
                return(Room0);
            }

            // どちらも自分でなければエラー
            throw new MazeException("This aisle is not connected to the room");
        }
コード例 #17
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());
                }
            }
        }
    }
コード例 #18
0
 public void SetRoom(Room1 room)
 {
     this.room = room;
 }
コード例 #19
0
 public override void TurnRoomsOff()
 {
     //Deactivates all rooms except the point of entry and save rooms.
     if (Room0 != null)
     {
         //Room0.SetActive(false);
     }
     if (Room1 != null)
     {
         Room1.SetActive(false);
     }
     if (Room2 != null)
     {
         Room2.SetActive(false);
     }
     if (Room3 != null)
     {
         Room3.SetActive(false);
     }
     if (Room4 != null)
     {
         Room4.SetActive(false);
     }
     if (Room5 != null)
     {
         Room5.SetActive(false);
     }
     if (Room6 != null)
     {
         Room6.SetActive(false);
     }
     if (Room7 != null)
     {
         Room7.SetActive(false);
     }
     if (Room8 != null)
     {
         //Room8.SetActive(false);
     }
     if (Room9 != null)
     {
         Room9.SetActive(false);
     }
     if (Room10 != null)
     {
         Room10.SetActive(false);
     }
     if (Room11 != null)
     {
         Room11.SetActive(false);
     }
     if (Room12 != null)
     {
         Room12.SetActive(false);
     }
     if (Room13 != null)
     {
         Room13.SetActive(false);
     }
     if (Room14 != null)
     {
         Room14.SetActive(false);
     }
     if (Room15 != null)
     {
         Room15.SetActive(false);
     }
     if (Room16 != null)
     {
         Room16.SetActive(false);
     }
     if (Room17 != null)
     {
         //Room17.SetActive(false);
     }
     if (Room18 != null)
     {
         Room18.SetActive(false);
     }
     if (Room19 != null)
     {
         Room19.SetActive(false);
     }
     if (Room20 != null)
     {
         Room20.SetActive(false);
     }
     if (Room21 != null)
     {
         //Room21.SetActive(false);
     }
     if (Room22 != null)
     {
         //Room22.SetActive(false);
     }
     if (Room23 != null)
     {
         Room23.SetActive(false);
     }
     if (Room24 != null)
     {
         Room24.SetActive(false);
     }
     if (Room25 != null)
     {
         Room25.SetActive(false);
     }
     if (Room26 != null)
     {
         //Room26.SetActive(false);
     }
 }
コード例 #20
0
ファイル: GameCode.cs プロジェクト: danaAlcala/SimpleTextGame
 public void play() // this function should store the main flow of the game.
 {
     player.level = 1;
     Room1 startingArea = new Room1();
 }
コード例 #21
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();
                }
            }
        }
    }
コード例 #22
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();
                }
            }
        }
    }
コード例 #23
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);
                }
            }
        }
    }