Exemple #1
0
	void PickupObject( ActorController actor )
	{
		//As with all RPC methods, we branch between online and offline mode here
		if( PhotonNetwork.offlineMode == true )
		{


			OnPickup( actor );
		}
		else
		{
			//We use PhotonTargets.AllBufferedViaServer here to avoid two actors picking up the
			//same object before one of the pickup events has reached the server
			//Check out Part 1 Lesson 4 http://youtu.be/Wn9P4d1KwoQ for more detailed explanations
			PhotonView.RPC(
					"OnPickup"
				, PhotonTargets.AllBufferedViaServer
				, new object[] { actor.PhotonView.viewID }
			);
		}
	}
Exemple #2
0
	/// Called when a actor successfully picked up the object
	public abstract void OnPickup( ActorController actor );
Exemple #3
0
	/// Determines whether this instance [can be picked up by the specified actor.
	/// THis will be defined by the specific pickup script
	public abstract bool CanBePickedUpBy( ActorController actor );
Exemple #4
0
	public override void OnPickup( ActorController actor )
	{
		m_CarryingActorController = actor;
		m_CarryingActorController.isScoring = true;

	}
Exemple #5
0
	public override bool CanBePickedUpBy( ActorController actor )
	{

		//If another player is already carrying the flag, no one else can grab it
		if( m_CarryingActorController != null )
		{
			return false;
		}

		return true;
	}
Exemple #6
0
	void OnCapture()
	{
		Debug.Log("Event Received: Capture Flag");

		m_CarryingActorController = null;
		transform.position = m_HomePosition;

	}
Exemple #7
0
	void OnDrop( Vector3 position )
	{
		Debug.Log("Event Received: Drop Flag");

		m_CarryingActorController.isScoring = false;

		m_CarryingActorController = null;
		transform.position = position;
		m_ReturnTimer = ReturnTime;
	}