Advertisement
alestane

Polymorphism issue

Sep 26th, 2014
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. // PlayerView.cs
  2. public abstract class PlayerView : PhysicsRaycaster {
  3.     public abstract void TerrainAction(Battlefield target, EventTriggerType what, Battlefield.Locus where);
  4. // ...
  5. }
  6.  
  7. // MinimapController.cs
  8. public class MinimapController : PlayerView {
  9.     public override void TerrainAction(Battlefield target, EventTriggerType what, Battlefield.Locus where) {
  10.         Debug.Log (what);
  11.     }
  12. // ...
  13. }
  14.  
  15. // Environment.cs
  16. public class Environment : Battlefield, IPointerDownHandler, IPointerUpHandler, IDragHandler {
  17.     public void ProcessPointer(PointerEventData pointer, EventTriggerType what) {
  18.         pointer.pressEventCamera.GetComponent<PlayerView>().TerrainAction(this, what, new Battlefield.Point(where));
  19.     }
  20. // ...
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement