當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。