/// <summary> /// 指定されたドロップの種類に応じてプレハブ生成 /// </summary> /// <param name="droptype">ドロップの種類</param> /// <returns>ドロップのGameObject</returns> public GameObject DropCreate(Drop.DROPTYPE droptype) { GameObject DropPrefab; switch (droptype) { case Drop.DROPTYPE.Circle: DropPrefab = Instantiate(CircleDropPrefab); DropPrefab.GetComponent <Drop>()._DropType = droptype; return(DropPrefab); case Drop.DROPTYPE.Cross: DropPrefab = Instantiate(CrossDropPrefab); DropPrefab.GetComponent <Drop>()._DropType = droptype; return(DropPrefab); case Drop.DROPTYPE.Tryangle: DropPrefab = Instantiate(TryangleDropPrefab); DropPrefab.GetComponent <Drop>()._DropType = droptype; return(DropPrefab); default: return(null); } }
bool IsPrefabForItem(ItemData itemData, DropPrefab dropPrefab) { foreach (ItemFilterSystem filter in dropPrefab.itemFilters) { if (filter.IsSelected(itemData)) { return true; } } return false; }
bool IsPrefabForItem(ItemData itemData, DropPrefab dropPrefab) { foreach (ItemFilterSystem filter in dropPrefab.itemFilters) { if (filter.IsSelected(itemData)) { return(true); } } return(false); }
// Use this for initialization void Start() { //プレハブ生成 //HPの合計値を計算 ToatalHP = 0; GameObject DropPrefab; DropPrefab = Instantiate(CirclePlayerPrefab); DropPrefab.GetComponent <Player>()._DropType = Drop.DROPTYPE.Circle; ToatalHP += DropPrefab.GetComponent <Player>()._HP; DropPrefab = Instantiate(CrossPlayerPrefab); DropPrefab.GetComponent <Player>()._DropType = Drop.DROPTYPE.Cross; ToatalHP += DropPrefab.GetComponent <Player>()._HP; DropPrefab = Instantiate(TryanglePlayerPrefab); DropPrefab.GetComponent <Player>()._DropType = Drop.DROPTYPE.Tryangle; ToatalHP += DropPrefab.GetComponent <Player>()._HP; }
public void loadDetails() { DropPrefab dropPrefab = GameObject.Find("DetailsController").GetComponent <DropPrefab>(); string text = SaveAndLoadManager.getInstance().loadText(key); string[] lines = text.Split('\n'); Regex prefabSegment = new Regex(@"\d\/\d+.\d\d,\d+.\d\d,\d+.\d\d\/\-?\d+.\d\d,-?\d+.\d\d,-?\d+.\d\d,-?\d+.\d\d"); foreach (string line in lines) { //Has Block if (prefabSegment.IsMatch(line)) { int prefab = int.Parse(line.Substring(0, line.IndexOf('/'))); string rest = line.Substring(line.IndexOf('/') + 1); Vector3 position; position.x = float.Parse(rest.Substring(0, rest.IndexOf(','))); rest = rest.Substring(rest.IndexOf(',') + 1); position.y = float.Parse(rest.Substring(0, rest.IndexOf(','))); rest = rest.Substring(rest.IndexOf(',') + 1); position.z = float.Parse(rest.Substring(0, rest.IndexOf('/'))); rest = rest.Substring(rest.IndexOf('/') + 1); Quaternion rotation; rotation.x = float.Parse(rest.Substring(0, rest.IndexOf(','))); rest = rest.Substring(rest.IndexOf(',') + 1); rotation.y = float.Parse(rest.Substring(0, rest.IndexOf(','))); rest = rest.Substring(rest.IndexOf(',') + 1); rotation.z = float.Parse(rest.Substring(0, rest.IndexOf(','))); rest = rest.Substring(rest.IndexOf(',') + 1); rotation.w = float.Parse(rest); dropPrefab.Instantiate(prefab, position, rotation); } } }
static bool IsPrefabForItem(ItemInformation itemData, DropPrefab dropPrefab) { return(false); }
static bool IsPrefabForItem(ItemInformation itemData, DropPrefab dropPrefab) { return false; }