91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 36.84MB
    文件類型: .zip
    金幣: 1
    下載: 0 次
    發布日期: 2023-08-08
  • 語言: 其他
  • 標簽: unity2017??

資源簡介

憤怒的小鳥, 源碼,里面涉及了unity許多的組件內容,可以很好的學習,初級unity可以學習,

資源截圖

代碼片段和文件信息

using?System.Collections;
using?System.Collections.Generic;
using?UnityEngine;
using?UnityEngine.SceneManagement;

public?class?GameManager?:?MonoBehaviour?{

????public?List?birds;
????public?List?pig;
????public?static?GameManager?_instance;?//?單例
????private?Vector3?originPos;???????????//?記錄第一只小鳥的位置,第一只小鳥飛出的時候,第二只小鳥接著上第一只小鳥的位置


????public?Gameobject?win;??//?贏得界面
????public?Gameobject?lose;

????public?Gameobject[]?stars;??//?展示星星的數組
????private?int?starsNum?=?0;???//?這局得到星星的個數
????private?int?totalNum?=?10;???//?總關卡數量,用于記錄總的星星個數
????
????private?void?Awake()
????{
????????_instance?=?this;
????????if(?birds.Count?>?0){
????????????originPos?=?birds[0].transform.position;

????????}
????}

????private?void?Start()
????{
????????Init();
????}
????//ss
????///?
????///?初始化小鳥
????///?

????private?void?Init()
????{
????????for?(int?i?=?0;?i?????????????if?(i?==?0)
????????????{?//?第一只小鳥
????????????????birds[i].transform.position?=?originPos;
????????????????birds[i].enabled?=?true;
????????????????birds[i].sp.enabled?=?true;
????????????????birds[i].canMove?=?true;
????????????}
????????????else?{
????????????????birds[i].enabled?=?false;
????????????????birds[i].sp.enabled?=?false;
????????????????birds[i].canMove?=?false;
????????????}
????????}
????}

????///?
????///?判定游戲邏輯
????///?

????public?void?NextBird()
????{
????????if?(pig.Count?>?0)
????????{
????????????if?(birds.Count?>?0)
????????????{?
????????????????//?下一只飛
????????????????Init();
????????????}
????????????else?{
????????????????//?輸了
????????????????lose.SetActive(true);
????????????}
????????}
????????else?{
????????????//?贏了
????????????win.SetActive(true);
????????}
????}

????public?void?ShowStarts()
????{
????????StartCoroutine(“show“);
????}

????IEnumerator?show()
????{
????????for?(;?starsNum?????????{
????????????if?(starsNum?>=?stars.Length)?{
????????????????break;
????????????}
????????????yield?return?new?WaitForSeconds(0.2f);
????????????stars[starsNum].SetActive(true);
????????}
????}

????///?
????///?重新開始玩
????///?

????public?void?Replay()
????{
????????SaveData();
????????SceneManager.LoadScene(2);
????}

????///?
????///?返回首頁
????///?

????public?void?Home()?{
????????SaveData();
????????SceneManager.LoadScene(1);
????}

????public?void?SaveData()?{
????????//?只存儲每關的最大值
????????if?(starsNum?>?PlayerPrefs.GetInt(PlayerPrefs.GetString(“nowLevel“)))?{
????????????PlayerPrefs.SetInt(PlayerPrefs.GetString(“nowLevel“)?starsNum);
????????}

????????int?sum?=?0;
????????for?(int?i?=?1;?i?????????????sum?+=?PlayerPrefs.GetInt(“level“?+?i.ToString());
????????}
????????PlayerPrefs.SetInt(“totalNum“sum);?//?存儲總星星個數
????}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-04-23?19:18??AngryBird\
?????目錄???????????0??2018-04-09?14:31??AngryBird\.git\
?????文件??????????40??2018-04-09?14:31??AngryBird\.git\COMMIT_EDITMSG
?????文件??????????23??2018-04-09?14:31??AngryBird\.git\HEAD
?????文件?????????770??2018-04-09?14:31??AngryBird\.git\config
?????文件??????????73??2018-04-09?14:31??AngryBird\.git\description
?????目錄???????????0??2018-04-09?14:31??AngryBird\.git\hooks\
?????文件?????????478??2018-04-09?14:31??AngryBird\.git\hooks\applypatch-msg.sample
?????文件?????????896??2018-04-09?14:31??AngryBird\.git\hooks\commit-msg.sample
?????文件?????????189??2018-04-09?14:31??AngryBird\.git\hooks\post-update.sample
?????文件?????????424??2018-04-09?14:31??AngryBird\.git\hooks\pre-applypatch.sample
?????文件????????1642??2018-04-09?14:31??AngryBird\.git\hooks\pre-commit.sample
?????文件????????1348??2018-04-09?14:31??AngryBird\.git\hooks\pre-push.sample
?????文件????????4951??2018-04-09?14:31??AngryBird\.git\hooks\pre-rebase.sample
?????文件?????????544??2018-04-09?14:31??AngryBird\.git\hooks\pre-receive.sample
?????文件????????1239??2018-04-09?14:31??AngryBird\.git\hooks\prepare-commit-msg.sample
?????文件????????3610??2018-04-09?14:31??AngryBird\.git\hooks\update.sample
?????文件?????????225??2018-04-09?14:31??AngryBird\.git\index
?????目錄???????????0??2018-04-09?14:31??AngryBird\.git\info\
?????文件?????????240??2018-04-09?14:31??AngryBird\.git\info\exclude
?????目錄???????????0??2018-04-09?14:31??AngryBird\.git\logs\
?????文件?????????193??2018-04-09?14:31??AngryBird\.git\logs\HEAD
?????目錄???????????0??2018-04-09?14:31??AngryBird\.git\logs\refs\
?????目錄???????????0??2018-04-09?14:31??AngryBird\.git\logs\refs\heads\
?????文件?????????193??2018-04-09?14:31??AngryBird\.git\logs\refs\heads\master
?????目錄???????????0??2018-04-09?14:31??AngryBird\.git\objects\
?????目錄???????????0??2018-04-09?14:31??AngryBird\.git\objects\1f\
?????文件?????????751??2018-04-09?14:31??AngryBird\.git\objects\1f\f0c423042b46cb1d617b81efb715defbe8054d
?????目錄???????????0??2018-04-09?14:31??AngryBird\.git\objects\3c\
?????文件????????2112??2018-04-09?14:31??AngryBird\.git\objects\3c\4efe206bd0e7230ad0ae8396a3c883c8207906
?????目錄???????????0??2018-04-09?14:31??AngryBird\.git\objects\91\
............此處省略1784個文件信息

評論

共有 條評論