// -- public virtual void OnValidate() { if (GetDescStruct() == null) { ResetDescStruct(); } if (sprObject != null) { CsObject d = CreateDesc(); if (d != null) { sprObject.GetDesc(d); ApplyDesc(GetDescStruct(), d); sprObject.SetDesc(d); } } }
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- // MonoBehaviourのメソッド // UnityのOnValidate : SprBehaviourのものをオーバーライド public override void OnValidate() { if (GetDescStruct() == null) { ResetDescStruct(); } if (sprObject != null) { CsObject d = CreateDesc(); if (d != null) { var descStruct = GetDescStruct(); sprObject.GetDesc(d); ApplyDesc(descStruct, d); sprObject.SetDesc(d); // SetDescとは別に別途設定する必要があるようだ (sprObject as CDShapeIf).SetMaterial((descStruct as CDShapeDescStruct).material); } } }
// -- DescStructをDescに適用する public override void ApplyDesc(CsObject from, CsObject to) { (from as PHSliderJointDescStruct).ApplyTo(to as PHSliderJointDesc); }
// -- DescStructをDescに適用する public override void ApplyDesc(CsObject from, CsObject to) { (from as CDBoxDescStruct).ApplyTo(to as CDBoxDesc); }
// -- DescStructをDescに適用する public override void ApplyDesc(CsObject from, CsObject to) { (from as PH1DJointNonLinearMotorDescStruct).ApplyTo(to as PH1DJointNonLinearMotorDesc); }
// -- DescStructをDescに適用する public override void ApplyDesc(CsObject from, CsObject to) { // (from as HISpidarGDescStruct).ApplyTo(to as HISpidarGDesc); }
// -- DescStructをDescに適用する public override void ApplyDesc(CsObject from, CsObject to) { (from as PHRootNodeDescStruct).ApplyTo(to as PHRootNodeDesc); }
// -- DescStructをDescに適用する public override void ApplyDesc(CsObject from, CsObject to) { (from as PHBallJointConeLimitDescStruct).ApplyTo(to as PHBallJointConeLimitDesc); }
// -- DescStructをDescに適用する public override void ApplyDesc(CsObject from, CsObject to) { (from as PHHuman1DJointResistanceDescStruct).ApplyTo(to as PHHuman1DJointResistanceDesc); }
// -- DescStructをDescに適用する public override void ApplyDesc(CsObject from, CsObject to) { (from as PHIKSpringActuatorDescStruct).ApplyTo(to as PHIKSpringActuatorDesc); }
// -- DescStructをDescに適用する public override void ApplyDesc(CsObject from, CsObject to) { (from as PHIKEndEffectorDescStruct).ApplyTo(to as PHIKEndEffectorDesc); }
// -- DescStructをDescに適用する public abstract void ApplyDesc(CsObject from, CsObject to);
public override void ApplyDesc(CsObject from, CsObject to) { //commented because PHOpObjDescStruct initialization have bug //(from as PHOpObjDescStruct).ApplyTo(to as PHOpObjDesc); }
// -- DescStructをDescに適用する public override void ApplyDesc(CsObject from, CsObject to) { (from as PHHingeJointDescStruct).ApplyTo(to as PHHingeJointDesc); (from as PH1DJointDescStruct).ApplyTo(to as PH1DJointDesc); }
// -- DescStructをDescに適用する public override void ApplyDesc(CsObject from, CsObject to) { // Verticesには代入できないしすべきでないので、Materialだけを適用する (from as CDConvexMeshDescStruct).material.ApplyTo((to as CDConvexMeshDesc).material); }