Beispiel #1
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag == "Player")
     {
         WizardPlayer player = other.gameObject.GetComponent <WizardPlayer>();
         if (photonView.Owner.UserId != player.GetPhotonView().Owner.UserId)
         {
             if (player.GetPhotonView().IsMine)
             {
                 player.LoseHP(spellDamage);
             }
         }
     }
 }
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag == "Player")
     {
         WizardPlayer player = other.gameObject.GetComponent <WizardPlayer>();
         if (player.GetPhotonView().IsMine)
         {
             spellName = spellList.RandomScroll();
             if (player.spellList.AddSpell(spellName))
             {
                 photonView.RPC("DestroySelfRPC", RpcTarget.All);
                 player.ScrollPickup();
             }
         }
     }
 }
Beispiel #3
0
        void Update()
        {
            if (player.GetPhotonView().IsMine || player.GetTestingMode())
            {
                string input = Input.inputString;
                if (input.Equals(""))
                {
                    return;
                }
                if (input [0] != '\n' && input [0] != '\r')
                {
                    if (Input.GetKey("up") || Input.GetKey("down") || Input.GetKey("left") || Input.GetKey("right"))
                    {
                        return;
                    }
                }

                UpdateWord(input [0]);
            }
        }