/// <summary> /// Initializes a new instance of the <see cref="ShotEventArgs"/> class. /// </summary> /// <param name="shooter"><inheritdoc cref="Shooter"/></param> /// <param name="target"><inheritdoc cref="Target"/></param> /// <param name="hitboxType"><inheritdoc cref="HitboxType"/></param> /// <param name="distance"><inheritdoc cref="Distance"/></param> /// <param name="damage"><inheritdoc cref="Damage"/></param> /// <param name="canHurt"><inheritdoc cref="CanHurt"/></param> public ShotEventArgs(Player shooter, GameObject target, HitBoxType hitboxType, float distance, float damage, bool canHurt = true) { Shooter = shooter; Target = target; #pragma warning disable CS0618 // Type or member is obsolete HitboxType = hitboxType.ToString().ToLowerInvariant(); #pragma warning restore CS0618 // Type or member is obsolete HitboxTypeEnum = hitboxType; Distance = distance; Damage = damage; CanHurt = canHurt; }
public IEnumerator ShowArmorInfo() { ResourceRequest resourceRequest; resourceRequest = Resources.LoadAsync("GarageHitBoxInfo"); yield return(resourceRequest); ArmorInfo = (GameObject)Instantiate(resourceRequest.asset, transform.position, transform.rotation); ArmorInfo.transform.SetParent(GameObject.Find("UI Root").transform); ArmorInfo.GetComponent <RectTransform>().localScale = new Vector3(1, 1, 1); ArmorInfo.GetComponent <RectTransform>().localEulerAngles = new Vector3(1, 1, 1); ArmorInfo.transform.Find("Info/Armor").GetComponent <Text>().text = Armor.ToString(); ArmorInfo.transform.Find("Info/ArmorType").GetComponent <Text>().text = hitBoxType.ToString(); ArmorInfo.SetActive(false); ArmorInfo.transform.SetAsFirstSibling(); InitHitBox(); }