unity3dC# 教程
文章平均质量分 60
nonomagenet
手机游戏设计unity3d
展开
-
噩梦5 敌人血量
using UnityEngine;namespace CompleteProject{ public class EnemyManager : MonoBehaviour { public PlayerHealth playerHealth; // Reference to the player's heatlh. public原创 2015-07-25 16:24:37 · 693 阅读 · 0 评论 -
音频管理器 ,Dictionary字典的用法
Dictionary字典的用法public AudioClip[] AudioClipArray; private static Dictionary _DicAudioClipLib; void Awake() { _DicAudioClipLib = new Dictionary(); foreach (AudioClip audioClip原创 2015-10-15 11:24:25 · 614 阅读 · 0 评论 -
iTween.MoveTo用法
iTween是物体移动的插件。 第一种写法 iTween.MoveTo(goHero.gameObject,trTargetPosition.position,2F) 要移动的物体 目标物体 用时 第二种写法原创 2015-10-11 16:18:26 · 7145 阅读 · 0 评论 -
Toggle开关
using UnityEngine;using System.Collections;using UnityEngine.UI;public class MyToggle : MonoBehaviour{ public GameObject isOnGameObject; public GameObject isOffGameObject;原创 2015-09-16 13:41:35 · 1764 阅读 · 0 评论 -
滑动翻页的实现5.1 拖拽结束接口
using UnityEngine;using System.Collections;using UnityEngine.EventSystems;using UnityEngine.UI;//添加了两个拖拽开始拖拽结束接口,对滑动进行检测public class LevelButtonScrollRect : MonoBehaviou,IBeginDragHandler,原创 2015-09-15 09:05:47 · 859 阅读 · 0 评论 -
技能冷却UGUI5.1
using UnityEngine;using System.Collections;using UnityEngine.UI;public class SkillItem : MonoBehaviour{ public float coldTime = 2; public KeyCode keycode; private float time原创 2015-09-14 10:09:06 · 691 阅读 · 0 评论 -
雨谈老师塔防摄像头移动归位 围绕选定对象旋转
using UnityEngine;using System.Collections;public class CameraContorl : MonoBehaviour {public float minFov=15.0f;public float maxFov=150.0f;public float sensitivity = 10f;private Trans原创 2015-09-01 14:52:06 · 550 阅读 · 0 评论 -
Loader 管理gameMansager 和soundmanager
using UnityEngine;using System.Collections;namespace Completed{ public class Loader : MonoBehaviour {public GameObject gameManager;//GameManager prefab to instantiate.public GameOb原创 2015-08-03 09:33:43 · 413 阅读 · 0 评论 -
Rogue BoardManager 自动成成内外墙 和食物 敌人
using UnityEngine;using System;using System.Collections.Generic; //Allows us to use Lists.允许使用数组using Random = UnityEngine.Random;//使用unity自己的随机引擎namespace Completed{public cla原创 2015-08-02 17:57:56 · 723 阅读 · 0 评论 -
塔防TDTK 敌人移动到目标转向
using UnityEngine;using System.Collections;public class enimiy : MonoBehaviour {public Transform target;public float moveSpeed =1;private Transform thisT;void Start () {}原创 2015-08-17 12:01:48 · 971 阅读 · 0 评论 -
拾荒者心得
动画触发条件 Trigger 与bool 相似,不同在于执行后会自动回复 原状态 Has ExitTime 退出时间 动画的播放完在转换 设为1 表示 完整的播放 Setings 里有个TranstionDruation 这个是3D平滑 2D用不到 要设为0原创 2015-07-30 11:44:13 · 976 阅读 · 0 评论 -
游戏暂停界面 和 音量开关 背景音乐 音效调节
using UnityEngine;using System.Collections;using UnityEngine.UI;using UnityEngine.Audio;#if UNITY_EDITORusing UnityEditor;#endifpublic class PauseManager : MonoBehaviour {public原创 2015-07-28 17:15:41 · 7271 阅读 · 0 评论 -
噩梦 游戏结束 检测血量执行动画
using UnityEngine;namespace CompleteProject{ public class GameOverManager : MonoBehaviour { public PlayerHealth playerHealth; // Reference to the player's health.原创 2015-07-28 18:34:38 · 3147 阅读 · 0 评论 -
噩梦5 camera跟随
namespace CompleteProject{ public class CameraFollow : MonoBehaviour { public Transform target; // The position that that camera will be following. public floa原创 2015-07-28 15:59:05 · 531 阅读 · 0 评论 -
噩梦5Tilt Shift (Lens Blur) 倾斜移位(镜头模糊)
using UnityEngine;using System.Collections;namespace CompleteProject{ public class CameraFollow : MonoBehaviour { public Transform target; // The position that that camera will be following. public fl原创 2015-07-25 16:37:51 · 1262 阅读 · 0 评论 -
噩梦5 BloomOptimized 物体人物发光
using System;using UnityEngine;namespace UnitySampleAssets.ImageEffects{ [ExecuteInEditMode] [RequireComponent (typeof(Camera))] [AddComponentMenu ("Image Effects/Bloom and Gl原创 2015-07-25 16:45:38 · 1361 阅读 · 0 评论 -
噩梦射手5 角色血量 死亡 重新加载
using UnityEngine;using UnityEngine.UI;using System.Collections;namespace CompleteProject{ public class PlayerHealth : MonoBehaviour { public int startingHealth = 100;原创 2015-07-25 16:18:46 · 1338 阅读 · 0 评论 -
噩梦射手5 移动 转向 这个没有加速的过程 不适合rpg人物 把移动检测去掉
using UnityEngine;using UnitySampleAssets.CrossPlatformInput;namespace CompleteProject{ public class PlayerMovement : MonoBehaviour { public float speed = 6f; /原创 2015-07-25 15:44:31 · 1338 阅读 · 0 评论