Exemple #1
0
 public override void Throw(Vector3 velocity)
 {
     if (summonedDagger && daggerActive)
     {
         base.Throw(velocity);
         EnableDagger();
         Rigidbody rb = summonedDagger.GetComponent <Rigidbody>();
         PointItemFlyRefAtTarget(summonedDagger, velocity, 1.0f);
         rb.AddForce(velocity * 5, ForceMode.Impulse);
         throwEffectInstance = throwEffect.Spawn(spellCaster.magicSource);
         throwEffectInstance.SetTarget(summonedDagger.transform);
         throwEffectInstance.Play();
         summonedDagger.Throw();
         daggerActive = false;
     }
 }
Exemple #2
0
 public override void Update()
 {
     base.Update();
     if (effectShown)
     {
         textObject.SetActive(true);
         ringEffect.SetSpeed(GetHandDistanceInGs());
         ringEffect.SetIntensity(GetHandDistanceInGs());
         lineEffect.SetSource(Player.currentCreature.handLeft.caster.magicSource);
         lineEffect.SetTarget(Player.currentCreature.handRight.caster.magicSource);
         Player.currentCreature.mana.mergePoint.transform.rotation = GetHandsPointingQuaternion();
         text.text = $"{Math.Round(GetHandDistanceInGs(), 1)}G";
         textObject.transform.position = Vector3.Lerp(
             textObject.transform.position,
             Player.currentCreature.mana.mergePoint.transform.position + new Vector3(0, 0.2f, 0),
             Time.deltaTime * 50.0f);
         textObject.transform.rotation = Quaternion.LookRotation(textObject.transform.position - Player.currentCreature.animator.GetBoneTransform(HumanBodyBones.Head).position);
     }
     else
     {
         textObject.SetActive(false);
     }
 }