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

C# CharacterData类代码示例

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

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



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


示例16: Start

    void Start()
    {
        this.characterData = new CharacterData(new AttackAttribute(this.attackDefaultValue.value, this.attackDefaultValue.multiplier),
                                           new DefenseAttribute(this.defenseDefaultValue.value, this.defenseDefaultValue.multiplier),
                                           new SpeedAttribute(this.speedDefaultValue.value, this.speedDefaultValue.multiplier),
                                           new HealthAttribute(this.healthDefaultValue.value, this.healthDefaultValue.multiplier));

        this.unitID = new UnitIdentity(this.unitName);
        this.PrintCharacterStats();

        EventBroadcaster.Instance.PostEvent(EventNames.ON_UNIT_INITIALIZE_SUCCESS);
    }
开发者ID:pocket-playlab,项目名称:PocketGodsRPG_Proto,代码行数:12,代码来源:ControllableUnit.cs


示例17: handleDemolish

	public void handleDemolish ( CharacterData characterToBuild, bool onlyUnblocking = false )
	{
		if ( onlyUnblocking )
		{
			_alreadyTouched = false;
			return;
		}
		if(characterToBuild.myID == 40)
		{
			SoundManager.getInstance ().playSound ( SoundManager.DESTROYABLE_DEMOLISH, _myIComponent.myID );
		}
		StartCoroutine ( "startBuildProcedure", characterToBuild );
	}
开发者ID:rtumelty,项目名称:toyrescuestory,代码行数:13,代码来源:MNDestroyableObjectComponent.cs


示例18: initData

 public override void initData(CharacterData characterD)
 {
     base.initData (characterD);
     HeroData heroD = this.data as HeroData;
     Hashtable passive1 =  heroD.getPSkillByID("DRAX25");
     if(passive1 != null)
     {
         SkillDef skillDef = SkillLib.instance.getSkillDefBySkillID("DRAX25");
         int uValue = (int)skillDef.passiveEffectTable["universal"];
         autoRegenHpValue = uValue;
         if(!IsInvoking("autoRegenHp"))InvokeRepeating("autoRegenHp", 0, 1.0f);
     }
 }
开发者ID:rogeryuan99,项目名称:Hello,代码行数:13,代码来源:Drax.cs


示例19: InsertCharacter

 public void InsertCharacter(CharacterData data)
 {
     try
     {
         lock (DataAccess.DatabaseAccess)
             using (var comm = DataAccess.DatabaseAccess.CreateCommand(String.Format("INSERT INTO `character` ({0}) VALUES ({1})", CharacterData.GetQueryString(), data.GetInsertString())))
                 comm.ExecuteNonQuery();
     }
     catch (Exception e)
     {
         Logger.WriteLog("Exception in InsertCharacter! Exception: {0}", LogType.Error, e);
     }
 }
开发者ID:4ptiv4,项目名称:GenesisSharp,代码行数:13,代码来源:Character.cs


示例20: Load

    public static Dictionary<int, CharacterData> Load(string fileName)
    {
        Dictionary<int, CharacterData> table = new Dictionary<int, CharacterData>();

        // 텍스트 테이블 읽어 들임
        XmlDocument xmlFile = new XmlDocument();
        xmlFile.PreserveWhitespace = false;
        try
        {
            TextAsset textAsset = (TextAsset)Resources.Load("XML/" + fileName, typeof(TextAsset));
            xmlFile.LoadXml(textAsset.text);
        }
        catch (Exception e)
        {
            return null;
        }

        XmlNodeList allData = xmlFile.ChildNodes;
        foreach (XmlNode mainNode in allData)
        {
            if (mainNode.Name.Equals("Data") == true)
            {
                XmlNodeList childNodeList = mainNode.ChildNodes;
                foreach (XmlNode node in childNodeList)
                {
                    CharacterData tableData = new CharacterData();

                    tableData.Index = Int32.Parse(node.Attributes.GetNamedItem("Index").Value);
                    tableData.Name = String.Copy(node.Attributes.GetNamedItem("Name").Value);
                    tableData.ResourceName = String.Copy(node.Attributes.GetNamedItem("ResourceName").Value);

                    tableData.Attribute = Int32.Parse(node.Attributes.GetNamedItem("Attribute").Value);
                    tableData.HealthPoint = Int32.Parse(node.Attributes.GetNamedItem("HealthPoint").Value);
                    tableData.ManaPoint = Int32.Parse(node.Attributes.GetNamedItem("ManaPoint").Value);
                    tableData.DefensePoint = Int32.Parse(node.Attributes.GetNamedItem("DefensePoint").Value);
                    tableData.AttackPoint = Int32.Parse(node.Attributes.GetNamedItem("AttackPoint").Value);
                    tableData.Speed = Int32.Parse(node.Attributes.GetNamedItem("Speed").Value);

                    tableData.BulletIndex = Int32.Parse(node.Attributes.GetNamedItem("BulletIndex").Value);

                    tableData.SkillIndex = Int32.Parse(node.Attributes.GetNamedItem("SkillIndex").Value);
                    tableData.SkillName = String.Copy(node.Attributes.GetNamedItem("SkillName").Value);
                    tableData.SkillDesc = String.Copy(node.Attributes.GetNamedItem("SkillDesc").Value);
                    tableData.SkillManaCost = Int32.Parse(node.Attributes.GetNamedItem("SkillManaCost").Value);

                    table.Add(tableData.Index, tableData);
                }
            }
        }
        return table;
    }
开发者ID:firerings,项目名称:ski-proto-01,代码行数:51,代码来源:CharacterData.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# CharacterMotor类代码示例发布时间:2022-05-24
下一篇:
C# CharacterController2D类代码示例发布时间: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