public void SetProjectile(SpellCreationSegment seg, ProjectileSpellBook sp) { spellSeg = seg; if (pm == null) { pm = gameObject.GetComponent <ProjectileMovement>(); } pm.speed = seg.GetSpeed(); pm.turnSpeed = seg.GetTurnSpeed(); spell = sp; string[] layers = sp.layerMaskNames; foreach (Transform child in transform) { if (sp.source == ProjectileSpellBookBuilder.spellSource.enemy) { child.gameObject.layer = LayerMask.NameToLayer("ProjectileEnemy"); } else if (sp.source == ProjectileSpellBookBuilder.spellSource.player) { child.gameObject.layer = LayerMask.NameToLayer("ProjectilePlayer"); } else { child.gameObject.layer = LayerMask.NameToLayer("ProjectileNeutral"); } child.gameObject.GetComponent <MovementCheck>().layerMask = LayerMask.GetMask(layers); } }
public override void AdjustForSpeed(SpellCreationSegment seg) { amt = amt / seg.GetSpeed(); return; //rotationAmt = rotationAmt / seg.GetTurnSpeed(); }