public static EffectZone CreateEffect(ZoneInfo zoneInfo, Constants.EffectOrigin location, GameObject source) { EffectZone result = null; Vector3 spawnPoint; if (location != Constants.EffectOrigin.MousePointer) { Transform point = source.Entity().effectDelivery.GetOriginPoint(location); spawnPoint = point.position; } else { Debug.LogError("Add Raycasting for MouseLocation effect creation"); spawnPoint = source.transform.position; } GameObject zoneObject = LoadAndSpawnZonePrefab(zoneInfo, spawnPoint, Quaternion.identity); if (zoneObject == null) { return(null); } result = ConfigureZone(zoneInfo, ref zoneObject, ref result); return(result); }
public static Projectile CreateProjectile(ProjectileInfo info, Constants.EffectOrigin location, GameObject source, int currentProjectile = 0) { Vector3 spawnPoint; Quaternion spawnRot = Quaternion.identity; if (location != Constants.EffectOrigin.MousePointer) { Transform point = source.Entity().effectDelivery.GetOriginPoint(location); spawnPoint = point.position; spawnRot = point.rotation; } else { spawnPoint = source.transform.position; } Projectile loadedProjectile = LoadAndSpawnProjectile(info.prefabName, spawnPoint, spawnRot); if (loadedProjectile == null) { return(null); } return(ConfigureProjectile(info, ref loadedProjectile, currentProjectile)); }
public Transform GetOriginPoint(Constants.EffectOrigin originType) { int count = effectOrigins.Count; for (int i = 0; i < count; i++) { if (effectOrigins[i].originType == originType) { return(effectOrigins[i].point); } } return(null); }