Skip to content

Commit

Permalink
全体の内容と資料見直し
Browse files Browse the repository at this point in the history
  • Loading branch information
Elise3993 committed May 23, 2024
1 parent 20d3129 commit 8fb1f4b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
40 changes: 20 additions & 20 deletions SampleScripts/FallRandom.txt → SampleScripts/FallRandom.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FallRandom : MonoBehaviour
{
void Update()
{
if (this.transform.position.y < - 5.0)
{
float x = Random.Range(-9.0f,9.0f);
float y = 5.0f;
this.transform.position = new Vector3(x,y,0);
Rigidbody2D rb = GetComponent<Rigidbody2D>();
rb.velocity = new Vector3(0, 0, 0);
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FallRandom : MonoBehaviour
{
void Update()
{
if (this.transform.position.y < - 5.0)
{
float x = Random.Range(-9.0f,9.0f);
float y = 5.0f;

this.transform.position = new Vector3(x,y,0);

Rigidbody2D rb = GetComponent<Rigidbody2D>();
rb.velocity = new Vector3(0, 0, 0);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class OnKeyPressMoveRight : MonoBehaviour
{
[SerializeField] private float speed = 5.0f;
void Update()
{
if (Input.GetKey("right"))
{
this.gameObject.transform.Translate(speed * Time.deltaTime,0,0);
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class OnKeyPressMoveRight : MonoBehaviour
{
[SerializeField] private float speed = 5.0f;

void Update()
{
if (Input.GetKey("right"))
{
this.gameObject.transform.Translate(speed * Time.deltaTime,0,0);
}
}
}
Binary file modified 新入生用_ゲーム開発体験会_資料.pdf
Binary file not shown.

0 comments on commit 8fb1f4b

Please sign in to comment.