09 2011 档案
摘要:使用csc命令将.cs文件编译成.dll的过程很多时候,我们需要将.cs文件单独编译成.dll文件, 操作如下:打开命令窗口->输入cmd到控制台->cd C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322转到vs.net安装的该目录下->执行csc命令csc /target:library File.cs->在该目录下产生一个对应名字的.dll文件(前提:把.cs文件放到C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322目录下)csc命令的方式很多,请参考以下译 File.cs 以产生 Fil
阅读全文
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Diagnostics;namespace WindowsFormsApplication4{ public partial class Form1 : Form { public Form1() { Initialize
阅读全文
摘要:// Detects manually if anObject is being seen by the main cameravar anObject : GameObject;private var cam : Camera;private var planes : Plane[];function Start() {cam = Camera.main;planes = GeometryUtility.CalculateFrustumPlanes(cam);}function Update() {if(GeometryUtility.TestPlanesAABB(planes,anObje
阅读全文
摘要:var selectHero : GameObject;function Update () { if(selectHero){ var dist = Vector3.Distance(selectHero.transform.position, transform.position);var direction:Vector3=selectHero.transform.position - transform.position; if(dist<10){ var selectHeroLocalPosition : Vector3 = selectHero.transform.Trans
阅读全文
摘要://做宽屏遮挡的代码var aTexture : Texture;//指定一张黑色贴图function OnGUI() {if(!aTexture){Debug.LogError("Assign a Texture in the inspector.");return;}GUI.DrawTexture(Rect(0,0,Screen.width,Screen.height/6), aTexture, ScaleMode.StretchToFill, true, 10.0f);GUI.DrawTexture(Rect(0,Screen.height*5/6,Screen.wi
阅读全文
摘要:// Per pixel bumped refraction.// Uses a normal map to distort the image behind, and// an additional texture to tint the color.Shader "HeatDistort" {Properties {_BumpAmt ("Distortion", range (0,128)) = 10_MainTex ("Tint Color (RGB)", 2D) = "white" {}_BumpMap (
阅读全文
摘要:var iconTexture : Texture;var nameOfObj : String = "Put your Object name";var inventory : GameObject;private var decr : boolean;function Start(){ decr = false;}function OnMouseOver(){ ToggleAlpha(0.3,1); if(Input.GetMouseButtonDown(0)) { renderer.material.color.a = 1; inventory.GetComponen
阅读全文
摘要:function Start(){ transform.GetComponent(GUITexture).enabled = false;}function Update () { transform.position = Vector3(Input.mousePosition.x/Screen.width,Input.mousePosition.y/Screen.height,0);}function ReleaseCursorIcon(){ transform.GetComponent(GUITexture).enabled = false;Screen.showCursor = true
阅读全文
摘要:var bagName:String = "set a name for bag";var bagBtnName:String = "Bag button name here";var posBagBtn:Vector2 = Vector2(50,50);var slotSize: float = 40;var spacingBetweenSlots :float = 5;var defaultTextureSlot:Texture;var bagNumber:int;private var numSlot = 16;private var offset
阅读全文
摘要:var mouseTextureHander : MouseTextureHanding;private var buttonClicked : boolean = false;//获取按钮是否按下private var objAttached : boolean = false; //TRUE 当一个模型从背包中选择private var posBags: Vector2[];private var flagAvailable : Array;private var indexBags:int;private var toggleAllBags :boolean = false;privat
阅读全文
摘要:var playerPrefab : Transform;function OnGUI() { if (GUI.Button(Rect(10,70,50,30),"Click")) { //if (networkView.isMine) // { Network.Instantiate(playerPrefab, transform.position, transform.rotation, 0);//}}}function OnPlayerDisconnected (player : NetworkPlayer){Debug.Log("Server destro
阅读全文
摘要:function OnNetworkInstantiate (msg : NetworkMessageInfo) {// This is our own playerif (networkView.isMine){Camera.main.SendMessage("SetTarget", transform);GetComponent("NetworkInterpolatedTransform").enabled = false;}// This is just some remote controlled playerelse{name += "
阅读全文
摘要:using UnityEngine;using System.Collections;public class NetworkInterpolatedTransform : MonoBehaviour {public double interpolationBackTime = 0.1; internal struct State{internal double timestamp;internal Vector3 pos;internal Quaternion rot;}// We store twenty states with "playback" informati
阅读全文
摘要:using UnityEngine;using System.Collections;using System;public class NetworkSyncAnimation : MonoBehaviour {public enum AniStates {walk = 0,run,kick,punch,jump,jumpfall,idle,gotbit,gothit,walljump,deathfall,jetpackjump,ledgefall,buttstomp,jumpland}public AniStates currentAnimation = AniStates.idle;pu
阅读全文

浙公网安备 33010602011771号