资源简介
愤怒的小鸟unity3d版本,C#脚本编写,素材齐全,功能完整。
代码片段和文件信息
/* Copyright (C) 2011 by IGAMEMAKER.COM
Permission is hereby granted free of charge to any person obtaining a copy
of this software and associated documentation files (the “Software“) to deal
in the Software without restriction including without limitation the rights
to use copy modify merge publish distribute sublicense and/or sell
copies of the Software and to permit persons to whom the Software is
furnished to do so subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
using UnityEngine;
using System.Collections;
public class Camerascript : MonoBehaviour {
// Use this for initialization
public bool bDebug;
public Gameobject farBackground;
public Gameobject midBackground;
private Gameobject bgInstance;
private Gameobject mgInstance;
private Vector3 slingShotPosition;
private Vector3 furthestobjectivePosition;
private float time;
void Start () {
bDebug=false;
// Get some location information
//slingShotPosition = Gameobject.Find(“SlingShotStand“).transform.position;
slingShotPosition = gameobject.transform.position; // Use intital camera positioning to return to
// For now grab the furthest right of all of the objective objects
furthestobjectivePosition = Vector3.zero;
Gameobject[] gos;
gos = Gameobject.FindGameobjectsWithTag(“objective“);
foreach(Gameobject go in gos)
{
if (go.transform.position.x > furthestobjectivePosition.x)
{
furthestobjectivePosition = go.transform.position;
}
}
// Set initial position to furthest
float x = furthestobjectivePosition.x;
transform.position = new Vector3(x transform.position.y transform.position.z);
time = Time.time;
if (null!=farBackground)
{
bgInstance = Instantiate(farBackground new Vector3(x transform.position.y 100.0f) Quaternion.Euler(0 0 90)) as Gameobject;
bgInstance.transform.localScale = new Vector3(150.0f 150.0f 1.0f);
}
if (null!=midBackground)
{
mgInstance = Instantiate(midBackground GetMidBackgroundPosition(x) Quaternion.Euler(-90 0 0)) as Gameobject;
mgInstance.transform.localScale = new Vector3(50.0f 50.0f 50.0f);
}
}
Vector3 GetMidBackgroundPosition(float x)
{
// Scale to one third of the horizontal movement of the range from slingshot to end objective
float rx = furthestobjectivePosition.x - slingShotPosition.x;
float dx = x - slingShotPosition.x;
// Move 1/3rd the distance
return ne
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-11-20 13:03 .vs\
目录 0 2018-11-20 13:03 .vs\Project1120_1\
目录 0 2018-11-20 13:03 .vs\Project1120_1\v14\
文件 52736 2018-11-21 17:07 .vs\Project1120_1\v14\.suo
文件 5537 2018-11-20 12:58 Assembly-CSharp.csproj
目录 0 2018-11-20 12:58 Assets\
文件 192 2018-11-20 12:58 Assets\Audio.me
目录 0 2018-11-20 12:58 Assets\Audio\
文件 70432 2011-04-29 12:31 Assets\Audio\Boing.wav
文件 463 2018-11-20 12:58 Assets\Audio\Boing.wav.me
文件 30800 2011-04-29 12:31 Assets\Audio\GlassHit1.wav
文件 463 2018-11-20 12:58 Assets\Audio\GlassHit1.wav.me
文件 86544 2011-04-29 12:31 Assets\Audio\Impact-old1.wav
文件 463 2018-11-20 12:58 Assets\Audio\Impact-old1.wav.me
文件 50288 2011-04-29 12:31 Assets\Audio\Impact.wav
文件 463 2018-11-20 12:58 Assets\Audio\Impact.wav.me
文件 18546 2011-04-29 12:31 Assets\Audio\WoodHit1.wav
文件 463 2018-11-20 12:58 Assets\Audio\WoodHit1.wav.me
文件 75888 2011-04-29 12:31 Assets\Audio\Woohoo.wav
文件 463 2018-11-20 12:58 Assets\Audio\Woohoo.wav.me
文件 84184 2011-04-29 12:31 Assets\Audio\Yipee.wav
文件 463 2018-11-20 12:58 Assets\Audio\Yipee.wav.me
文件 192 2018-11-20 12:58 Assets\Fonts.me
目录 0 2018-11-20 12:58 Assets\Fonts\
文件 4227 2011-04-29 12:31 Assets\Fonts\OFL - Copyright.txt
文件 178 2018-11-20 12:58 Assets\Fonts\OFL - Copyright.txt.me
文件 17596 2011-04-29 12:31 Assets\Fonts\Sniglet_Regular.otf
文件 500 2018-11-20 12:58 Assets\Fonts\Sniglet_Regular.otf.me
文件 17596 2011-04-29 12:31 Assets\Fonts\Sniglet_Small.otf
文件 431 2018-11-20 12:58 Assets\Fonts\Sniglet_Small.otf.me
文件 192 2018-11-20 12:58 Assets\Global.me
............此处省略1063个文件信息
相关资源
- C#进销存系统.zip
- C# RedisDemo Redisdll 全部DLL
- halcon联合C#实现图像实时采集使用Ba
- c#编写的绘图软件源码
- c#微信支付、微信企业支付到个人,微
- Adaboost人脸检测的emgu实现C#
- Unity in Action: Multiplatform Game Developmen
- C#定时调度任务服务
- C#读写EXCEl支持xlsx
- qq聊天程序--C#版
- C# VS2010 甘特图
- 数据恢复之星源代码
- AO+C# 二次开发版本基本功能源代码使
- 图书管理系统 c# asp .net 图书管理系统
- C#监测系统源码 C#监控计算机 C# 脱离
- C#三层架构Library管理系统
- [C#源码]超市项目BS架构
- 网络安全LSB算法 采用C# 实现文字的隐
- Modbus通讯协议-C#源码
- ASP.NET在线学习平台网站源码
- 基于C#.NET的Autocad二次开发范例
- 热敏打印机C#二次开发包DLL
- 发票套打[全C#源码]
- C#图书管理系统-----
- apk信息查看C#源码
- 达内培训的C# PPT原版
- 自做项目——打地鼠C#
- C#开发的聊天小程序
- C#学生宿舍管理系统
- C#图书管理系统,主要treeview和listvi
评论
共有 条评论