赞
踩
- using UnityEngine;
- using System.Collections;
- using System.Collections.Generic;
- /// <summary>
- /// 脚本挂载到墙上
- /// </summary>
-
- public class ImageFusion : MonoBehaviour {
-
-
- public Texture2D bulletTexture; // 【图片】弹痕
- private Texture2D wallTexture; // 【图片】墙
- private Texture2D NewWallTexture; // 【图片】墙的备份
-
-
- private float wall_height; // 【获取墙和弹痕图片的宽高信息】
- private float wall_width;
-
- private float bullet_height;
- private float bullet_width;
-
- RaycastHit hit; // 获取子弹打击点
-
- private Queue<Vector2> uiQueues; // 存储像素点信息
-
- // Use this for initialization
- void Start () {
- uiQueues = new Queue<Vector2> ();
-
- wallTexture = GetComponent<MeshRenderer> ().material.mainTexture as Texture2D;
- // 【备份墙的图片】
- NewWallTexture = Instantiate (wallTexture);
-
- GetComponent<MeshRenderer> ().material.mainTexture = NewWallTexture;
-
- wall_height = wallTexture.height;
- wall_width = wallTexture.width;
-
- bullet_h
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。