- 博客(18)
- 收藏
- 关注
原创 【Unity3D_Shader】镜面scrip的名词初步查找
using UnityEngine;using System.Collections;[ExecuteInEditMode] public class Mirror : MonoBehaviour{ //是否需要像素光 public bool m_DisablePixelLights = true; //纹理大小 public int m
2014-10-23 14:19:37
773
原创 【Unity_Shader】笔记_2
vertex shader对整个绘图区域,以中心点为原点,y轴向上,范围[-1, 1];而普通stage坐标是,左上角为原点,y轴向下fragment shader的纹理坐标又不一样,左上角为原点,y轴向下,范围是[0, 1]
2014-10-16 10:36:51
585
原创 【Cocos2d-x】角度转换
CCPoint location = nearEnemy->_sprite->getPosition(); auto vector = location - _sprite->getPosition(); auto radians = atan2f(vector.y, vector.x); auto rotateDeg
2014-10-15 16:26:43
729
原创 【Unity3D_Shader】流水Shader的名词查找和疑问
Shader "Mobile/Transparent/Vertex Color" { Properties { _Color ("Main Color", Color) = (1,1,1,1) _SpecColor ("Spec Color", Color) = (1,1,1,0) _Emission ("Emmisi
2014-10-15 13:31:58
816
原创 【Unity3D_Shader】瞄准器射线Shader
Shader "AngryBots/FX/LaserScope" { Properties { _MainTex ("MainTex", 2D) = "white" _NoiseTex ("NoiseTex", 2D) = "white" } CGINCLUDE #include "UnityCG
2014-10-14 19:18:54
3281
原创 【Unity3D】碰撞检测方案
1.Player ->CharacterControllerObject -> Collider(isTrigger)结果:在双方的OnTriggerEnter中都能检测到对方,双方无物理作用2.Player -> CharacterControllerObject -> RigidBody(!isKinematic)+Collider(!isTrigger)结果:在双
2014-10-11 22:55:51
992
原创 【Unity3D】管理类写法
1.单例private staticA instance;privateintage;privatestringname;public staticAGetInstance(){ if(instance== null){ instance= newA(); instance.age= 10; i
2014-10-11 22:55:15
737
原创 【Unity3D】Raycast使用
1.鼠标点击控制移动1)获得点击坐标,2)根据坐标设置朝向3)沿着朝向向前移动4)当坐标与点击坐标距离小于规定值时停止移动 void Update () { //点击瞬间改变朝向 if(Input.GetMouseButtonDown(0)&&UICamera.hoveredObject == null){
2014-10-11 22:47:52
2528
原创 【Unity3D】主角平缓旋转
1.上下左右直接决定方向void Update () { float v = Input.GetAxis("Vertical"); float h = Input.GetAxis("Horizontal"); if(Mathf.Abs(v)>0 ||Mathf.Abs(h)>0){ Vector3 desireDir =
2014-10-11 22:45:40
569
转载 【Unity3D】Delegate
1.普通代理 public delegate void Delegate (int num); public event Delegate my_delegate ; void Start(){ my_delegate =A.Add; my_delegate +=B.Sub; //或者my_delegate = newD
2014-10-11 22:44:18
456
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人