Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public enum Power
- {
- none,
- Speed,
- Shield,
- Attack,
- Health,
- }
- public enum Colors
- {
- none,
- Red,
- Blue ,
- Green,
- }
- public class PowerUp : MonoBehaviour {
- [SerializeField]
- private Power pow;
- [SerializeField]
- private Colors col;
- private PhotonView myPhotonView;
- void Start()
- {
- myPhotonView = GetComponent<PhotonView>();
- }
- void Update()
- {
- }
- [PunRPC]
- void OnCollisionEnter2D(Collision2D col)
- {
- if (col.gameObject.tag.Equals("Player"))
- {
- col.gameObject.GetComponent<PlayerBehaviourCs>().powerUp(pow.ToString(), col.ToString());
- Destroy(this.gameObject);
- }
- else
- {
- Destroy(this.gameObject);
- }
- }
- void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
- {
- if (stream.isWriting)
- {
- // stream.SendNext ()
- }
- else
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement