当前位置: 首页>>代码示例>>C#>>正文


C# CharacterData类代码示例

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


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

示例1: createButton

    public void createButton()
    {
        string nick = GameObject.Find ("Canvas/CreatePanel/NickInput/Text").GetComponent<Text> ().text;

        if (nick.Length < 3 || Service.db.SelectCount ("FROM characters WHERE name = ?", nick) != 0) {
            return;
        }

        int inicialHealth = 270;
        int inicialMana = 130;

        CharacterData character = new CharacterData
        {
            name = nick,
            model = "male_01",
            position = "",
            level = 1,
            health = inicialHealth,
            maxHealth = inicialHealth,
            mana = inicialMana,
            maxMana = inicialMana,
            money = 234670,
            id = Service.db.Id(1)
        };
        bool sucess = character.create();

        if (sucess) {
            Menu.Instance.showPanel("MainPanel");
        } else {
            Debug.Log("Something went wrong");
        }
    }
开发者ID:hefanzhou,项目名称:hogwarts,代码行数:32,代码来源:CreatePanel.cs

示例2: AddBlocks

    public void AddBlocks(bool[] blocks, CharacterData characterData)
    {
        var eyeInBadCondition = manager.GetEyeRoom().GetScoreNegative();

        for (var i = 0; i < blocks.Length; i++)
        {
            if (blocks[i])
            {
                /*
                 * Check if we have enough spare blocks in the queue
                 * otherwise we'll need to make some more.
                 */
                if (_blockQueue.Count == 0)
                    QueueUpNewBarBlocks(3);

                var block = _blockQueue.Dequeue();
                block.characterData = characterData;

                //  Chance to be bad
                if (-eyeInBadCondition > Random.Range(0.0f, 1.0f))
                    block.newColor = Color.white;

                _blocksToAdd.Enqueue(block);

            }
            else
            {
                //  We add null here so that we can use it as a placeholder for
                //  an empty block in the column.
                _blocksToAdd.Enqueue(null);
            }
        }
    }
开发者ID:Avatarchik,项目名称:Mind-Hero,代码行数:33,代码来源:RoomBar.cs

示例3: InitEntry

 public void InitEntry(int index)
 {
     if (index < enemies.Count)
         enemies[index] = new CharacterData();
     else
         Debug.Log("index does not exist!");
 }
开发者ID:ullizei,项目名称:pirates,代码行数:7,代码来源:EnemyDatabase.cs

示例4: SetupRenderer

 void SetupRenderer(CharacterData data)
 {
     CharacterView = data.CharacterView.Instantiate();
     CharacterView.name = "Skeleton";
     CharacterView.transform.SetParent(transform, false);
     CharacterView.transform.localPosition = Vector3.zero;
 }
开发者ID:choihb,项目名称:snugdc-project-sprpg,代码行数:7,代码来源:CampCharacter.cs

示例5: getClone

	public CharacterData getClone ()
	{
		CharacterData characterToReturn = new CharacterData ( myID, name, position[0], position[1], characterValues[CHARACTER_ACTION_TYPE_POWER], characterValues[CHARACTER_ACTION_TYPE_DAMAGE],
			characterValues[CHARACTER_ACTION_TYPE_RANGE], characterValues[CHARACTER_ACTION_TYPE_AREA], characterValues[CHARACTER_ACTION_TYPE_ATTACK_RATE], characterValues[CHARACTER_ACTION_TYPE_BUILD_RATE],
			characterValues[CHARACTER_ACTION_TYPE_DEMOLISH_RATE], characterValues[CHARACTER_ACTION_TYPE_RAPAIR_RATE], characterValues[CHARACTER_ACTION_TYPE_RESCUING] );
		
		return characterToReturn;
	}
开发者ID:rtumelty,项目名称:ridiculousrescue,代码行数:8,代码来源:CharacterData.cs

示例6: Awake

 public override void Awake()
 {
     base.Awake();
     atkAnimKeyFrame = 14;
     CharacterData tempData = new CharacterData(new Hashtable(){{"type","pet"},{"hp",1000},{"mspd",170},{"aspd",0},{"atk",0},{"def",30},{"rewardCoins",0},{"rewardExp",0},{"cstk",0},{"evd",0},{"stk",0}});
     initData(tempData);
     hideHpBar();
 }
开发者ID:rogeryuan99,项目名称:Hello,代码行数:8,代码来源:Pet.cs

示例7: createEnemyByType

 public static GameObject createEnemyByType(string type, Vector3 pos)
 {
     GameObject pref = CacheMgr.getEnemyPrb (type) as GameObject;//Resources.Load("enemies/enemy"+type);
     GameObject enemyObj = Instantiate (pref, pos, new Quaternion (0, 0, 0, 0)) as GameObject;
     Enemy enemyDoc = enemyObj.GetComponent<Enemy> ();
     CharacterData characterD = new CharacterData (EnemyDataLib.instance [type] as Hashtable);
     enemyDoc.initData (characterD);
     return enemyObj;
 }
开发者ID:rogeryuan99,项目名称:Hello,代码行数:9,代码来源:DataViewer.cs

示例8: wizardPageContainer1_Finished

 private void wizardPageContainer1_Finished(object sender, EventArgs e)
 {
     CharacterData cd = new CharacterData();
     if (this.comboBox1.SelectedIndex == 0) cd.isMale = true;
     else cd.isMale = false;
     cd.Name = this.textBox1.Text;
     Plr = cd;
     Close();
 }
开发者ID:Ray1235,项目名称:TAGE,代码行数:9,代码来源:CharacterCreate.cs

示例9: Create

	public static Character Create(CharacterData character)
	{
		var go = GameObject.Instantiate(PrefabSettings.main.characterDisplayPrefab);
		go.name = character.name;

		var component = go.GetComponent<Character>();
		component.characterData = character;

		return component;
	}
开发者ID:tdmann,项目名称:happycult,代码行数:10,代码来源:Character.cs

示例10: Create

	public static SingleGoalDisplay Create(CharacterData goalCharacter)
	{
		var go = GameObject.Instantiate(PrefabSettings.main.singleGoalDisplayPrefab);
		go.name = goalCharacter.name;

		var component = go.GetComponent<SingleGoalDisplay>();
		component.goalCharacter = goalCharacter;

		return component;
	}
开发者ID:tdmann,项目名称:happycult,代码行数:10,代码来源:SingleGoalDisplay.cs

示例11: Awake

	private void Awake ()
	{
		if (GetComponent<PlayerInput> () != null) {
			isPlayer = true;
		}

		_characterData = gameObject.GetComponent<CharacterData> ();
		GetComponent<Animation> ().Play ();
		SetMouth (Random.Range (1, 3));
	}
开发者ID:Darkfafi,项目名称:Global_Game_Jam_2016,代码行数:10,代码来源:Character.cs

示例12: OnClickChCard

    private void OnClickChCard(CharacterData chData)
    {
        GameObject sceneToSceneData = GameObject.Find("SceneToScene_datas");
        sceneToSceneData.GetComponent<SceneToScene_Data>().gameChDatas.Clear();
        sceneToSceneData.GetComponent<SceneToScene_Data>().gameChDatas.Add("chName", chData.chName);
        sceneToSceneData.GetComponent<SceneToScene_Data>().gameChDatas.Add("chLevel", chData.chLevel.ToString());
        sceneToSceneData.GetComponent<SceneToScene_Data>().gameChDatas.Add("chType", chData.chType);
        sceneToSceneData.GetComponent<SceneToScene_Data>().gameChDatas.Add("detailScript", chData.detailScript);

        SceneManager.LoadSceneAsync("popup_chInfo", LoadSceneMode.Additive);
    }
开发者ID:opk4406opk,项目名称:HELLO_MY_WORLD,代码行数:11,代码来源:ChSelectManager.cs

示例13: Awake

 public override void Awake()
 {
     base.Awake();
     //		id = EnemyMgr.getID();
     //		EnemyMgr.enemyHash[id] = this;
     atkAnimKeyFrame = 13;
     CharacterData characterD = new CharacterData(new Hashtable(){{"type","freezeGuyEft"},{ "hp",500},{ "mspd",0},{ "aspd",0},{ "atk",0},{ "def",0},{ "rewardCoins",0},{ "rewardExp",0},{ "cstk",0},{ "evd",0},{ "stk",0}});
     initData(characterD);
     this.hpBar.hideHpBar();
     //		MsgCenter.instance.addListener(MsgCenter.FREEZE_DEAD, heroDead);
 }
开发者ID:rogeryuan99,项目名称:Hello,代码行数:11,代码来源:EnemyIceBlock.cs

示例14: Start

    void Start()
    {
        db = GlobalVars.database;

        db.AddCharacter(new CharacterData("You"));

        CharacterData cd = new CharacterData("Sally");
        cd.AddTopic(new TopicData("Cookies",topic));
        cd.AddAvaliableTopic(0);
        db.AddCharacter(cd);
    }
开发者ID:ChasmGamesProject,项目名称:UnityGameRepository,代码行数:11,代码来源:Temp.cs

示例15: Start

    // Use this for initialization
    void Start()
    {
        Team = GameObject.Find("GameControlCenter").GetComponent<CharacterTeam> ();
        enTeam = GameObject.Find("EnemyTeam").GetComponent<CharacterTeam> ();
        chDT = GameObject.Find ("GameControlCenter").GetComponent<CharacterData> ();

        for (int i=0; i<chDT.character.Count; i++)
            if (chDT.character[i].chID == ID) {
            ch = i;
            break;
        }
    }
开发者ID:fannnn,项目名称:JoblessFatOtaku,代码行数:13,代码来源:UnitControl.cs


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