Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using System;
- public class SpriteEvents : Photon.MonoBehaviour {
- public event EventHandler Walk;
- public event EventHandler StopWalk;
- public event EventHandler Run;
- public event EventHandler StopRun;
- public event EventHandler Jump;
- public event EventHandler Attack;
- public event EventHandler RangedAttack;
- public event EventHandler Defend;
- public float Vertical;
- public float Horizontal;
- public float JumpValue;
- public bool InputActive;
- public bool canMove = true;
- // Use this for initialization
- void Start() {
- }
- // Update is called once per frame
- void Update() {
- }
- [RPC]
- public void SetVertical(float vertical) {
- Vertical = vertical;
- }
- [RPC]
- public void SetHorizontal(float horizontal) {
- Horizontal = horizontal;
- }
- [RPC]
- public void StartWalk() {
- // Vertical = 1;
- }
- [RPC]
- public void CancelWalk() {
- //Vertical = 0;
- }
- [RPC]
- public void StartRun() {
- //Vertical = 1;
- if (canMove) {
- if (Run != null) {
- Run(this, EventArgs.Empty);
- }
- }
- }
- [RPC]
- public void StartDefence() {
- if (canMove) {
- if (Defend != null) {
- Defend(this, EventArgs.Empty);
- }
- }
- }
- [RPC]
- public void CancelRun() {
- if (canMove) {
- if (StopRun != null) {
- StopRun(this, EventArgs.Empty);
- }
- }
- }
- [RPC]
- public void StartAttack() {
- if (canMove) {
- if (Attack != null) {
- Attack(this, EventArgs.Empty);
- }
- }
- }
- [RPC]
- public void StartJump() {
- if (canMove) {
- if (Jump != null) {
- Jump(this, EventArgs.Empty);
- }
- }
- }
- [RPC]
- public void StartRangedAttack() {
- if (canMove) {
- if (RangedAttack != null) {
- RangedAttack(this, EventArgs.Empty);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment