Skip to content

Instantly share code, notes, and snippets.

@daleth90
Created Nov 28, 2018
Embed
What would you like to do?
interface IMovable {
void Move( Vector3 direction );
}
public class Bird : IMovable {
// 既然宣告實作了介面,就必須實作所有介面宣告的方法
public void Move( Vector3 direction ) {
// 在這裡寫下方法的定義
}
}
public struct Vector3 {
public float x;
public float y;
public float z;
public Vector3( float x, float y, float z ) {
this.x = x;
this.y = y;
this.z = z;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment