小编Fac*_*ann的帖子

如何在Unity3D中使用C#延迟?

我刚刚开始在团结中学习c#.我按照教程,但我想添加一些东西.

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class PlayerController : MonoBehaviour {

    public float speed;
    public Text countText;
    public Text winText;

    private Rigidbody rb;
    private int count;

    void Start ()
    {
        rb = GetComponent<Rigidbody>();
        count = 0;
        SetCountText ();
        winText.text = "";
    }

    void FixedUpdate ()
    {
        float moveHorizontal = Input.GetAxis ("Horizontal");
        float moveVertical = Input.GetAxis ("Vertical");

        Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);

        rb.AddForce (movement * speed);
    }

    void OnTriggerEnter(Collider other) 
    {
        if (other.gameObject.CompareTag ( "Pick Up")) …
Run Code Online (Sandbox Code Playgroud)

c# unity-game-engine

0
推荐指数
1
解决办法
2079
查看次数

标签 统计

c# ×1

unity-game-engine ×1