public override void OnCatalogRefresh() { base.OnCatalogRefresh(); Addressables.LoadAssetAsync <GameObject>("Lyneca.DaggerSpell.BlackHole").Task.Then(obj => blackHolePrefab = obj); daggerBase = Catalog.GetData <ItemPhysic>(weaponId, true); throwEffect = Catalog.GetData <EffectData>("SpellTelekinesisPush"); }
public void Initialize(Item item, AthenasSword module) { LoadBossWeapon(item); fireRainDuration = module.fireRainDuration; fireRainHeight = module.fireRainHeight; fireRainIntensity = module.fireRainIntensity; fireRainRadius = module.fireRainRadius; fireLaserDelay = module.fireLaserDelay; fireLaserVelocity = module.fireLaserVelocity; fireBallItemData = Catalog.GetData <ItemPhysic>(module.fireBallItemId); // Enemy OnCollisionCreatureEnemyHoldingEvent += CreatureCollisionEnemyHolding; //Player swordTip = item.definition.GetCustomReference("swordTip"); if (!swordTip) { Debug.LogError("Weapon does not have swordTip reference, defaulting to flyref"); swordTip = item.definition.flyDirRef; } OnHeldActionPlayer += OnHeldAction; }
public override void OnItemDataRefresh(ItemPhysic data) { base.OnItemDataRefresh(data); if (!string.IsNullOrEmpty(useSound)) { Catalog.LoadAssetAsync <AudioContainer>(useSound, ac => useSoundAsset = ac, null); } }
public override void OnCatalogRefresh() { base.OnCatalogRefresh(); Addressables.LoadAssetAsync <GameObject>("Lyneca.DaggerSpell.BlackHole").Task.Then(obj => blackHolePrefab = obj); blackHoleEffect = Catalog.GetData <EffectData>("SpellDaggerSummonSound"); daggerBase = Catalog.GetData <ItemPhysic>(weaponId ?? Catalog.GetData <DaggerSpell>("DaggerSpell").weaponId, true); daggers = new List <FloatingDagger>(); }
public static Task <Item> SpawnItem(ItemPhysic itemData) { var promise = new TaskCompletionSource <Item>(); System.Action action = () => itemData.SpawnAsync(item => promise.SetResult(item)); Task.Run(action); return(promise.Task); }
public override void Load(Mana mana) { base.Load(mana); sunData = Catalog.GetData <ItemPhysic>("CosmicSun"); fireballItem = Catalog.GetData <ItemPhysic>("DynamicProjectile"); fireballEffect = Catalog.GetData <EffectData>("SpellFireball"); fireballDeflectEffect = Catalog.GetData <EffectData>("SpellFireBallHitBlade"); fireballDamager = Catalog.GetData <DamagerData>("Fireball"); }
public virtual Item Init(ItemPhysic itemData) { foreach (Item existingInteractiveObject in this.gameObject.GetComponents <Item>()) { Destroy(existingInteractiveObject); } itemId = itemData.id; initialized = true; Item item = itemData.CreateComponent(this.gameObject); if (Initialized != null) { Initialized.Invoke(item); } return(item); }
public FloatingDagger(ItemPhysic daggerBase, GameObject blackHolePrefab, EffectData soundEffect, int number, int count) { daggerBase.SpawnAsync(dagger => { item = dagger; item.transform.localScale = Vector3.one * charge; item.transform.position = GetTarget(number, count); soundEffect.Spawn(dagger.transform).Play(); PointItemFlyRefAtTarget(item, GetHandsPointingQuaternion() * Vector3.forward, 1.0f); item.rb.collisionDetectionMode = CollisionDetectionMode.Discrete; item.GetComponent <Rigidbody>().isKinematic = true; item.disallowDespawn = false; blackHole = UnityEngine.Object.Instantiate(blackHolePrefab, item.transform.position, Quaternion.identity); blackHole.transform.localScale = Vector3.one * 0.25f; blackHole.transform.localPosition = Vector3.zero; blackHole.GetComponent <Renderer>().material.SetFloat("HoleSize", 0); blackHole.GetComponent <Renderer>().material.SetFloat("DistortionStrength", 0); }); }
public override void OnItemDataRefresh(ItemPhysic data) { base.OnItemDataRefresh(data); if (!string.IsNullOrEmpty(idleSound)) { Catalog.LoadAssetAsync <AudioContainer>(idleSound, ac => idleSoundAsset = ac, null); } if (!string.IsNullOrEmpty(startSound)) { Catalog.LoadAssetAsync <AudioContainer>(startSound, ac => startSoundAsset = ac, null); } if (!string.IsNullOrEmpty(stopSound)) { Catalog.LoadAssetAsync <AudioContainer>(stopSound, ac => stopSoundAsset = ac, null); } if (!string.IsNullOrEmpty(whooshFX)) { whoosh = Catalog.GetData <EffectData>(whooshFX, true); } }
protected void SpawnAndSnap(string spawnedItemID, ObjectHolder holder) { ItemPhysic spawnedItemData = Catalog.GetData <ItemPhysic>(spawnedItemID, true); //Debug.Log("[HoldingBag][Fetch][Spawn] Item Categories: " + spawnedItemData.categoryPath + ", Item Name: " + spawnedItemData.displayName); if (spawnedItemData == null) { return; } else { Item thisSpawnedItem = spawnedItemData.Spawn(true); if (!thisSpawnedItem.gameObject.activeInHierarchy) { thisSpawnedItem.gameObject.SetActive(true); } holder.Snap(thisSpawnedItem); return; } }
public override void OnCatalogRefresh() { base.OnCatalogRefresh(); daggerBase = Catalog.GetData <ItemPhysic>(weaponId ?? Catalog.GetData <DaggerSpell>("DaggerSpell").weaponId, true); spellCharge = Catalog.GetData <SpellCastCharge>(spellCastName); }
public override void OnItemDataRefresh(ItemPhysic data) { base.OnItemDataRefresh(data); if (!string.IsNullOrEmpty(altFireSoundPath)) { Catalog.LoadAssetAsync <AudioContainer>(altFireSoundPath, ac => altFireSoundAsset = ac, null); } if (!string.IsNullOrEmpty(altFireSoundPath2)) { Catalog.LoadAssetAsync <AudioContainer>(altFireSoundPath2, ac => altFireSoundAsset2 = ac, null); } if (!string.IsNullOrEmpty(chargeFireSoundPath)) { Catalog.LoadAssetAsync <AudioContainer>(chargeFireSoundPath, ac => chargeFireSoundAsset = ac, null); } if (!string.IsNullOrEmpty(chargeFireSoundPath2)) { Catalog.LoadAssetAsync <AudioContainer>(chargeFireSoundPath2, ac => chargeFireSoundAsset2 = ac, null); } if (!string.IsNullOrEmpty(chargeFireSoundPath3)) { Catalog.LoadAssetAsync <AudioContainer>(chargeFireSoundPath3, ac => chargeFireSoundAsset3 = ac, null); } if (!string.IsNullOrEmpty(chargeSoundPath)) { Catalog.LoadAssetAsync <AudioContainer>(chargeSoundPath, ac => chargeSoundAsset = ac, null); } if (!string.IsNullOrEmpty(chargeSoundPath2)) { Catalog.LoadAssetAsync <AudioContainer>(chargeSoundPath2, ac => chargeSoundAsset2 = ac, null); } if (!string.IsNullOrEmpty(chargeReadySoundPath)) { Catalog.LoadAssetAsync <AudioContainer>(chargeReadySoundPath, ac => chargeReadySoundAsset = ac, null); } if (!string.IsNullOrEmpty(chargeReadySoundPath2)) { Catalog.LoadAssetAsync <AudioContainer>(chargeReadySoundPath2, ac => chargeReadySoundAsset2 = ac, null); } if (!string.IsNullOrEmpty(chargeStartSoundPath)) { Catalog.LoadAssetAsync <AudioContainer>(chargeStartSoundPath, ac => chargeStartSoundAsset = ac, null); } if (!string.IsNullOrEmpty(chargeStartSoundPath2)) { Catalog.LoadAssetAsync <AudioContainer>(chargeStartSoundPath2, ac => chargeStartSoundAsset2 = ac, null); } if (!string.IsNullOrEmpty(emptySoundPath)) { Catalog.LoadAssetAsync <AudioContainer>(emptySoundPath, ac => emptySoundAsset = ac, null); } if (!string.IsNullOrEmpty(emptySoundPath2)) { Catalog.LoadAssetAsync <AudioContainer>(emptySoundPath2, ac => emptySoundAsset2 = ac, null); } if (!string.IsNullOrEmpty(fireSoundPath)) { Catalog.LoadAssetAsync <AudioContainer>(fireSoundPath, ac => fireSoundAsset = ac, null); } if (!string.IsNullOrEmpty(fireSoundPath2)) { Catalog.LoadAssetAsync <AudioContainer>(fireSoundPath2, ac => fireSoundAsset2 = ac, null); } if (!string.IsNullOrEmpty(fireSoundPath3)) { Catalog.LoadAssetAsync <AudioContainer>(fireSoundPath3, ac => fireSoundAsset3 = ac, null); } if (!string.IsNullOrEmpty(fireModeSoundPath)) { Catalog.LoadAssetAsync <AudioContainer>(fireModeSoundPath, ac => fireModeSoundAsset = ac, null); } if (!string.IsNullOrEmpty(fireModeSoundPath2)) { Catalog.LoadAssetAsync <AudioContainer>(fireModeSoundPath2, ac => fireModeSoundAsset2 = ac, null); } if (!string.IsNullOrEmpty(overheatSoundPath)) { Catalog.LoadAssetAsync <AudioContainer>(overheatSoundPath, ac => overheatSoundAsset = ac, null); } if (!string.IsNullOrEmpty(overheatSoundPath2)) { Catalog.LoadAssetAsync <AudioContainer>(overheatSoundPath2, ac => overheatSoundAsset2 = ac, null); } if (!string.IsNullOrEmpty(preFireSoundPath)) { Catalog.LoadAssetAsync <AudioContainer>(preFireSoundPath, ac => preFireSoundAsset = ac, null); } if (!string.IsNullOrEmpty(preFireSoundPath2)) { Catalog.LoadAssetAsync <AudioContainer>(preFireSoundPath2, ac => preFireSoundAsset2 = ac, null); } if (!string.IsNullOrEmpty(reloadSoundPath)) { Catalog.LoadAssetAsync <AudioContainer>(reloadSoundPath, ac => reloadSoundAsset = ac, null); } if (!string.IsNullOrEmpty(reloadSoundPath2)) { Catalog.LoadAssetAsync <AudioContainer>(reloadSoundPath2, ac => reloadSoundAsset2 = ac, null); } if (!string.IsNullOrEmpty(reloadEndSoundPath)) { Catalog.LoadAssetAsync <AudioContainer>(reloadEndSoundPath, ac => reloadEndSoundAsset = ac, null); } if (!string.IsNullOrEmpty(reloadEndSoundPath2)) { Catalog.LoadAssetAsync <AudioContainer>(reloadEndSoundPath2, ac => reloadEndSoundAsset2 = ac, null); } if (!string.IsNullOrEmpty(scopeReticle)) { Catalog.LoadAssetAsync <Texture2D>(scopeReticle, texture => scopeReticleTexture = texture, null); } }
public static Item SpawnItemSync(ItemPhysic itemData) { return(SpawnItem(itemData).GetAwaiter().GetResult()); }
public override void Load(Mana mana) { base.Load(mana); blackHoleData = Catalog.GetData <ItemPhysic>("CosmicBlackHole"); whiteHoleData = Catalog.GetData <ItemPhysic>("CosmicWhiteHole"); }