在第 14 行,我不断收到错误消息:“赋值的左侧必须是变量、属性或索引器。”
using UnityEngine;
using System.Collections;
public class RapidFireTrigger : MonoBehaviour {
RapidFireTrigger Player;
void OnTriggerEnter (Collider other)
{
Debug.Log ("Player enter the trigger");
if (other.gameObject.tag == "Player")
Destroy (gameObject);
}
void Start ()
{
RapidFireTrigger = GetComponent <PlayerShooting> ();
PlayerShooting.timeBetweenBullets = 0.02f;
}
IEnumerator Wait ()
{
yield return new WaitForSeconds (20);
}
void Restore ()
{
PlayerShooting.timeBetweenBullets = 0.15f;
}
}