Unity3D与Node.js通过TCP通信
摘要:Node.js端.需要的库就是我LighterWebEngine的TCP封装. 可以去我的Github上面下载, var tcp = require("./LighterWebEngine/TCP"); tcp.CreateServer(10000, function(){ //初始化回调 }, f
阅读全文
Unity3D不继承MonoBehaviour的类需要Invoke、StartCoroutine的运用
摘要:using UnityEngine; using System.Collections; using System.Collections.Generic; /// <summary> /// 方法执行工具 /// </summary> public static class MethodExeTo
阅读全文
Unity3D-数学2-四元数
摘要:Quaternion.Angle : 返回a和b两者之间的角度 声明形式:public static float Angle ( Quaternion a, Quaternion b ) 它可以计算两个旋转之间的夹角。与Vector3.Angle()作用是一样的。 Quaternion.Euler
阅读全文
Unity3D-数学3-数学符号
摘要:学习数学符号最重要的原因,就是它可以让你用一种非常简洁的方式来表达一个复杂的想法。 没有它,解释每个方程,都需要花上很多页的篇幅。 而这篇文章要告诉你的是,学习这些符号不像你想象的那么难。 Edward R. Scheinerman的Mathematical Notation: A Guide fo
阅读全文
Unity3D-数学1-三角函数
摘要:Math.sin() 与 Math.cos() 用法 Math.sin(x) x 的正玄值。返回值在 -1.0 到 1.0 之间;Math.cos(x) x 的余弦值。返回的是 -1.0 到 1.0 之间的数; 这两个函数中的X 都是指的 “弧度” 而非 “角度”, 弧度的计算公式为: 2*PI /
阅读全文
Unity3D 调用VC和Csharp dll
摘要:1.C#封装的dll 现在vs中创建一个类,里面只要写一个简单的静态类和静态方法就可以了,如下: namespace pnsd { public static class pn { public static string getName(string name) { return name; }
阅读全文
Unity3D C# IEnumerator与 IEnumerable(2) 托管使用
摘要:1. 首先创建单例模式类 using System; using UnityEngine; // 首先定义一个单例模式类并且也继承MonoBehaviour public abstract class MonoSingleton<T> : MonoBehaviour where T : MonoSi
阅读全文
unity3D-攻击移动
摘要:1. 首先是人物的挂载文件 // 定义变量 private IBattleCharacterContainer AttackTargetInfo = null; // 攻击目标信息集合 public Transform AttackTargetTrans = null; // 攻击目标transfo
阅读全文
Unity3D C# Lambda表达式和查询表达式(2)高级使用
摘要:介绍 ·First - 返回集合中的第一个元素;不延迟 ·FirstOrDefault - 返回集合中的第一个元素(如果没有则返回默认值);不延迟 ·Last - 返回集合中的最后一个元素;不延迟 ·LastOrDefault - 返回集合中的最后一个元素(如果没有则返回默认值) ·ElementA
阅读全文
Unity3D C# IEnumerator与 IEnumerable(1) 接口介绍
摘要:1、 接口的使用 (1) 首先定义接口 public interface IBattleMapManager : { Stages CurrentStage { get; } event EventHandler<BeginFightEventArgs> EnterFight; } (2) 用定义实
阅读全文
Unity3D-C# Lambda表达式和查询表达式(1)基本概念
摘要:Lambda表达式也是一种匿名函数(anonymous function),比匿名方法具有更加简洁的表示形式。它可以包含表达式和语句,并且适用于创建委托和事件。 查询表达式: 是一种使用查询语法表示的表达式,它可以从一个或多个给定的数据源中检索数据,并制定检索结果的表现形式。 Lambda表达式:
阅读全文
Unity3D与JAVA交互
摘要:Unity for IOS: 打包是将XCODE工程直接交给开发者,开发者可以在工程的基础上继续添加新的视图,最后由开发者自行打包生成IPA包,发布程序。Unity for Android:打包直接生成APK包,等于说源代码开发者是看不到的,但是Unity的自身确实有些局限,针对Android平台我...
阅读全文
unity3d与Object-C交互
摘要:(1)unity3d 中如何调用IOS的Api1、在C#脚本中使用 (1) 需要导入文件 using System.Runtime.InteropServices; (2) [System.Runtime.InteropServices.DllImport("__Internal")] ext...
阅读全文