「damageScript」:メンバー名は囲みタイプと同じにすることはできません。 HealthDamageInfo damageScript; "C#エラーで「メンバー名がその囲みタイプと同じであることはできません」
internal class damageScript
{
public HealthDamageInfo damageScript;
public string tagName;
public string otherTag;
public string message;
// Use this for initialization
void Start()
{
damageScript = GetComponent<HealthDamageInfo>();
}
private HealthDamageInfo GetComponent<T>()
{
throw new NotImplementedException();
}
// Update is called once per frame
void Update()
{
}
void OnCollisionEnter(Collision other)
{
if (other.gameObject.tag == tagName)
{
damageScript.SendMessage("SwitchInteractionTarget", message);
}
else if (other.gameObject.tag == otherTag)
{
damageScript.SendMessage("SwitchInteractionTarget", message);
}
}
}
クラス名「damageScript」とフィールド「damageScript」(参照した行)は同じ名前です。それらのうちの1つを別のものに変更します。 –
クラス名がPascalCasingの適切なC#規則に従わないことに注意してください。クラスの名前を内部クラスDamageScriptに変更する必要があります –