void OnControllerColliderHit(ControllerColliderHit other) { if (other.gameObject.tag == "MedKit") { Destroy(other.gameObject); if (Health <= 100) { randomValue = Random.Range(5, 25); healthValue = Health + randomValue; if (healthValue >= 100) { Health = 100; } else { Health += randomValue; } } } if (other.gameObject.tag == "Door") { levelKey lvlKey = GetComponent <levelKey>(); if (lvlKey.fireUI != null && lvlKey.waterUI != null && lvlKey.airUI != null) { SceneManager.LoadScene(4); } } }
public static JsonData getLevelData(int level, levelKey key) { if (levelBiao.Count > level) { return(levelBiao[level - 1][(int)key]); } return(null); }