Advertisement
Guest User

code

a guest
Mar 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public enum Power
  6. {
  7. none,
  8. Speed,
  9. Shield,
  10. Attack,
  11. Health,
  12. }
  13. public enum Colors
  14. {
  15. none,
  16. Red,
  17. Blue ,
  18. Green,
  19. }
  20.  
  21. public class PowerUp : MonoBehaviour {
  22.  
  23. [SerializeField]
  24. private Power pow;
  25. [SerializeField]
  26. private Colors col;
  27. private PhotonView myPhotonView;
  28.  
  29. void Start()
  30. {
  31. myPhotonView = GetComponent<PhotonView>();
  32. }
  33.  
  34. void Update()
  35. {
  36. }
  37.  
  38. [PunRPC]
  39. void OnCollisionEnter2D(Collision2D col)
  40. {
  41. if (col.gameObject.tag.Equals("Player"))
  42. {
  43. col.gameObject.GetComponent<PlayerBehaviourCs>().powerUp(pow.ToString(), col.ToString());
  44. Destroy(this.gameObject);
  45. }
  46. else
  47. {
  48. Destroy(this.gameObject);
  49. }
  50. }
  51. void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
  52. {
  53. if (stream.isWriting)
  54. {
  55.  
  56. // stream.SendNext ()
  57. }
  58. else
  59. {
  60.  
  61. }
  62. }
  63.  
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement