資源簡介
憤怒的小鳥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個文件信息
評論
共有 條評論