private void SpawnProjectile(ProjAndPositionData data) { UnityEngine.Object.Instantiate <GameObject>(EasyVFXDatabase.GreenLaserCircleVFX, new Vector3(data.position.x, data.position.y), Quaternion.identity); GameObject obj = SpawnManager.SpawnProjectile(data.projectile, new Vector3(data.position.x, data.position.y, 0), Quaternion.Euler(0, 0, data.angle)); Projectile component = obj.GetComponent <Projectile>(); if (component != null) { component.Owner = Owner; component.Shooter = Owner.specRigidbody; component.collidesWithPlayer = false; } }
private IEnumerator HandleAddToList(Projectile proj) { yield return(null); ProjAndPositionData newData = new ProjAndPositionData(); newData.projectile = FakePrefab.Clone(proj.gameObject); newData.position = proj.specRigidbody.UnitCenter; newData.angle = proj.Direction.ToAngle(); yield return(new WaitForSeconds(0.01f)); storedProjectiles.Add(newData); yield break; }
private void SpawnProjectile(ProjAndPositionData data) { //UnityEngine.Object.Instantiate<GameObject>(TempStorage.GreenLaserCircleVFX, new Vector3(data.position.x, data.position.y), Quaternion.identity); GameObject obj = SpawnManager.SpawnProjectile(data.projectile, new Vector3(data.position.x, data.position.y, 0), Quaternion.Euler(0, 0, data.angle)); Projectile component = obj.GetComponent <Projectile>(); if (component != null) { component.Owner = Owner; component.Shooter = Owner.specRigidbody; component.collidesWithPlayer = false; component.sprite.usesOverrideMaterial = true; Material material = component.sprite.renderer.material; material.shader = ShaderCache.Acquire("Brave/Internal/HologramShader"); material.SetFloat("_IsGreen", 0f); } }