Created
February 25, 2020 16:08
-
-
Save ahmetabdi/3ceee8651e98159b4f56037aa276279e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void OpenDoors() | |
{ | |
this.doors = Object.FindObjectsOfType<Door>(); | |
foreach (Door door in this.doors) | |
{ | |
float num = Vector3.Distance(Camera.main.transform.position, door.transform.position); | |
Vector3 vector; | |
vector..ctor(Camera.main.WorldToScreenPoint(door.transform.position).x, Camera.main.WorldToScreenPoint(door.transform.position).y, Camera.main.WorldToScreenPoint(door.transform.position).z); | |
bool flag = num <= this.opendoordistance && (double)vector.z > 0.01; | |
if (flag) | |
{ | |
door.enabled = true; | |
door.DoorState = 2; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment