Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
ComponentMount.cs
浏览该文件的文档.
1using Engine;
4
5namespace Game {
6 public class ComponentMount : Component {
7 public ComponentBody ComponentBody { get; set; }
8
9 public Vector3 MountOffset { get; set; }
10
11 public Vector3 DismountOffset { get; set; }
12 public float MountAllowToStartRange { get; set; }
13
15 get {
16 foreach (ComponentBody childBody in ComponentBody.ChildBodies) {
17 ComponentRider componentRider = childBody.Entity.FindComponent<ComponentRider>();
18 if (componentRider != null) {
19 return componentRider;
20 }
21 }
22 return null;
23 }
24 }
25
26 public override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap) {
27 ComponentBody = Entity.FindComponent<ComponentBody>(true);
28 MountOffset = valuesDictionary.GetValue<Vector3>("MountOffset");
29 DismountOffset = valuesDictionary.GetValue<Vector3>("DismountOffset");
30 MountAllowToStartRange = valuesDictionary.GetValue("MountAllowToStartRange", 2.5f);
31 }
32 }
33}
override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
ValuesDictionary ValuesDictionary
Component FindComponent(Type type, string name, bool throwOnError)