SebastianLawe

Untitled

Feb 13th, 2015
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.74 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System;
  4.  
  5. public class SpriteEvents : Photon.MonoBehaviour {
  6.     public event EventHandler Walk;
  7.     public event EventHandler StopWalk;
  8.     public event EventHandler Run;
  9.     public event EventHandler StopRun;
  10.     public event EventHandler Jump;
  11.     public event EventHandler Attack;
  12.     public event EventHandler RangedAttack;
  13.     public event EventHandler Defend;
  14.     public float Vertical;
  15.     public float Horizontal;
  16.     public float JumpValue;
  17.     public bool InputActive;
  18.     public bool canMove = true;
  19.     // Use this for initialization
  20.     void Start() {
  21.  
  22.     }
  23.  
  24.     // Update is called once per frame
  25.     void Update() {
  26.  
  27.     }
  28.  
  29.     [RPC]
  30.     public void SetVertical(float vertical) {
  31.         Vertical = vertical;
  32.     }
  33.     [RPC]
  34.     public void SetHorizontal(float horizontal) {
  35.         Horizontal = horizontal;
  36.     }
  37.     [RPC]
  38.     public void StartWalk() {
  39.         //  Vertical = 1;
  40.     }
  41.     [RPC]
  42.     public void CancelWalk() {
  43.         //Vertical = 0;
  44.     }
  45.  
  46.     [RPC]
  47.     public void StartRun() {
  48.         //Vertical = 1;
  49.         if (canMove) {
  50.             if (Run != null) {
  51.                 Run(this, EventArgs.Empty);
  52.             }
  53.         }
  54.     }
  55.  
  56.     [RPC]
  57.     public void StartDefence() {
  58.         if (canMove) {
  59.             if (Defend != null) {
  60.                 Defend(this, EventArgs.Empty);
  61.             }
  62.         }
  63.     }
  64.  
  65.     [RPC]
  66.     public void CancelRun() {
  67.         if (canMove) {
  68.             if (StopRun != null) {
  69.                 StopRun(this, EventArgs.Empty);
  70.             }
  71.         }
  72.     }
  73.  
  74.     [RPC]
  75.     public void StartAttack() {
  76.         if (canMove) {
  77.             if (Attack != null) {
  78.                 Attack(this, EventArgs.Empty);
  79.             }
  80.         }
  81.     }
  82.  
  83.     [RPC]
  84.     public void StartJump() {
  85.         if (canMove) {
  86.             if (Jump != null) {
  87.                 Jump(this, EventArgs.Empty);
  88.             }
  89.         }
  90.     }
  91.  
  92.     [RPC]
  93.     public void StartRangedAttack() {
  94.         if (canMove) {
  95.             if (RangedAttack != null) {
  96.                 RangedAttack(this, EventArgs.Empty);
  97.             }
  98.         }
  99.     }
  100. }
Advertisement
Add Comment
Please, Sign In to add comment