// Start is called before the first frame update void Awake() { character = GetComponent <CharacterIdController>(); hp = maxHp; currentSpeed = speed; moving = true; cam = Camera.main; controller = GetComponent <CharacterController>(); anim = character.SetPlayerCustom(); foreach (Material bodyMat in characterMats[character.characterId].bodyMats) { bodyMat.SetColor("Color_9AC6EC04", splashColor); } foreach (BodyMaterials body in characterMats) { foreach (Material bodyMat in body.bodyMats) { bodyMat.SetFloat("Vector1_104BE5AC", Mathf.Lerp(-1, 1.5f, 1 - hp / maxHp)); } } StartCoroutine(AudioManager.instance.FadeIn("transicion", 1)); }
public void ConfirmPlay() { BetweenScenePass data = BetweenScenePass.instance; CharacterIdController selecterCharacterCustom = selectedCharacter.GetComponent <CharacterIdController>(); phrasePanel.SetActive(false); nextButton.SetActive(false); prevButton.SetActive(false); playButton.SetActive(false); characters.SetActive(false); levelNPCs.transform.position = new Vector3(levelNPCs.transform.position.x, 0, levelNPCs.transform.position.z); trackCamera.SetActive(false); int selectedCharId = selecterCharacterCustom.CharacterId; data.PlayerCharacterId = selectedCharId; GameObject selectedNPC = null; for (int i = 0; i < npcList.Count; i++) { if (npcList[i].GetComponent <CharacterIdController>().CharacterId == selectedCharId) { selectedNPC = npcList[i]; } else { data.NpcCharacterId.Add(npcList[i].GetComponent <CharacterIdController>().CharacterId); } } player.GetComponent <MenuPlayerMovement>().anim = player.GetComponent <CharacterIdController>().SetPlayerCustom(); player.transform.position = new Vector3(selectedNPC.transform.position.x, 1.08f, selectedNPC.transform.position.z); player.transform.rotation = selectedNPC.transform.rotation; selectedNPC.SetActive(false); player.SetActive(true); cam.SetActive(true); gameObject.SetActive(false); }
// Start is called before the first frame update void Awake() { character = GetComponent <CharacterIdController>(); agent = GetComponent <NavMeshAgent>(); currentSpeed = speed; canMove = true; maxXPos = Random.Range(xPos.x, xPos.y); anim = character.SetRandomNpcCustom(); hp = maxHp; foreach (Material bodyMat in characterMats[character.characterId].bodyMats) { bodyMat.SetColor("Color_9AC6EC04", splashColor); } foreach (BodyMaterials body in characterMats) { foreach (Material bodyMat in body.bodyMats) { bodyMat.SetFloat("Vector1_104BE5AC", Mathf.Lerp(-1, 1.5f, 1 - hp / maxHp)); } } }