Last active
October 29, 2022 21:25
-
-
Save Plnda/e80da764d471bcf156c6357df8ffbc90 to your computer and use it in GitHub Desktop.
unity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
using System; | |
using Framework.DI; | |
using UnityEngine; | |
using UnityEngine.Networking; | |
namespace Game.Gameplay | |
{ | |
public class ShootBehaviour : MonoBehaviour | |
{ | |
void Start() | |
{ | |
var jason = new Human("Jason"); | |
var bryan = new Entity("Bryan"); | |
jason.Greet(bryan); | |
bryan.Greet(jason); | |
jason.Zwaai(); | |
var motor = new Motor(); | |
motor.Rijden(10); | |
motor.DoeWheelie(); | |
motor.Remmen(); | |
var auto = new Auto(); | |
auto.Remmen(); | |
auto.OpenAchterbak(); | |
var voertuig = new Vehicle(); | |
voertuig.Remmen(); | |
voertuig.Rijden(5); | |
var vliegtuig = new Vliegtuig(); | |
vliegtuig.Landen(); | |
vliegtuig.Opstijgen(); | |
vliegtuig.Remmen(); | |
vliegtuig.Rijden(1); | |
vliegtuig.Vliegen(); | |
} | |
} | |
public class Entity | |
{ | |
public string naam; | |
public Entity(string naam) | |
{ | |
this.naam = naam; | |
} | |
public void Zwaai() | |
{ | |
} | |
public void Greet(Entity otherEntity) | |
{ | |
Debug.Log($"Hallo {otherEntity.naam} "); | |
} | |
} | |
public class Vehicle | |
{ | |
public string kenteken; | |
public int aantalBanden; | |
public void Rijden(int km) | |
{ | |
} | |
public void Remmen() | |
{ | |
} | |
} | |
public class Vliegtuig : Vehicle | |
{ | |
public void Opstijgen() | |
{ | |
} | |
public void Landen() | |
{ | |
} | |
public void Vliegen() | |
{ | |
} | |
} | |
public class Motor : Vehicle | |
{ | |
public void DoeWheelie() | |
{ | |
} | |
} | |
public class Auto : Vehicle | |
{ | |
public void OpenAchterbak() | |
{ | |
} | |
} | |
public class Human: Entity | |
{ | |
public Human(string naam) : base(naam) | |
{ | |
} | |
} | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment