コード例 #1
0
ファイル: AIGenerator.cs プロジェクト: mezosaurus/eae-project
	public static void loadNPCWithSkin(GameObject npc, string skinName, NPCSkinType skinType)
	{
		string skinLoc = skinPrefix + skinName;
		GameObject skin = (GameObject)Instantiate (Resources.Load (skinLoc));
		npc.GetComponent<SpriteRenderer> ().sprite = skin.GetComponent<SpriteRenderer> ().sprite;
		npc.GetComponent<Animator> ().runtimeAnimatorController = skin.GetComponent<Animator> ().runtimeAnimatorController;
        npc.GetComponent<AIController>().SkinType = skinType;
		Destroy (skin);
	}
コード例 #2
0
    private static void AddNPCType(IDictionary<NPCSkinType, NPCData> data, NPCSkinType skinType, NPCData npcData)
    {
        data[skinType] = npcData;

        npcData.SkinType = skinType;
    }