IEnumerator ChopItDown(RaycastHit hit, Vector3 closestTreePosition) { myAnimator.SetBool("ToTwoHandedAttack", true); yield return(new WaitForSeconds(1f)); // Remove the tree from the terrain tree list if (hit.collider.gameObject.tag == "Ani") { AnimalControl temp = hit.collider.gameObject.GetComponent("AnimalControl") as AnimalControl; temp.Harmed(); } else { hit.collider.gameObject.SetActive(false); // Now refresh the terrain, getting rid of the darn collider // float[, ] heights = terrain.GetHeights (0, 0, 0, 0); // terrain.SetHeights (0, 0, heights); // Put a falling tree in its place closestTreePosition.y += 3.1f; Instantiate(FallingTreePrefab, closestTreePosition, Quaternion.Euler(0, 0, 80)); } myAnimator.SetBool("ToTwoHandedAttack", false); chopTree = false; }
void Awake() { gameUI = GameObject.FindGameObjectWithTag(GameplayStatics.GAME_UI_TAG).GetComponent <Canvas>(); timeText = gameUI.transform.Find("Timer/Text").GetComponent <Text>(); animalControl = GameObject.FindGameObjectWithTag(GameplayStatics.ANIMAL_CONTROL_TAG).GetComponent <AnimalControl>(); bearController = GameObject.FindGameObjectWithTag("Player").GetComponent <BearController>(); fireAudio = this.GetComponent <AudioSource>(); }
private void Awake() { if (Instance != null) { Destroy(gameObject); } else { Instance = this; AliveAnimals = new List <Animal>(); InitializeAnimals(); } }
//Validar el usuario private static bool IsValid(string email, string password) { var isValid = false; using (var db = new AnimalControl()) { var user = db.AC_Usuario.FirstOrDefault(u => u.Correo == email); if (user == null) { return(isValid); } if (user.Contraseña == password) { isValid = true; } } return(isValid); }