• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# GameData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中GameData的典型用法代码示例。如果您正苦于以下问题:C# GameData类的具体用法?C# GameData怎么用?C# GameData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GameData类属于命名空间,在下文中一共展示了GameData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: MetricUnits

 public MetricUnits(Field field, GameData data, int[] randSequence)
 {
     _field = field;
     _gameData = data;
     _randSequence = randSequence;
     CalcCommonMetrics();
 }
开发者ID:martugin,项目名称:tetris,代码行数:7,代码来源:MetricConstants.cs


示例2: UpdateUI

    public void UpdateUI(bool isWin, GameData gameData)
    {
        score.text = gameData.Score.ToString();
        bestScore.text = gameData.HighScore.ToString();
        if (isWin)
        {
            best.SetActive(false);
            currentScore.SetActive(false);
            WinText.text = "YOU WIN !";
			loseImage.enabled = false;
            AddFlare();
            SoundManager.instance.PlayingSound("Win", 1, Camera.main.transform.position);
        }
        else
        {
            SoundManager.instance.PlayingSound ("Lose", 1, Camera.main.transform.position);
        }

        if(gameData.isHighScore)
        {
            NewHighScoreText.SetActive(true);
            AddFlare();
        }
        else
        {
            NewHighScoreText.SetActive(false);
        }
    }
开发者ID:li5414,项目名称:Parachute2D,代码行数:28,代码来源:EndUIController.cs


示例3: CheckStatus

 private void CheckStatus()
 {
     if (this.gameData == null)
     {
         this.gameData = GameData.instance;
     }
     if (this.gameGlobalConfig == null)
     {
         this.gameGlobalConfig = GameConfigs.instance.GlobalConfig;
     }
     if (this.gameData.UserInfo != null)
     {
         long[] resourceRecoveryTimes = this.gameData.UserInfo.resourceRecoveryTimes;
         long nowServerTime = ServerTimer.GetNowServerTime();
         int[] resourceRecoveryTime = this.gameGlobalConfig.resourceRecoveryTime;
         int[] resourceRecoveryNum = this.gameGlobalConfig.resourceRecoveryNum;
         int[] nums = new int[4];
         for (int i = 0; i < 4; i++)
         {
             if (((resourceRecoveryTimes.Length > i) && (resourceRecoveryTime.Length > i)) && ((resourceRecoveryNum.Length > i) && ((nowServerTime - resourceRecoveryTimes[i]) > resourceRecoveryTime[i])))
             {
                 nums[i] = resourceRecoveryNum[i];
                 resourceRecoveryTimes[i] = nowServerTime;
             }
         }
         this.gameData.UserInfo.AddAutoProducedResources(nums);
         this.OnResourceUpdateEvent(EventArgs.Empty);
     }
 }
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:29,代码来源:CheckAddResources.cs


示例4: AdventureLoadout

 private void AdventureLoadout(GameData data)
 {
     data.PlayerData.UnlockedElements[0] = Element.Fire;
     data.PlayerData.UnlockedElements[1] = Element.Water;
     data.PlayerData.UnlockedElements[2] = Element.Air;
     data.PlayerData.UnlockedElements[3] = Element.Earth;
 }
开发者ID:Barabicus,项目名称:ATOMFIACHRA,代码行数:7,代码来源:NewGameGUI.cs


示例5: MainForm

        public MainForm()
        {
            InitializeComponent();

            this.currentFileData = new GameData(32, 32);
            this.currentFileName = null;

            this.toolImages = new TextureBrush[7];

            for (int i = 0; i < this.toolImages.Length; i++)
            {
                this.toolImages[i] = new TextureBrush(Image.FromFile("images/" + i + ".png"));
            }

            this.backgroundImage = new TextureBrush(Image.FromFile("images/checkerboard.png"));

            this.selectedTool = 1;

            this.graphicsContext = BufferedGraphicsManager.Current;
            this.graphics = graphicsContext.Allocate(this.StageEditBoard.CreateGraphics(),
                new Rectangle(0, 0, 32 * (int)EDIT_BOARD_SCALING, 32 * (int)EDIT_BOARD_SCALING));

            for(int i = 0; i < MainForm.DIRECTIONS.Length; i++)
                this.StartDirection.Items.Add(DIRECTIONS[i]);

            this.LoadTextureFiles();

            this.FileNew(null, null);
        }
开发者ID:erbuka,项目名称:andrea,代码行数:29,代码来源:MainForm.cs


示例6: Save

    public void Save()
    {

        Debug.Log("Saving");

        BinaryFormatter bf = new BinaryFormatter();
        FileStream file = File.Create(Application.persistentDataPath + "/BBgameData1.dat");
        GameData data = new GameData();

        //assign data fields here

        data.gatLevel_damage = Upgrades.instance.gatLevel_damage;
        data.gatLevel_fireRate = Upgrades.instance.gatLevel_fireRate;
        data.laserLevel_damage = Upgrades.instance.laserLevel_damage;
        data.laserLevel_fireRate = Upgrades.instance.laserLevel_fireRate;
        data.shotGunLevel_damage = Upgrades.instance.shotGunLevel_damage;
        data.shotGunLevel_fireRate = Upgrades.instance.shotGunLevel_fireRate;
        data.rocketLevel_damage = Upgrades.instance.rocketLevel_damage;
        data.rocketLevel_fireRate = Upgrades.instance.rocketLevel_fireRate;

        data.parts = Upgrades.instance.parts;
        data.cores = Upgrades.instance.cores;

        data.lGun = (int)Equipment.instance.leftGun;
        data.rGun = (int)Equipment.instance.rightGun;
        data.body = (int)Equipment.instance.body;
        data.head = (int)Equipment.instance.head;

        bf.Serialize(file, data);
        file.Close();

        Debug.Log("Saving Done");


    }
开发者ID:tread06,项目名称:batterybrawl,代码行数:35,代码来源:GameManager.cs


示例7: Start

	// Use this for initialization
	void Start()
	{
        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        _gameData = new GameData();

        startGameUI.SetActive(true);
		endGameUI.SetActive(false);
		parachute = GameObject.FindGameObjectWithTag("Parachute");
		parachuteController = parachute.GetComponent<ParachuteController>();
		player = GameObject.FindGameObjectWithTag("Pilot");
		playerController = player.GetComponent<PlayerController>();
		playerController.enabled = false;

		Physics2D.gravity = new Vector2(0, 0);

		originPlayerPosition = player.transform.position;
		originParachutePosition = parachute.transform.position;

		trankControllers = level.GetComponentsInChildren<TankCotroller>();

		playerGameObject.SetActive(false);

		SoundManager.instance.startBGM();
       
//        AdMob.requestInterstital( "ca-app-pub-1215085077559999/3564479460", "ca-app-pub-1215085077559999/5180813465" );
//        AdMob.init( "ca-app-pub-1215085077559999/3044727060", "ca-app-pub-1215085077559999/6187409461" );

        gameUIController.UpdateUI(gameData);
    }
开发者ID:li5414,项目名称:Parachute2D,代码行数:31,代码来源:GameController.cs


示例8: Start

    // Use this for initialization
    void Start()
    {
        m_GameData = GameData.Instance;

        m_StreamPath = Environment.GetFolderPath (Environment.SpecialFolder.Desktop);
        m_StreamPath += "/ImagineNation_Recorded_Data";

        if (!Directory.Exists (m_StreamPath))
            Directory.CreateDirectory (m_StreamPath);

        switch (m_GameData.CurrentSection)
        {
            case Sections.Sections_1:
            m_StreamPath = m_StreamPath + "/SectionOne_PositionData";
            break;

            case Sections.Sections_2:
            m_StreamPath = m_StreamPath + "/SectionTwo_PositionData";
            break;

            case Sections.Sections_3:
            m_StreamPath = m_StreamPath + "/SectionThree_PositionData";
            break;
        }
        CheckIfFileExists ();
    }
开发者ID:ZaikMD,项目名称:ImagineNation,代码行数:27,代码来源:PosTracker.cs


示例9: StartController

        public override void StartController()
        {
            Application.targetFrameRate = 30;
            this.gameData=this.GetManager ().GetComponent<GameData>();
            if (this.gameData == null) {
                throw new UnassignedReferenceException("Obiekt "+this.GetManager().gameObject.name+" nie ma komponentu GameData");
            }
            this.guiAssets = this.GetManager ().GetComponent<GuiStatesAssets> ();
            if (this.guiAssets == null) {
                throw new UnassignedReferenceException("Obiekt "+this.GetManager().gameObject.name+" nie ma komponentu GuiStatesAssets");
            }
            /**
             * zliczamy włączenia gry
             */
            this.GetData ().countGames = PlayerPrefs.GetInt ("CountGames");
            this.GetData ().countGames++;
            PlayerPrefs.SetInt ("CountGames",this.GetData ().countGames);
            PlayerPrefs.Save();

            adMob = new AdMob ();
            adMob.StartBanner ();

            this.ChangeState(new States.MainMenuState());
            GameCenter.Authenticate();
        }
开发者ID:uhlryk,项目名称:thief-jumper-mobile-game,代码行数:25,代码来源:StateController.cs


示例10: PlayerGameData

    public PlayerGameData(GameData gameData)
    {
        _gameData = gameData;

        PlayerStats = new PlayerStatsGameData();
        SlavesOwned = new List<Slave>();
    }
开发者ID:Chirmaya,项目名称:FSM,代码行数:7,代码来源:PlayerGameData.cs


示例11: Start

    // Use this for initialization
    void Start()
    {
        activeState = new BeginState(this);
        Debug.Log("This object is of type: " + activeState);

        gameDataRef=GetComponent<GameData>();
    }
开发者ID:Meleeman01,项目名称:Csharpclass,代码行数:8,代码来源:StateManager.cs


示例12: Instance

	public static GameData Instance ()
	{
		if (g_Instance == null) {
			g_Instance = new GameData ();
		}
		return g_Instance;
	}
开发者ID:saoniankeji,项目名称:JumpJump_Pure,代码行数:7,代码来源:GameData.cs


示例13: Start

    private void Start()
    {
        this.gameData = GameData.instance;
        bool flag = false;
        if ((this.activeWhenInEvent == null) || (this.activeWhenInEvent.Length == 0))
        {
            this.targetObj.SetActive(false);
        }
        else
        {
            foreach (MarketingEvents events in this.activeWhenInEvent)
            {
                if (flag)
                {
                    break;
                }
                switch (events)
                {
                    case MarketingEvents.BuildEvent:
                        flag = this.gameData.MarketingDatas.isHasBuildEvent == 1;
                        break;

                    case MarketingEvents.PVEExpEvent:
                        flag = this.gameData.MarketingDatas.isHasPVEEXPEvent == 1;
                        break;

                    case MarketingEvents.PVEExploreEvent:
                        flag = this.gameData.MarketingDatas.isHasPVEExploreEvent == 1;
                        break;
                }
            }
        }
        this.targetObj.SetActive(flag);
    }
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:34,代码来源:ShowActiveMarketingEvent.cs


示例14: Start

	void Start()
	{
		//starts BeginState, sets it to active state
		//passes this script - statemanager - to BeginState so it can use it as reference
		activeState = new BeginState(this);
		gameDataRef = GetComponent<GameData>();
	}
开发者ID:jplebre,项目名称:Books.LearningC-WithUnity,代码行数:7,代码来源:StateManager.cs


示例15: Reinicializar

    public void Reinicializar()
    {
        gameData = new GameData();
        //gameData = new GameData(DataCenter.levels[0].jogos[10]);
        print(gameData.JogoAtual);
        print("Dica 1 " + gameData.Dica(1));
        //yield return new WaitForSeconds(2);

        ReligarBotao();
        imagemJogo.GetComponent<UITexture>().mainTexture = gameData.ImagemDoJogo();

        foreach (GameObject b in botoes)
        {
            b.GetComponentInChildren<UILabel>().text = "";
        }

        for (int i = 0; i < botoes.Length; i++)
        {
            botoes[i].GetComponentInChildren<UILabel>().text = gameData.LetrasBotoes[i].ToString();
            //botoes[i].GetComponentInChildren<UILabel>().ProcessText();
            //print("Texto label: " + i + " " + botoes[i].GetComponentInChildren<UILabel>().text);
            botoes[i].GetComponent<ButtonPress>().indice = i;
           //yield return new WaitForSeconds(0.1f);
        }
        for (int i = 0; i < botoes.Length; i++)
        {
            botoes[i].GetComponentInChildren<UILabel>().text = gameData.LetrasBotoes[i].ToString();
            //print("Texto label: " + i + " " + botoes[i].GetComponentInChildren<UILabel>().text);
            botoes[i].GetComponent<ButtonPress>().indice = i;
            //yield return new WaitForSeconds(0.1f);
        }
    }
开发者ID:SmokingSnake,项目名称:GeekQuiz,代码行数:32,代码来源:GameInit.cs


示例16: Start

    private void Start()
    {
        gameData = GameObject.FindGameObjectWithTag("Master").GetComponent<GameData>();
        SetColor("Red");

        if (transform.position.x > gameData.extent.x)
        {
            farOut = transform.position.x - gameData.extent.x;
        }
        else if (transform.position.x < 0)
        {
            farOut = -transform.position.x;
        }
        else // within the extent of the map
        {
            if (transform.position.z > gameData.extent.z)
            {
                farOut = transform.position.z - gameData.extent.z;
            }
            else if (transform.position.z < 0)
            {
                farOut = -transform.position.z;
            }
        }
    }
开发者ID:bdjnk,项目名称:Demo,代码行数:25,代码来源:PG_Bot.cs


示例17: TryDeleteCharacter

 /// <summary>
 /// Tries to delete the character associated with the object.
 /// The Gameobject passed in should have a RMCharacterUnit component attached to it.
 /// </summary>
 /// <param name="obj"></param>
 public void TryDeleteCharacter(GameData data)
 {
     _targetDeleteGameData = data;
     _descriptionText.text = string.Format(_descriptionTextBaseCached, _targetDeleteGameData.PlayerData.PlayerName);
     // Finally show the window
     UIWindow.GetWindowByCustomID(1).Show();
 }
开发者ID:Barabicus,项目名称:ATOMFIACHRA,代码行数:12,代码来源:RMDeleteCharacter.cs


示例18: SetUp

    public void SetUp(GameData.QuestData data, int questNumber)
    {
        gameObject.SetActive(true);
        requirementsListView.Clear();

        GameData.BuildingData building = GameData.instance.GetBuildingData(data.builds);
        GameData.CharacterData character = GameData.instance.GetCharacterData(data.questGiver);
        this.questNumber = questNumber;
        questData = data;
        title.text = building.name;
        questGiverName.text = character.name;
        questGiverSprite.sprite = character.defaultSprite;
        questGiverSprite.SetNativeSize();
        flavorText.text = data.description;

        bool requirementsMet = true;
        foreach (var key in data.requirements.Keys) {
            string resource = key;
            int required = data.requirements[key];
            int obtained = GameState.instance.resources[resource];
            requirementsListView.Add(resource, required, obtained);
            if (required > obtained) {
                requirementsMet = false;
            }
        }
        buildButton.interactable = requirementsMet;
    }
开发者ID:UnBiHealth,项目名称:fisiogame,代码行数:27,代码来源:QuestPopup.cs


示例19: ProcessAllocRoom

    private GameData ProcessAllocRoom(GameData data)
    {
        if (data.returnCode == ReturnCode.Success)//如果分配成功
        {
            try
            {
                //赋值给全局
                AllocRoomData roomInfoData = JsonCoding<AllocRoomData>.decode(data.operateData);
                Global.Instance.playerRoomData = roomInfoData;
                if (GameClient.Instance.GetGameSceneManager() != null)
                {
                    GameClient.Instance.GetGameSceneManager().gameManager.UpdateGameInfo();
                }

                LogsSystem.Instance.Print("已经分配到房间号:" + roomInfoData.roomID + ",正在载入游戏");

                //载入游戏界面
                Application.LoadLevel("GameScene");
            }
            catch (Exception ex)
            {
                LogsSystem.Instance.Print("分配房间失败:" + ex.ToString(), LogLevel.ERROR);
            }
        }
        else
        {
            LogsSystem.Instance.Print("返回数据为不成功");
        }

        return null;
    }
开发者ID:dannisliang,项目名称:ACGCard-for-Unity3D,代码行数:31,代码来源:TCPGameDataHandler.cs


示例20: NewGame

    public static void NewGame()
    {
        auto = false;
        data = new GameData();
        enemyController = new EnemyController();
        ILevelBuilder generator = new LevelGenerator();

        data.level = generator.Generate();
        for (int i = 0; i < data.level.doors.Count; i++)
        {
            data.level.doors[i].Init();
        }

        data.SpawnPlayer();
        //DEBUG STUFF
        //data.inventory.Add(ItemLibrary.Get().items[5], 1);

        foreach (IGameDataChangeListener listener in GAMEDATA_CHANGE_LISTENERS)
        {
            listener.OnGameDataChange(data);
        }

        //ConsolePseudoRaycast.CastRay(new Vector2(14, 1), new Vector2(16, 3));
        //Console.ReadKey();
    }
开发者ID:kevinwegner,项目名称:ConsoleDungeonCrawler,代码行数:25,代码来源:Application.cs



注:本文中的GameData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# GameDataCacheSet类代码示例发布时间:2022-05-24
下一篇:
C# GameController类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap