public override void Init(Vector3 pos, Vector3 forward, Color color, LayerMask layerMask, Func <CollisionHitCallbackStruct, bool> CollisionCallback, float range, params GameObject[] targetObjs) { IceBoltExplosion.SetActive(false); IceBoltObj.SetActive(true); transform.position = pos; var rb = GetComponent <Rigidbody>(); rb.isKinematic = false; rb.detectCollisions = true; IceBoltCollision iceBoltCollision = GetComponent <IceBoltCollision>(); iceBoltCollision.isCollided = false; if (targetObjs.Length > 0) { forward = (targetObjs[0].transform.position - transform.position).normalized; } transform.forward = forward; SetForward(forward); SetLayerMask(layerMask); SetCollisionCallback(CollisionCallback); }
public override void SetForward(Vector3 forward) { IceBoltCollision iceBoltCollision = GetComponent <IceBoltCollision>(); iceBoltCollision.SetForward(forward); }
public override void SetLayerMask(LayerMask layerMask) { IceBoltCollision iceBoltCollision = GetComponent <IceBoltCollision>(); iceBoltCollision.SetLayerMask(layerMask); }
public override void SetCollisionCallback(Func <CollisionHitCallbackStruct, bool> CallBack) { IceBoltCollision iceBoltCollision = GetComponent <IceBoltCollision>(); iceBoltCollision.SetCollisionCallback(CallBack); }