一、起因:
没啥,看到了,写写而已。
二、实现方式:
首先贴一下代码:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TryGetComponentTest : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if(Input.GetKeyDown(KeyCode.Space))