Exemplo n.º 1
0
        //MAKE SURE THESE ARE IN THE SAME ORDER AS THE myElement Int list
        //0 = Fire, 1 = Thorns, 2 = Water.

        private void Start()
        {
            if (GetComponentInParent <SpellScript>() != null)
            {
                mySpell = GetComponentInParent <SpellScript>();
            }

            ChangeElement();
        }
Exemplo n.º 2
0
 void ChooseCastingHand()
 {
     myCastLoc                 = hands[Random.Range(0, hands.Length)];
     myCastSpell               = Instantiate(boltSpell, myCastLoc.transform.position, myCastLoc.transform.rotation);
     mySpellScript             = myCastSpell.GetComponent <SpellScript>();
     mySpellScript.elementType = myElement;
     mySpellScript.OnSpellGrabNPC(gameObject);
     isHoldingSpell = true;
 }
Exemplo n.º 3
0
 public override void OnInteractableObjectGrabbed(InteractableObjectEventArgs e)
 {
     base.OnInteractableObjectGrabbed(e);
     grabbingObj   = grabbingObjects[0];
     mySpellScript = GetComponent <SpellScript>();
     mySpellScript.myController = grabbingObj.GetComponent <VRTK_ControllerEvents>();
     mySpellScript.OnSpellGrab();
     mySpellScript.caster = Camera.main.gameObject;
 }