LoginSignup
10

More than 5 years have passed since last update.

Unityのサイコロのアセットの紹介

Posted at

Dice Pack Light
http://u3d.as/content/wyrm-tale-games/dice-pack-light/1tw
このアセットの紹介です.

サイコロのテクスチャとサイコロの目の判定プログラムがセットになっています.
また,サイコロは6面ダイスと10面ダイスがあります.

importするとDemoもあるのでぜひ見てみてください.

Dice->Resources->Prefabsの中にサイコロのprefabがあります.
この中のd6のprefabに次のScriptを加えてもらうとサイコロの目をConsoleに吐き出せます

using UnityEngine;
using System.Collections;

public class Sample : MonoBehaviour {

public int value;
private Die_d6 die;
// Use this for initialization
void Start () {
    //最初にランダムで回転させる
    transform.rotation = Random.rotation;
    die = gameObject.GetComponent<Die_d6>();
}

// Update is called once per frame
void Update () {
    value = die.value;
    Debug.Log(value);
}

}

と,いうことで,サイコロを使ってボードゲームなどを作ろうと考えている方はぜひこちらのアセットを使ってみてください.

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10