예제 #1
0
    public override bool Use()                          //Igual lo hacemos pubico para mejorar la interaccion con el personaje
    //objectiveDoor.SendMessage("Activate");
    {
        Door doorScript = objectiveDoor.GetComponent <Door> ();

        doorScript.Activate();
        return(true);
    }
예제 #2
0
 public void Activate(GameObject origin)
 {
     if (isItWin())
     {
         pushSound.start();
         pannelToActiv.isActive = true;
         doorOpen.Activate(this.gameObject);
     }
 }
예제 #3
0
 void OnTriggerExit2D(Collider2D col)
 {
     if (col.gameObject.tag == "Player")
     {
         col.gameObject.SendMessage("DoorClosing");
         door.Activate(DoorAction.CLOSE, col.gameObject);
         Destroy(gameObject);
     }
 }
예제 #4
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if(col.gameObject.tag == "Player" && !isDone)
     {
         isDone = true;
         col.gameObject.SendMessage("DoorOpening");
         door.Activate(DoorAction.OPEN, col.gameObject);
         //Destroy(gameObject);
     }
 }
예제 #5
0
    // Update is called once per frame
    void Update()
    {
        if (transform.rotation.eulerAngles.z < 200 && transform.rotation.eulerAngles.z > 150 && !handleGrab.isGrabbed && !alreadyActivated)
        {
            handleGrab.enabled = false;

            alreadyActivated = true;
            door.Activate(this.gameObject);
            lightRend.material = activMat;
            openSound.start();
        }
    }
예제 #6
0
 private void Update()
 {
     if (InputSplitter.GetInteractPressed(fpsMove.PlayerID))
     {
         RaycastHit hitInfo;
         if (Physics.Raycast(cameraTransform.position, cameraTransform.forward, out hitInfo,
                             InteractDistance, interactLayer))
         {
             if (hitInfo.collider.gameObject.layer == airconLayer)
             {
                 GameObject hitObj           = hitInfo.transform.parent.gameObject;
                 Aircon     airconController = hitObj.GetComponent <Aircon>();
                 if (airconController)
                 {
                     airconController.Activate();
                 }
             }
             else if (hitInfo.collider.gameObject.layer == doorLayer)
             {
                 GameObject hitObj         = hitInfo.transform.parent.parent.gameObject;
                 Door       doorController = hitObj.GetComponent <Door>();
                 if (doorController)
                 {
                     doorController.Activate();
                 }
             }
             else if (hitInfo.collider.gameObject.layer == elevatorActivateLayer)
             {
                 GameObject hitObj             = hitInfo.transform.parent.gameObject;
                 Elevator   elevatorController = hitObj.GetComponent <Elevator>();
                 if (elevatorController)
                 {
                     elevatorController.Activate();
                 }
             }
             else if (hitInfo.collider.gameObject.layer == elevatorSlowActivateLayer)
             {
                 Elevator elevatorController = elevatorTerminal.GetComponent <Elevator>();
                 if (elevatorController)
                 {
                     elevatorController.ActivateSlow();
                 }
             }
         }
     }
     if (InputSplitter.GetSmokePressed(fpsMove.PlayerID))
     {
         smokeBombController.Activate();
     }
 }
예제 #7
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.transform.tag == "Hand")
        {
            pushSound.start();
            an.SetTrigger("Push");

            if (isOpening)
            {
                door.Activate(this.gameObject);
            }
            else
            {
            }
        }
    }
예제 #8
0
 void OnTriggerEnter(Collider other)
 {
     if(other.gameObject.GetComponent("Client") != null) //You can change this script to any script that only the player has
     {
         Debug.Log("Colliding");
         if (TrapType == (int) Traps.LT_PIT)
         {
             Pit p = new Pit();
             p.Activate(character,SpawnPoint);
         }
         else if(TrapType == (int) Traps.LT_DOOR)
         {
             Door d = new Door();
             d.Activate(character,NextDoor);
         }
     }
 }
예제 #9
0
    public void RandomizeConnections(RoomTower tower)
    {
        int left = 3;

        while (left > 0)
        {
            float chance = Random.Range(0.0f, 100.0f);

            Door door = doors[Random.Range(0, doors.Length)];

            if (door.symmetricDoor != null)
            {
                continue;
            }
            left--;

            if (door.symmetricDoor != null)
            {
                return;
            }

            door.Activate();

            if (chance < 25f)
            {
                door.symmetricDoor = exitDoor;
            }
            else if (chance < 45f)
            {
                door.symmetricDoor = entryDoor;
            }
            else if (chance < 75.0f)
            {
                door.symmetricDoor = tower.rooms[Random.Range(roomIndex, tower.rooms.Length)].GetComponent <RoomController>().entryDoor;
            }
            else
            {
                door.symmetricDoor = tower.rooms[tower.rooms.Length - 1].GetComponent <RoomController>().entryDoor;
            }
        }
    }
예제 #10
0
 void winThis()
 {
     myLightWin.material = activ_Mat;
     openDoor.Activate(this.gameObject);
     winSound.start();
 }
예제 #11
0
 public void ActivateDoor()
 {
     door.Activate();
 }