Skip to content

Instantly share code, notes, and snippets.

@hidsh
Last active January 2, 2021 20:39
Show Gist options
  • Save hidsh/d76b1f8e9efe7f5ba301ef2f2860c643 to your computer and use it in GitHub Desktop.
Save hidsh/d76b1f8e9efe7f5ba301ef2f2860c643 to your computer and use it in GitHub Desktop.
unity test: アクセス指定子 https://dkrevel.com/makegame-beginner/access/
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()
{
}
}
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);
}
}
@hidsh
Copy link
Author

hidsh commented Dec 30, 2020

inspector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment