発生している問題・エラーメッセージ
Assets\Scripts\Light.cs(22,73): error CS1061: 'Renderer' does not contain a definition for 'materialcolor' and no accessible extension method 'materialcolor' accepting a first argument of type 'Renderer' could be found (are you missing a using directive or an assembly reference?)
該当のソースコード
C# Light.cs
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4 5public class Light : MonoBehaviour 6{ 7 [SerializeField] private float Speed = 3; 8 [SerializeField] private int num = 0; 9 private Renderer rend; 10 float alfa = 0; 11 // Start is called before the first frame update 12 void Start() 13 { 14 rend = GetComponent<Renderer>(); 15 } 16 17 // Update is called once per frame 18 void Update() 19 { 20 if(!(rend.material.color.a <= 0)) 21 { 22 rend.material.color = new Color(rend.material.color.r, rend.materialcolor.g, rend.material.color.b, alfa); 23 } 24 alfa -= Speed * Time.deltaTime; 25 } 26} 27
試したこと
ネットで調べましたが全く対処法などが出てきませんでした。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。