void KeyControl() { if (Input.GetKeyDown(toggle[0].kcode)) { ScriptsSituations situations = player.GetComponent <ScriptsSituations>(); if (!toggle[0].ui.activeSelf) { situations.Situations(false); toggle[0].ui.SetActive(true); } else { situations.Situations(true); toggle[0].ui.SetActive(false); } } else if (Input.GetKeyDown(toggle[1].kcode)) { ScriptsSituations situations = player.GetComponent <ScriptsSituations>(); if (!toggle[1].ui.activeSelf) { //situations.Situations(false); toggle[1].ui.SetActive(true); } else { //situations.Situations(true); toggle[1].ui.SetActive(false); } } }
protected void AttackToTarget(GameObject hitTarget, float attackSpeed, PlayerAnimations animations) { Vector3 enemyPostion; targetEnemy = hitTarget; enemyPostion = targetEnemy.transform.position; transform.LookAt(new Vector3(enemyPostion.x, transform.position.y, enemyPostion.z)); animations.PlayerNormalAttack(attackSpeed); scriptsSituations.Situations(false); }