void OnGUI() { GUILayout.Label("Item Creation Settings", EditorStyles.boldLabel); myString = EditorGUILayout.TextField("Item Name: ", myString); //objAttrib = EditorGUILayout.BeginToggleGroup("Add Object Attribute", objAttrib); //EditorGUILayout.ObjectField("Gameobject", obj, ); //EditorGUILayout.EndToggleGroup(); dmgAttrib = EditorGUILayout.BeginToggleGroup("Add Damage Attribute", dmgAttrib); minDmg = EditorGUILayout.Slider("Min Damage", minDmg, 0, 100); maxDmg = EditorGUILayout.Slider("Max damage", maxDmg, minDmg, 200); EditorGUILayout.EndToggleGroup(); stckAttrib = EditorGUILayout.BeginToggleGroup("Add Stackable Attribute", stckAttrib); maxStack = (int)EditorGUILayout.Slider("Max Stack", maxStack, 1, 100); EditorGUILayout.EndToggleGroup(); if (GUILayout.Button("Add Item")) { Item createdItem = AddInventoryItem.CreateItemAsset(myString); if (dmgAttrib) { DamageAttribute da = (DamageAttribute)AddInventoryItem.CreateItemAttrib(eAttribTypes.DAMAGE, myString, ref createdItem); da.minDamage = minDmg; da.maxDamage = maxDmg; } if (stckAttrib) { StackableAttribute sa = (StackableAttribute)AddInventoryItem.CreateItemAttrib(eAttribTypes.STACK, myString, ref createdItem); sa.maxStack = maxStack; } } }
public void Set(Character.Stats stats, DamageAttribute attribute) { _bulletInfo.Damage = stats.Damage; _range = stats.Range; _bulletInfo.PushPower = stats.PushPower; _bulletInfo.Attribute = attribute; this.transform.localScale = Vector3.one * 0.1f * _bulletInfo.Damage; }
public DamageEventArgument( EnviromentEventArgument args, GameObject _invokee, GameObject[] _targets, EnviromentFrame _frame, DamageAttribute _damageAttribute) : base(args.LocationObjectBearing, _invokee, _targets, args.Focuser, _frame) { DamageAttribute = _damageAttribute; }
public GameObject Pop(Character.Stats stats) { GameObject bullet = _bullets.Count == 0 ? SupplyBullet() : _bullets[0]; _bullets.RemoveAt(0); // 기초 세팅 // 마테리얼 임시 적용 DamageAttribute ba = _bulletAttributeMgr.GetAttribute(); bullet.GetComponent <Bullet>().Set(stats, ba); bullet.GetComponent <SpriteRenderer>().color = _AtributeColors[(int)ba]; return(bullet); }
/// <summary> /// 指定アトリビュートを持っているかどうか. /// </summary> public bool HasAttr(DamageAttribute inAttr) { bool ret = false; foreach (DamageAttribute attr in attribute) { if (attr == inAttr) { ret = true; break; } } return(ret); }
private void SetValues(double _amount, DamageType _damageType, bool _trueDamage) { DamageAttribute = new DamageAttribute(this.Invokee.Name, _damageType, _amount, _trueDamage); }
public AttackAction(string _name, string _desc, GameObject _repObject, DamageType _type, double _amount, bool _trueDamage = false) : base(_name, _desc, _repObject) { DamageAttribute = new DamageAttribute(_name, _type, _amount, _trueDamage); }