private void CreateCompound(R effect, int level, bool isPositive, CompoundType compoundType = CompoundType.Armor) { float sign = isPositive ? 1 : -1; CompoundJSON compound = new CompoundJSON { Index = _indexer, Type = compoundType, Name = compoundType.ToString() + " #" + _indexer }; if (compoundType == CompoundType.Weapon) { compound.Effects.Add(effect, level * sign); compound.Effects.Add(R.Attack, _levelConfig[level][ElementRarityClass.Abundant].Attack); } else { compound.Effects.Add(effect, _levelConfig[level][ElementRarityClass.Abundant].Resistance * sign); } compound.Elements.AddRange(CreateCompoundElements(compound, level, ElementRarityClass.Rare)); compound.Elements.AddRange(CreateCompoundElements(compound, level, ElementRarityClass.Uncommon)); compound.Elements.AddRange(CreateCompoundElements(compound, level, ElementRarityClass.Common)); compound.Elements.AddRange(CreateCompoundElements(compound, level, ElementRarityClass.Abundant)); foreach (LifeElementModel item in compound.Elements) { compound.Formula += item.Symbol + item.MaxAmount + " "; } CreateCompoundTexture(compound); _compounds.Add(compound); _indexer++; }
// Use this for initialization void Start() { _message.Type = Type; Label.text = Type.ToString(); GameMessage.Listen <CompoundTypeMessage>(OnCompoundTypeMessage); Button.OnValueChangedAsObservable().Where(_ => _ == true).Subscribe(_ => GameMessage.Send(_message)).AddTo(disposables); }
public RichCompound(CompoundType chemical) : base(chemical.ToString()) { }