C#
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4 5public class CakeEvent : MonoBehaviour { 6 7 // Use this for initialization 8 void Start () { 9 GameRuleCtrl = FindObjectOfType<GameRuleCtrl> (); 10 } 11 12 // Update is called once per frame 13 void Update () { 14 15 } 16 17 void OnTriggerEnter ( Collider other ) 18 { 19 GameRuleCtrl.GameClear (); 20 } 21}
これを実行すると、
Assets/Script/CakeEvent.cs(9,3): error CS0118: GameRuleCtrl' is a
type' but a `variable' was expected
Assets/Script/CakeEvent.cs(9,35): error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
Assets/Script/CakeEvent.cs(19,16): error CS0120: An object reference is required to access non-static member GameRuleCtrl.GameClear()
の三つが出てしまいます。
解決策を教えて下さい。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。