void GetMonsterData(string ID, GameObject Object) { var Data = StaticData.Instance.monsterDictionary[ID]; var monsterData = PublicMonsterData.GetMonsterData(Data); var temp = Resources.Load <GameObject>("Monster"); var monster = Instantiate(temp, Object.transform); monster.GetComponent <AiMonster>().data = monsterData; }
public static PublicMonsterData GetMonsterData(MonsterData data) { PublicMonsterData monsterData = new PublicMonsterData(); monsterData.ID = data.id; monsterData.Level = data.Value(data.level); monsterData.picture = data.pictrue; monsterData.speed = data.Value(data.MoveSpeed); monsterData.Bullet = data.Value(data.buttle); return(monsterData); }
void Init(PublicMonsterData data) { if (data != null) { image = gameObject.transform.Find("Draw").GetComponent <Image>(); Debug.Log(image.sprite.name + " ++++++"); var image_Show = Resources.Load <Sprite>("Image/" + data.picture); image.sprite = image_Show; Debug.Log(image.sprite.name); } }
public static PublicMonsterData GetMonsterData(MonsterData data) { PublicMonsterData monsterData = new PublicMonsterData(); monsterData.ID = data.ID; monsterData.Level = data.Value(data.Level); monsterData.picture = data.Picture; monsterData.speed = data.Value(data.moveSpeed); monsterData.Bullet = data.Value(data.Bullet); return(monsterData); }