/// <summary> /// проверка глаз и затылка /// </summary> private void checkEye() { if (Raycast(eyeRaycast, true, !BackEyepP()) && (Player.transform.position.y - this.transform.position.y) < heightFindPlayer) { SetFindOtherMobs(); playerFinded = true; if (StateMobsGameObj.GetComponent <StateActive>().LastState != "Exc") { StateMobsGameObj.GetComponent <StateActive>().EndVoid(new List <bool> { true, false, false }); StateMobsGameObj.GetComponent <StateActive>().Exlamation(); } else { StateMobsGameObj.GetComponent <StateActive>().EndVoid(new List <bool> { true, true, false }); } } else { StateMobsGameObj.GetComponent <StateActive>().RenameLastState(); } if (Raycast(BackeyeRaycast, false, true) && BackEyepP()) { if (Player.GetComponent <PlayerController>()._Movd) { Rotate(); } } }
public void GetDamage(float damage) { if (Random.Range(0, 30) == 1) { PlayerStat.Instance.CountKritDamageUp(); StatePosition(); StateMobsGameObj.GetComponent <StateActive>().EndVoid(new List <bool> { true, true, true }); StateMobsGameObj.GetComponent <StateActive>().Krit(); Health -= damage * 0.3f; } else { Health -= damage; } }
private void checkState() { if (!Raycast(eyeRaycast, true, !BackEye()) && playerFinded) { if (StateMobsGameObj.GetComponent <StateActive>().LastState != "Que") { StateMobsGameObj.GetComponent <StateActive>().EndVoid(new List <bool> { false, true, false }); StateMobsGameObj.GetComponent <StateActive>().Questions(); } else { StateMobsGameObj.GetComponent <StateActive>().EndVoid(new List <bool> { true, true, false }); } } }