protected void CreateEffect(Castable castable, RaycastHit raycastHit) { Vector3 position = raycastHit.point + (raycastHit.normal * Physics.defaultContactOffset); Quaternion rotation = Quaternion.LookRotation(raycastHit.normal); CreateEffect(castable, position, rotation); }
protected void CreateEffect(Castable castable, Vector3 position, Quaternion rotation) { if (castable == null) { return; } // castable caster and instantiate effect castable.SetCaster(_caster); GameObject newCastableGameObject = Instantiate(castable.gameObject, position, rotation); }