本文整理汇总了C#中Maid类的典型用法代码示例。如果您正苦于以下问题:C# Maid类的具体用法?C# Maid怎么用?C# Maid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Maid类属于命名空间,在下文中一共展示了Maid类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: UpdateMaid
/// <summary>
/// メイドを更新する.
/// 名前が未指定の場合は、statusのlast_nameとfirst_nameから生成する.
///
/// </summary>
/// <param name="maid0">メイド</param>
/// <param name="name">メイドの名前</param>
/// <param name="act"></param>
/// <returns>別のメイドに変更された場合、trueを返す</returns>
public bool UpdateMaid(Maid maid0, string name, Action act)
{
if (maid0 == null) {
// メイドリストから最初に有効なメイドを取得
int count = GameMain.Instance.CharacterMgr.GetMaidCount();
for (int i=0; i< count; i++) {
Maid m = GameMain.Instance.CharacterMgr.GetMaid(i);
if (m != null && m.enabled) {
maid0 = m;
break;
}
}
}
if (currentMaid == maid0) return false;
currentMaid = maid0;
if (currentMaid != null) {
MaidName = name?? currentMaid.Param.status.last_name + " " + currentMaid.Param.status.first_name;
isOfficial = checkOfficial(currentMaid);
} else {
MaidName = "(not selected)";
}
LogUtil.Debug("maid changed.", MaidName);
act();
return true;
}
开发者ID:trzr,项目名称:CM3D2.AlwaysColorChangeEx.Plugin,代码行数:36,代码来源:MaidHolder.cs
示例2: UpdateTex
public bool UpdateTex(Maid maid, Material[] slotMaterials, EditTarget texEdit) {
// material 抽出 => texture 抽出
if (slotMaterials.Length <= texEdit.matNo) return false;
Material mat = slotMaterials[texEdit.matNo];
return UpdateTex(maid, mat, texEdit);
}
开发者ID:trzr,项目名称:CM3D2.AlwaysColorChangeEx.Plugin,代码行数:7,代码来源:TextureModifier.cs
示例3: Update
public void Update(Maid maid, Dictionary<string, List<Material>> slotMaterials,
List<Texture2D> textures, EditTarget texEdit ) {
originalTexCache.Refresh(textures.ToArray());
FilterTexture(slotMaterials, textures, maid, texEdit);
}
开发者ID:trzr,项目名称:CM3D2.AlwaysColorChangeEx.Plugin,代码行数:7,代码来源:TextureModifier.cs
示例4: SetClassLevel
private void SetClassLevel(Maid maid, string classDataFieldName, int classID, int level)
{
FieldInfo classDataField = maid.Param.status_.GetType().GetField(classDataFieldName);
object classData =
classDataField.FieldType.GetMethod("GetValue", new[] {typeof(int)})
.Invoke(classDataField.GetValue(maid.Param.status_), new[] {(object) classID});
((SimpleExperienceSystem) classData.GetType().GetField("exp_system").GetValue(classData)).SetLevel(level);
}
开发者ID:denikson,项目名称:CM3D2.MaidFiddler,代码行数:8,代码来源:MaidFiddlerGUI.Cheats.cs
示例5: ProcGUI
public void ProcGUI(Maid maid, string slotName, Material material, string propName, float margin, float fontSize, float itemHeight)
{
FilterParam fp = Get(maid, slotName, material, propName);
if (fp != null)
{
fp.ProcGUI(margin, fontSize, itemHeight);
}
}
开发者ID:neguse11,项目名称:CM3D2.AlwaysColorChange.Plugin,代码行数:8,代码来源:TextureModifier.cs
示例6: SetClassIsHave
private void SetClassIsHave(Maid maid, string classDataFieldName, int classID, bool value)
{
FieldInfo classDataField = maid.Param.status_.GetType().GetField(classDataFieldName);
object classData =
classDataField.FieldType.GetMethod("GetValue", new[] {typeof(int)})
.Invoke(classDataField.GetValue(maid.Param.status_), new[] {(object) classID});
classData.GetType().GetField("is_have").SetValue(classData, value);
}
开发者ID:denikson,项目名称:CM3D2.MaidFiddler,代码行数:8,代码来源:MaidFiddlerGUI.Cheats.cs
示例7: MaidCompareCreateTime
public static int MaidCompareCreateTime(Maid x, Maid y)
{
int result;
if (x.Param.status.create_time_num < y.Param.status.create_time_num)
result = -1;
else
result = x.Param.status.create_time_num == y.Param.status.create_time_num ? 0 : 1;
return result;
}
开发者ID:MrSwiss,项目名称:CM3D2.MaidFiddler,代码行数:9,代码来源:MaidSortFix.cs
示例8: ProcGUI
public void ProcGUI(Maid maid, string slotName, Material material, string propName) {
// material 抽出 => texture 抽出
var tex2d = material.GetTexture(propName) as Texture2D;
if (tex2d == null || string.IsNullOrEmpty(tex2d.name)) return ;
var key = CreateKey(maid.Param.status.guid, slotName, material.name, tex2d.name);
FilterParam fp = filterParams.GetOrAdd(key.ToString());
fp.ProcGUI(tex2d);
}
开发者ID:trzr,项目名称:CM3D2.AlwaysColorChangeEx.Plugin,代码行数:9,代码来源:TextureModifier.cs
示例9: Get
/// <summary>
/// 拡張セーブデータ内の設定を得る(文字列)
/// <para>指定した設定が存在しない場合はdefaultValueを返す</para>
/// <seealso cref="GetBool"/>
/// <seealso cref="GetInt"/>
/// <seealso cref="GetFloat"/>
/// </summary>
/// <param name="maid">メイドインスタンス</param>
/// <param name="pluginName">プラグイン名("CM3D2.Test.Plugin"など)</param>
/// <param name="propName">プロパティ名</param>
/// <param name="defaultValue">プロパティが存在しない場合に返すデフォルト値</param>
/// <returns>設定文字列</returns>
public static string Get(Maid maid, string pluginName, string propName, string defaultValue)
{
if (maid == null || pluginName == null || propName == null)
{
return defaultValue;
}
if (!Contains(maid))
{
SetMaid(maid);
}
return PluginSettings.Get(maid.Param.status.guid, pluginName, propName, defaultValue);
}
开发者ID:yknD-CM3D2,项目名称:cm3d2_plugins_okiba,代码行数:24,代码来源:ExSaveData.cs
示例10: LoadCameraSettings
void LoadCameraSettings(Maid maid)
{
if (maid == null || !maid.Visible)
{
return;
}
bool autoCam = ExSaveData.GetBool(maid, PluginName, "AutoCameraInitialValue", true);
if (autoCam)
{
return;
}
float cameraPosX = ExSaveData.GetFloat(maid, PluginName, "CameraPos.x", float.NaN);
float cameraPosY = ExSaveData.GetFloat(maid, PluginName, "CameraPos.y", float.NaN);
float cameraPosZ = ExSaveData.GetFloat(maid, PluginName, "CameraPos.z", float.NaN);
float cameraTargetPosX = ExSaveData.GetFloat(maid, PluginName, "CameraTargetPos.x", float.NaN);
float cameraTargetPosY = ExSaveData.GetFloat(maid, PluginName, "CameraTargetPos.y", float.NaN);
float cameraTargetPosZ = ExSaveData.GetFloat(maid, PluginName, "CameraTargetPos.z", float.NaN);
float cameraDistance = ExSaveData.GetFloat(maid, PluginName, "CameraDistance", float.NaN);
float cameraRotatationX = ExSaveData.GetFloat(maid, PluginName, "CameraRotation.x", float.NaN);
float cameraRotatationY = ExSaveData.GetFloat(maid, PluginName, "CameraRotation.y", float.NaN);
float cameraRotatationZ = ExSaveData.GetFloat(maid, PluginName, "CameraRotation.z", float.NaN);
float cameraRotatationW = ExSaveData.GetFloat(maid, PluginName, "CameraRotation.w", float.NaN);
float cameraFov = ExSaveData.GetFloat(maid, PluginName, "CameraFov", float.NaN);
if (!float.IsNaN(cameraRotatationX) && !float.IsNaN(cameraRotatationY) && !float.IsNaN(cameraRotatationZ) && !float.IsNaN(cameraRotatationW))
{
Camera.main.gameObject.transform.rotation = new Quaternion(cameraRotatationX, cameraRotatationY, cameraRotatationZ, cameraRotatationW);
}
if (!float.IsNaN(cameraPosX) && !float.IsNaN(cameraPosY) && !float.IsNaN(cameraPosZ))
{
mainCamera.SetPos(new Vector3(cameraPosX, cameraPosY, cameraPosZ));
}
if (!float.IsNaN(cameraTargetPosX) && !float.IsNaN(cameraTargetPosY) && !float.IsNaN(cameraTargetPosZ))
{
mainCamera.SetTargetPos(new Vector3(cameraTargetPosX, cameraTargetPosY, cameraTargetPosZ), true);
}
if (!float.IsNaN(cameraDistance))
{
mainCamera.SetDistance(cameraDistance, true);
}
if (!float.IsNaN(cameraFov))
{
Camera.main.fieldOfView = cameraFov;
}
}
开发者ID:nnnna,项目名称:cm3d2_plugins_okiba,代码行数:50,代码来源:PersonalizedEditSceneSettingsPlugin.cs
示例11: Update
public void Update(
Maid maid,
Dictionary<string, List<Material>> slotMaterials,
List<Texture2D> textures,
string slotName, int materialIndex, string propName
)
{
originalTextureCache.Refresh(textures.ToArray());
// マウスボタンが離されたタイミングでフィルターを適用する
if (Input.GetMouseButtonUp(0))
{
FilterTexture(slotMaterials, textures, maid, slotName, materialIndex, propName);
}
}
开发者ID:neguse11,项目名称:CM3D2.AlwaysColorChange.Plugin,代码行数:15,代码来源:TextureModifier.cs
示例12: GetKey
private string GetKey(Maid maid, string slotName, Material material, string propName)
{
if (maid == null || material == null || string.IsNullOrEmpty(propName))
{
return null;
}
Texture2D tex2d = material.GetTexture(propName) as Texture2D;
if (tex2d == null || string.IsNullOrEmpty(tex2d.name))
{
return null;
}
return string.Format("{0}/{1}/{2}/{3}"
, maid.Param.status.guid
, slotName
, material.name
, tex2d.name);
}
开发者ID:neguse11,项目名称:CM3D2.AlwaysColorChange.Plugin,代码行数:17,代码来源:TextureModifier.cs
示例13: TouchableMaid
/// <summary>
/// KHông thể tin nổi là đóng này được dùng với update
/// </summary>
/// <param name="maid"></param>
public TouchableMaid(Maid maid)
{
this._maid = maid;
try
{
this._personal = (Personality)Enum.Parse(typeof(Personality), this._maid.Param.status.personal.ToString());
}
catch
{
this._personal = Personality.Other;
}
this._persistPoseSeconds = -1;
this._touchTargets.Add(new TouchTarget(this._maid, "target_mune", new Vector3(0.1f, 0.1f, 0.1f), "_IK_muneR", null));
this._touchTargets.Add(new TouchTarget(this._maid, "target_mune", new Vector3(0.1f, 0.1f, 0.1f), "_IK_muneL", null));
this._touchTargets.Add(new TouchTarget(this._maid, "target_hip", new Vector3(0.12f, 0.12f, 0.12f), "_IK_hipL", "Hip_L"));
this._touchTargets.Add(new TouchTarget(this._maid, "target_hip", new Vector3(0.12f, 0.12f, 0.12f), "_IK_hipR", "Hip_R"));
this._touchTargets.Add(new TouchTarget(this._maid, "target_vagina", new Vector3(0.08f, 0.08f, 0.08f), "Bip01 Pelvis", null));
}
开发者ID:chisanu,项目名称:CM3D2.Chisanu.plugin,代码行数:22,代码来源:TouchableMaid.cs
示例14: Set
/// <summary>
/// 拡張セーブデータへ設定を書き込む
/// <seealso cref="SetBool"/>
/// <seealso cref="SetInt"/>
/// <seealso cref="SetFloat"/>
/// </summary>
/// <param name="maid">メイドインスタンス</param>
/// <param name="pluginName">プラグイン名("CM3D2.Test.Plugin"など)</param>
/// <param name="propName">プロパティ名</param>
/// <param name="value">書き込む値</param>
/// <param name="overwrite">trueなら常に上書き。falseなら設定が存在する場合は書き込みを行わない</param>
/// <returns>true:書き込み成功。false:失敗</returns>
public static bool Set(Maid maid, string pluginName, string propName, string value, bool overwrite)
{
if (maid == null || pluginName == null || propName == null)
{
return false;
}
if (!Contains(maid))
{
SetMaid(maid);
}
if (!overwrite)
{
if (Contains(maid, pluginName, propName))
{
return false;
}
}
return PluginSettings.Set(maid.Param.status.guid, pluginName, propName, value);
}
开发者ID:yknD-CM3D2,项目名称:cm3d2_plugins_okiba,代码行数:31,代码来源:ExSaveData.cs
示例15: MaidInfo
public MaidInfo(Maid maid, MaidFiddlerGUI gui)
{
Debugger.WriteLine("Creating new MaidInfo");
this.gui = gui;
forceUpdateNightWorks = new Dictionary<int, bool>();
Maid = maid;
ValueLocks = new Dictionary<MaidChangeType, bool>();
EnumHelper.MaidChangeTypes.ForEach(t => ValueLocks.Add(t, false));
TempUnlocks = new Dictionary<MaidChangeType, bool>();
EnumHelper.MaidChangeTypes.ForEach(t => TempUnlocks.Add(t, false));
#if DEBUG
Debugger.WriteLine(LogLevel.Info, "Loading functions");
Stopwatch watch = new Stopwatch();
watch.Start();
#endif
InitFunctions();
#if DEBUG
watch.Stop();
Debugger.WriteLine(
LogLevel.Info,
$"Functions loaded. Time taken: {watch.Elapsed.TotalMilliseconds} ms.");
#endif
}
开发者ID:MrSwiss,项目名称:CM3D2.MaidFiddler,代码行数:23,代码来源:MaidInfo.cs
示例16: RotatePupil
// 瞳の角度を目の角度に合わせて補正
void RotatePupil(Maid maid, TBody tbody)
{
/*
// 注意:TBody.MoveHeadAndEye内で trsEye[L,R].localRotation が上書きされているため、
// この値は TBody.MoveHeadAndEyeが呼ばれるたびに書き換える必要がある
float eyeAng = ExSaveData.GetFloat(maid, PluginName, "EYE_ANG.angle", 0f);
Vector3 eea = (Vector3)Helper.GetInstanceField(typeof(TBody), tbody, "EyeEulerAngle");
tbody.trsEyeL.localRotation = tbody.quaDefEyeL * Quaternion.Euler(eyeAng, eea.x * -0.2f, eea.z * -0.1f);
tbody.trsEyeR.localRotation = tbody.quaDefEyeR * Quaternion.Euler(-eyeAng, eea.x * 0.2f, eea.z * 0.1f);
*/
}
开发者ID:REI8492,项目名称:cm3d2_plugins_okiba,代码行数:12,代码来源:MaidVoicePitchPlugin.cs
示例17: Mabataki
// まばたき制限
void Mabataki(Maid maid)
{
float mabatakiVal = (float)Helper.GetInstanceField(typeof(Maid), maid, "MabatakiVal");
float f = Mathf.Clamp01(1f - ExSaveData.GetFloat(maid, PluginName, "MABATAKI", 1f));
float mMin = Mathf.Asin(f);
float mMax = (float)Math.PI - mMin;
mMin = Mathf.Pow(mMin / (float)Math.PI, 0.5f);
mMax = Mathf.Pow(mMax / (float)Math.PI, 0.5f);
mabatakiVal = Mathf.Clamp(mabatakiVal, mMin, mMax);
if (ExSaveData.GetBool(maid, PluginName, "MUHYOU", false))
{
// 無表情の場合、常に目を固定
mabatakiVal = mMin;
}
Helper.SetInstanceField(typeof(Maid), maid, "MabatakiVal", mabatakiVal);
}
开发者ID:REI8492,项目名称:cm3d2_plugins_okiba,代码行数:17,代码来源:MaidVoicePitchPlugin.cs
示例18: HeadToCam
// 顔を常時カメラに向ける
void HeadToCam(Maid maid, TBody tbody)
{
float fHeadToCam = ExSaveData.GetFloat(maid, PluginName, "HEADTOCAM", 0f);
if (fHeadToCam < -0.5f)
{
tbody.boHeadToCam = false;
}
else if (fHeadToCam > 0.5f)
{
tbody.boHeadToCam = true;
}
}
开发者ID:REI8492,项目名称:cm3d2_plugins_okiba,代码行数:13,代码来源:MaidVoicePitchPlugin.cs
示例19: ForeArmFix
// ForeArmFix : 前腕の歪みを修正する CM3D.MaidVoicePitch.Plugin.cs の追加メソッド
// CM3D.MaidVoicePitch.Plugin を適用しメイドのフリーコメント欄に #FARMFIX# の記述で前腕の歪みを修正する。
// 前腕歪みバグを修正
void ForeArmFix(Maid maid)
{
if (!ExSaveData.GetBool(maid, PluginName, "FARMFIX", false))
{
return;
}
BoneMorph_ bm_ = maid.body0.bonemorph;
List<Transform> tListFAL = new List<Transform>();
List<Transform> tListFAR = new List<Transform>();
float sclUAx = -1f;
for (int i = 0; i < bm_.bones.Count; i++)
{
if (bm_.bones[i].linkT == null) continue;
if (bm_.bones[i].linkT.name == "Bip01 L Forearm") tListFAL.Add(bm_.bones[i].linkT);
if (bm_.bones[i].linkT.name == "Bip01 R Forearm") tListFAR.Add(bm_.bones[i].linkT);
if (sclUAx < 0f && bm_.bones[i].linkT.name == "Bip01 L UpperArm") sclUAx = bm_.bones[i].linkT.localScale.x;
}
if (sclUAx < 0f || tListFAL.Count < 1 || tListFAR.Count < 1) return;
Vector3 sclUA = new Vector3(sclUAx, 1f, 1f);
Vector3 antisclUA_d = new Vector3(1f / sclUAx - 1f, 0f, 0f);
Vector3 eaFAL = tListFAL[0].localRotation.eulerAngles;
Vector3 eaFAR = tListFAR[0].localRotation.eulerAngles;
Quaternion antirotFAL = Quaternion.Euler(eaFAL - new Vector3(180f, 180f, 180f));
Quaternion antirotFAR = Quaternion.Euler(eaFAR - new Vector3(180f, 180f, 180f));
Vector3 sclFAL_d = antirotFAL * antisclUA_d;
Vector3 sclFAR_d = antirotFAR * antisclUA_d;
Vector3 antisclFAL = new Vector3(1f, 1f, 1f) + new Vector3(Mathf.Abs(sclFAL_d.x), Mathf.Abs(sclFAL_d.y), Mathf.Abs(sclFAL_d.z));
Vector3 antisclFAR = new Vector3(1f, 1f, 1f) + new Vector3(Mathf.Abs(sclFAR_d.x), Mathf.Abs(sclFAR_d.y), Mathf.Abs(sclFAR_d.z));
foreach (Transform t in tListFAL) t.localScale = Vector3.Scale(antisclFAL, sclUA);
foreach (Transform t in tListFAR) t.localScale = Vector3.Scale(antisclFAR, sclUA);
}
开发者ID:REI8492,项目名称:cm3d2_plugins_okiba,代码行数:42,代码来源:MaidVoicePitchPlugin.cs
示例20: EyeToCam
// 目を常時カメラに向ける
void EyeToCam(Maid maid, TBody tbody)
{
float fEyeToCam = ExSaveData.GetFloat(maid, PluginName, "EYETOCAM", 0f);
if (fEyeToCam < -0.5f)
{
tbody.boEyeToCam = false;
}
else if (fEyeToCam > 0.5f)
{
tbody.boEyeToCam = true;
}
}
开发者ID:REI8492,项目名称:cm3d2_plugins_okiba,代码行数:13,代码来源:MaidVoicePitchPlugin.cs
注:本文中的Maid类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论