纳金网
标题:
模仿狙击枪开镜的代码
[打印本页]
作者:
may
时间:
2015-8-31 07:07
标题:
模仿狙击枪开镜的代码
模仿狙击枪开镜的代码
using UnityEngine;
using System.Collections;
public class Scope : MonoBehaviour {
public bool click = false;
// Use this for initialization
void Start () {
GetComponent<Camera>();
}
void OnClicks() {
if (Input.GetMouseButtonDown(1))
{
click = !click;
}
if (click)
{
camera.depth = -1;
}
else
{
camera.depth = 1;
}
}
// Update is called once per frame
void Update () {
OnClicks();
}
}
复制代码
欢迎光临 纳金网 (http://go.narkii.com/club/)
Powered by Discuz! X2.5