public override void InitializeView(Common.IModel model) { base.InitializeView(model); Model.SubscribePropertyUpdate(CombatPropertys.Hp, Hp);//订阅 Model.SubscribeMethodCall("StartMove", StartMove); Model.SubscribeMethodCall("StopMove", StopMove); Model.SubscribeMethodCall("Attack_01", Attack_01); Model.SubscribeMethodCall("Attack_02", Attack_02); //Model.SubscribeMethodCall("") }
public Model(Common.IModel model, Common.ITexture texture) { Texture = new Texture(texture); Vertices = model.Vertices.Select(x => new Vertex { Normal = ToVector(x.Normal), Coordinates = ToVector(x.Coordinates), WorldCoordinates = ToVector(x.WorldCoordinates), TextureCoordinates = ToVector(x.TextureCoordinates) }).ToArray(); Faces = model.Faces.Select(x => new Face { VertexA = x.VertexA, VertexB = x.VertexB, VertexC = x.VertexC, Normal = ToVector(x.Normal) }).ToArray(); }