
unity
谁来,将海
独立游戏开发者
展开
-
RTSCamera实现
相机控制脚本常规RTS相机的移动缩放using System.Collections;using System.Collections.Generic;using UnityEngine;public class TopCameraController : MonoBehaviour{ public Vector2 cameraOffsetXYSpeed = Vector2.one; public Vector2 cameraOffset = Vector2.one...原创 2020-10-07 17:31:07 · 522 阅读 · 0 评论 -
求目标与角色正前方的夹角
一,unityvector3.angle(vector3 from,vector3 to)函数二,1.先点乘求出怪物到玩家向量和玩家正前方的余弦值float cosValue=Vector3.Dot(player.transform.position, (Enumy.transform.postion-player.transform.position).normalized);...原创 2020-05-01 11:01:49 · 690 阅读 · 0 评论 -
Shader Graph节点记录
https://www.bilibili.com/video/av64761758?from=search&seid=8763489405890794974 记下大佬的讲解Channal Mixer 通道混合,修改某一通道值Contrast 对比度Invert Colors 翻转通道颜色Replace Color修改图中某一颜色Saturation 饱和度White...转载 2020-03-05 23:04:35 · 407 阅读 · 0 评论 -
Unity对子物体的深度优先遍历
b站傅老师教的做下笔记using System.Collections;using System.Collections.Generic;using UnityEngine;public static class TransformHelpers{ public static Transform DeepFind(this Transform parent,string targ...转载 2020-02-22 20:59:37 · 531 阅读 · 0 评论 -
unityAPI实验(一)
- void FixedUpdate(){ - AddGravity(); if(Input.GetKey(KeyCode.Space)){ move.y=Mathf.SmoothDamp(0,1,ref speed,0.1f); Debug.Log("1"); ...原创 2020-02-21 15:22:43 · 223 阅读 · 0 评论 -
动态准星
//得到hit在屏幕的像素位置tarPos = Camera.main.WorldToScreenPoint (hit.point);if(!tar.activeSelf)tar.SetActive(true);//准星在屏幕的位置//安卓不能用resolutionre.anchoredPosition = new Vector2 (tarPos.xresolutions[0].wid...原创 2020-02-19 13:32:49 · 670 阅读 · 0 评论 -
unity导入灰度图无法生成高度地形
之前想试下unity根据灰度图生成地形,导入PNG图片地形的高度不变只是设置的大小变了,后来又将PNG图片导入PS里导出RAW图片试了下还是不行。图片高度无法被unity识别,觉得可能是图片通道问题。最后将PNG转化为单通道的灰度图才能被unity识别地形...原创 2020-02-17 14:44:53 · 2186 阅读 · 1 评论