• 大小: 2.01MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-12
  • 语言: 其他
  • 标签: unity拼图  

资源简介

一个用unity5.0实现的简单的拼图游戏,拖动拼图碎片而把其放到相应的位置,此资源包含可以直接运行的源代码。具体的介绍可见博客: http://blog.csdn.net/wfenglinxu/article/details/49584605

资源截图

代码片段和文件信息

using UnityEngine;
using System.Collections;

public class item : MonoBehaviour {

public bool isChongHe=false; //是否与其对应的node重合

private Gameobject mouseobject;
// Use this for initialization
void Start () {
mouseobject = Gameobject.Find (“mouse“);
}
//进入对应的node时将isChongHe置为true
void OnTriggerEnter2D(Collider2D other){
if (other.gameobject.tag == “position“) {
if(other.gameobject.name==mouseobject.GetComponent().puzzlename)
isChongHe = true;
}
}
//离开对应的node时将isChongHe置为false
void OnTriggerExit2D(Collider2D other){
if (other.gameobject.tag == “position“) {
if(other.gameobject.name==mouseobject.GetComponent().puzzlename)
isChongHe = false;
}
}
//当自身被拖动到对应的node处并放开后执行node.die()销毁自身
void OnTriggerStay2D(Collider2D other){
if (other.gameobject.tag == “position“) {
if(other.gameobject.name==mouseobject.GetComponent().puzzlename && !mouseobject.GetComponent().isClicked){
//other.GetComponent().die();
//{ //Destroy(this.gameobject);
this.transform.tag=“position“;
this.transform.position=other.transform.position;
//mouseobject.GetComponent().num++;
}
}

}

}




 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       3476  2015-11-02 19:57  puzzle\Assembly-CSharp-vs.csproj

     文件       3476  2015-11-02 19:57  puzzle\Assembly-CSharp.csproj

    I.A....     29508  2015-11-02 22:35  puzzle\Assets\owlsence.unity

    ..A..H.       174  2015-11-02 17:28  puzzle\Assets\owlsence.unity.meta

     文件       1287  2015-10-24 12:09  puzzle\Assets\script\item.cs

    ..A..H.       262  2015-11-02 19:57  puzzle\Assets\script\item.cs.meta

     文件       1894  2015-11-02 21:54  puzzle\Assets\script\puzzle.cs

    ..A..H.       262  2015-11-02 19:57  puzzle\Assets\script\puzzle.cs.meta

    ..A..H.       191  2015-11-02 17:26  puzzle\Assets\script.meta

     文件     545663  2015-11-02 19:47  puzzle\Assets\Sprite\owl_back.png

    ..A..H.      1160  2015-11-02 19:17  puzzle\Assets\Sprite\owl_back.png.meta

     文件      87519  2015-10-30 23:22  puzzle\Assets\Sprite\owl_puzzle.png

    ..A..H.      3130  2015-11-02 19:33  puzzle\Assets\Sprite\owl_puzzle.png.meta

    ..A..H.       191  2015-11-02 17:26  puzzle\Assets\Sprite.meta

    I.A....      4120  2015-11-02 17:20  puzzle\Library\AnnotationManager

    I.A....    984236  2015-11-02 22:48  puzzle\Library\assetDatabase3

    I.A....         6  2015-11-02 17:21  puzzle\Library\AssetImportState

    I.A....      4756  2015-11-02 22:48  puzzle\Library\AssetServerCacheV3

    I.A....         0  2015-11-02 17:20  puzzle\Library\BuildPlayer.prefs

    I.A....      4124  2015-11-02 17:20  puzzle\Library\BuildSettings.asset

    I.A....     36752  2015-11-02 22:48  puzzle\Library\CurrentLayout.dwlt

    I.A....      4268  2015-11-02 22:42  puzzle\Library\EditorUserBuildSettings.asset

    I.A....      4144  2015-11-02 17:20  puzzle\Library\EditorUserSettings.asset

    I.A....      4164  2015-11-02 22:48  puzzle\Library\expandedItems

    I.A....      4404  2015-11-02 22:42  puzzle\Library\guidmapper

    I.A....      4164  2015-11-02 21:54  puzzle\Library\InspectorExpandedItems.asset

     文件         65  2015-11-02 17:20  puzzle\Library\LibraryFormatVersion.txt

    I.A....      4285  2015-11-02 17:20  puzzle\Library\metadata\00\00000000000000001000000000000000

     文件        478  2015-11-02 17:20  puzzle\Library\metadata\00\00000000000000001000000000000000.info

    I.A....      4321  2015-11-02 17:20  puzzle\Library\metadata\00\00000000000000002000000000000000

............此处省略905个文件信息

评论

共有 条评论