anonymous No title
No License C#
2020年10月08日
Copy Clone
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CarController : MonoBehaviour
{
    float speed = 0;
    Vector2 startPos;
    float strTime;
    float endTime;
    float spTime;

    // Start is called before the first frame update
    void Start()
    {
    

    }

    // Update is called once per frame
    void Update()
    {
        //スワイプの長さを決める(追加)
        if (Input.GetMouseButtonDown(0))
        {
            //マウスをクリックした座標
            this.startPos = Input.mousePosition;

            // マウスをクリックした時間
            strTime = Time.deltaTime;            

        }else if (Input.GetMouseButtonUp(0))
        {
            //マウスを離した座標
            Vector2 endPos = Input.mousePosition;
            float swipeLength = endPos.x - this.startPos.x;

            //マウスを離した時間
            endTime = Time.deltaTime;
            spTime = endTime - strTime;

            //スワイプの長さを初速度に変換する
            speed = swipeLength / spTime;
        }

        transform.Translate(speed, 0, 0); //移動
        speed *= 0.98f; //速度
    }
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CarController : MonoBehaviour
{
    float speed = 0;
    Vector2 startPos;
    float strTime;
    float endTime;
    float spTime;

    // Start is called before the first frame update
    void Start()
    {
    

    }

    // Update is called once per frame
    void Update()
    {
        //スワイプの長さを決める(追加)
        if (Input.GetMouseButtonDown(0))
        {
            //マウスをクリックした座標
            this.startPos = Input.mousePosition;

            // マウスをクリックした時間
            strTime = Time.deltaTime;            

        }else if (Input.GetMouseButtonUp(0))
        {
            //マウスを離した座標
            Vector2 endPos = Input.mousePosition;
            float swipeLength = endPos.x - this.startPos.x;

            //マウスを離した時間
            endTime = Time.deltaTime;
            spTime = endTime - strTime;

            //スワイプの長さを初速度に変換する
            speed = swipeLength / spTime;
        }

        transform.Translate(speed, 0, 0); //移動
        speed *= 0.98f; //速度
    }
}
anonymous
Anonymous
2021年04月28日
Meds information leaflet. Drug Class. <a href="https://toplyrica.top">can i get cheap lyrica without prescription</a> in USA All news about pills. Get information here.
anonymous
Anonymous
2021年04月30日
cialis website <a href="https://mycialistabs.com/">is there a generic cialis</a> how often can you take cialis
anonymous
Anonymous
2021年05月01日
viagra and cialis <a href="https://toptadalafiltabs.com/">tadalafil tablets 20 mg</a> cialis vs. viagra
anonymous
Anonymous
2021年05月03日
how to write an essay mla format <a href="https://topessaywriterfas.com/">college entry essay</a> how to write a definitional essay
anonymous
Anonymous
2021年05月05日
service learning review essay <a href="http://writemyessayslfd.com/">writing an analytical essay</a> an essay on community service
anonymous
Anonymous
2021年05月06日
canadian viagra <a href="https://mrviagrashop.com">alternatives to viagra</a> herb viagra
anonymous
Anonymous
2021年05月07日
sildenafil 20 mg cost <a href="https://mysildenafilkr.com/">cheapest viagra</a> over the counter viagra substitute
anonymous
Anonymous
2021年05月11日
Medicines information sheet. Drug Class. <a href="https://prednisone4u.top">buy prednisone without rx</a> in US. Some information about drug. Get now.
anonymous
Anonymous
2021年05月11日
relevant coursework resume <a href="http://coverletterforresumetop.com/">writing a professional summary for resume</a> customer service resume summary
anonymous
Anonymous
2021年05月11日
when to take cialis for best results <a href="http://tadalafilled.com/">tadalafil from india reviews</a> viagra vs cialis reddit
anonymous
Anonymous
2021年05月12日
retail manager resume <a href="https://writingacoverletteronline.com/">pay for resume</a> who do i address a cover letter to
anonymous
Anonymous
2021年05月13日
viagra in india <a href="https://edviagramaster.net/">generic viagra cost</a> sildenafil 20mg tablets
anonymous
Anonymous
2021年05月15日
viagra cialis <a href="https://sildenafilviagratop.com">natural alternative to viagra</a> viagra alternative
anonymous
Anonymous
2021年05月15日
cialis from canada <a href="https://cialisortadalafil.com/">teva tadalafil</a> cialis without a prescription
anonymous
Anonymous
2021年05月16日
how many years can you take cialis? <a href="https://topcialistabs.com/">tadalafil goodrx</a> over the counter cialis walgreens
anonymous
Anonymous
2021年05月17日
Drugs information leaflet. Effects of Drug Abuse. <a href="https://januvia4u.top">cheap januvia without prescription</a> in US All news about medication. Get information now.
anonymous
Anonymous
2021年05月19日
Medicine information leaflet. Long-Term Effects. <a href="https://lasix4u.top">generic lasix without a prescription</a> in USA Everything trends of drugs. Read now.
anonymous
Anonymous
2021年05月21日
<a href="https://5bz.ru/">бесплатная база предприятий россии скачать</a>
anonymous
Anonymous
2021年08月31日
<a href="https://domalech.ru/">trazodone enema</a>
anonymous
Anonymous
2021年09月05日
Pills information sheet. Generic Name. <a href="https://crestor4u.top">where to get cheap crestor pills</a> in Canada Some about meds. Read now.