Last active
January 2, 2021 20:39
-
-
Save hidsh/d76b1f8e9efe7f5ba301ef2f2860c643 to your computer and use it in GitHub Desktop.
unity test: アクセス指定子 https://dkrevel.com/makegame-beginner/access/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class NewBehaviourScript : MonoBehaviour | |
{ | |
// Cube の Inspector を見ると、script のところに a だけが表示されている | |
public int a; | |
internal int b; | |
protected int c; | |
protected internal int d; | |
private int e; | |
// Start is called before the first frame update | |
void Start() | |
{ | |
} | |
// Update is called once per frame | |
void Update() | |
{ | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class NewBehaviourScript : MonoBehaviour | |
{ | |
public float speed; // public なので自動的にシリアライズされて、インスペクタで表示される | |
// Start is called before the first frame update | |
void Start() | |
{ | |
} | |
// Update is called once per frame | |
void Update() | |
{ | |
// ゲームオブジェクトを回転 | |
transform.rotation *= Quaternion.Euler(0, speed * Time.deltaTime, 0); | |
} | |
} |
Author
hidsh
commented
Dec 30, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment