Survivalcraft API 1.8.2.3
v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
ComponentOuterClothingModel.cs
浏览该文件的文档.
1
using
Engine.Graphics
;
2
using
GameEntitySystem
;
3
using
TemplatesDatabase
;
4
5
namespace
Game
{
6
public
class
ComponentOuterClothingModel
:
ComponentModel
{
7
public
ComponentHumanModel
m_componentHumanModel
;
8
9
public
ComponentCreature
m_componentCreature
;
10
11
public
override
void
Load
(
ValuesDictionary
valuesDictionary,
IdToEntityMap
idToEntityMap) {
12
base.Load(valuesDictionary, idToEntityMap);
13
m_subsystemSky
=
Project
.FindSubsystem<
SubsystemSky
>(
true
);
14
m_componentHumanModel
=
Entity
.FindComponent<
ComponentHumanModel
>(
true
);
15
m_componentCreature
=
Entity
.FindComponent<
ComponentCreature
>(
true
);
16
}
17
18
public
override
void
Animate
() {
19
base.Animate();
20
if
(
Animated
) {
21
return
;
22
}
23
Opacity
=
m_componentHumanModel
.Opacity;
24
foreach
(
ModelBone
bone
in
Model
.Bones) {
25
ModelBone
modelBone =
m_componentHumanModel
.Model.FindBone(bone.
Name
);
26
SetBoneTransform
(bone.
Index
,
m_componentHumanModel
.GetBoneTransform(modelBone.
Index
));
27
}
28
if
(
Opacity
.HasValue
29
&&
Opacity
.Value < 1f) {
30
bool
num = m_componentCreature.ComponentBody.ImmersionFactor >= 1f;
31
bool
flag = m_subsystemSky.ViewUnderWaterDepth > 0f;
32
RenderingMode
= num == flag ?
ModelRenderingMode.TransparentAfterWater
:
ModelRenderingMode
.TransparentBeforeWater;
33
}
34
else
{
35
RenderingMode
=
ModelRenderingMode
.AlphaThreshold;
36
}
37
}
38
39
public
override
void
SetModel
(
Model
model) {
40
base.SetModel(model);
41
if
(
IsSet
) {
42
return
;
43
}
44
if
(
MeshDrawOrders
.Length != 4) {
45
throw
new
InvalidOperationException(
"Invalid number of meshes in OuterClothing model."
);
46
}
47
MeshDrawOrders
[0] = model.
Meshes
.
IndexOf
(model.
FindMesh
(
"Leg1"
));
48
MeshDrawOrders
[1] = model.
Meshes
.
IndexOf
(model.
FindMesh
(
"Leg2"
));
49
MeshDrawOrders
[2] = model.
Meshes
.
IndexOf
(model.
FindMesh
(
"Body"
));
50
MeshDrawOrders
[3] = model.
Meshes
.
IndexOf
(model.
FindMesh
(
"Head"
));
51
}
52
}
53
}
Engine.Graphics.ModelBone
定义
ModelBone.cs:2
Engine.Graphics.ModelBone.Index
int Index
定义
ModelBone.cs:9
Engine.Graphics.ModelBone.Name
string Name
定义
ModelBone.cs:11
Engine.Graphics.Model.FindMesh
ModelMesh FindMesh(string name, bool throwIfNotFound=true)
定义
Model.cs:28
Engine.Graphics.Model.Meshes
ReadOnlyList< ModelMesh > Meshes
定义
Model.cs:15
Game.ComponentCreature
定义
ComponentCreature.cs:7
Game.ComponentHumanModel
定义
ComponentHumanModel.cs:7
Game.ComponentModel
定义
ComponentModel.cs:8
Game.ComponentModel.Opacity
float? Opacity
定义
ComponentModel.cs:48
Game.ComponentModel.m_subsystemSky
SubsystemSky m_subsystemSky
定义
ComponentModel.cs:9
Game.ComponentModel.SetBoneTransform
virtual void SetBoneTransform(int boneIndex, Matrix? transformation)
定义
ComponentModel.cs:77
Game.ComponentModel.Model
Model Model
定义
ComponentModel.cs:54
Game.ComponentModel.RenderingMode
virtual ModelRenderingMode RenderingMode
定义
ComponentModel.cs:67
Game.ComponentModel.Animated
bool Animated
定义
ComponentModel.cs:12
Game.ComponentModel.IsSet
bool IsSet
定义
ComponentModel.cs:11
Game.ComponentModel.MeshDrawOrders
int[] MeshDrawOrders
定义
ComponentModel.cs:69
Game.ComponentOuterClothingModel
定义
ComponentOuterClothingModel.cs:6
Game.ComponentOuterClothingModel.m_componentCreature
ComponentCreature m_componentCreature
定义
ComponentOuterClothingModel.cs:9
Game.ComponentOuterClothingModel.SetModel
override void SetModel(Model model)
定义
ComponentOuterClothingModel.cs:39
Game.ComponentOuterClothingModel.m_componentHumanModel
ComponentHumanModel m_componentHumanModel
定义
ComponentOuterClothingModel.cs:7
Game.ComponentOuterClothingModel.Animate
override void Animate()
定义
ComponentOuterClothingModel.cs:18
Game.ComponentOuterClothingModel.Load
override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
定义
ComponentOuterClothingModel.cs:11
Game.SubsystemSky
定义
SubsystemSky.cs:8
GameEntitySystem.Component.ValuesDictionary
ValuesDictionary ValuesDictionary
定义
Component.cs:12
GameEntitySystem.Component.Project
Project Project
定义
Component.cs:16
GameEntitySystem.Component.Entity
Entity Entity
定义
Component.cs:14
GameEntitySystem.IdToEntityMap
定义
IdToEntityMap.cs:5
Engine.Graphics
定义
BaseBatch.cs:1
GameEntitySystem
定义
Component.cs:6
Game
定义
ContentFileBridge.cs:4
Game.ModelRenderingMode
ModelRenderingMode
定义
ModelRenderingMode.cs:2
Game.ModelRenderingMode.TransparentAfterWater
@ TransparentAfterWater
定义
ModelRenderingMode.cs:6
TemplatesDatabase
定义
Database.cs:6
Engine.ReadOnlyList-1-g.IndexOf
int IndexOf(T item)
定义
ReadOnlyList.cs:45
SurvivalcraftApi 1.8.2.3
Survivalcraft.Windows
Component
ComponentOuterClothingModel.cs
制作者
1.16.1