Skip to content

keijiro/TsudaUnity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

津田塾大学 Unity セミナー

配布物

前編:Unity 復習

  • 作例を確認
  • プレイヤーの操作系
  • 箱のプレハブ化と配置
  • メダルの配置と当たり判定
  • “Clear!!” モデルのインポート
  • Active フラグの操作

後編:Unity 応用

  • Sample Assets のインポート(かなり時間かかる)
  • Asset Store と Sample Asset の説明
  • 様々なサンプル (Sample Assets/Sample Scenes/Scenes)
  • Prototype プレハブを使ってみる
  • サンプルを豪華に作り直してみる
  • AI を使ってみる

ソースコードリスト

// Player.cs
using UnityEngine;
using System.Collections;

public class Player : MonoBehaviour
{
    void Update()
    {
        if (Input.GetButtonDown("Jump"))
        {
            rigidbody.AddForce(Vector3.up * 300);
        }
    }

    void FixedUpdate()
    {
        rigidbody.AddForce(Vector3.right * Input.GetAxis("Horizontal") * 20);
        rigidbody.AddForce(Vector3.forward * Input.GetAxis("Vertical") * 20);
    }
}
// Medal.cs
using UnityEngine;
using System.Collections;

public class Medal : MonoBehaviour
{
    public GameObject clearText;

    void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.name == "Player")
        {
            clearText.SetActive(true);
        }
    }
}

About

Unity tutorial project for a seminar at Tsuda College.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published