コード例 #1
0
    // --
    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);
            }
        }
    }
コード例 #2
0
    // ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
    // 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);
            }
        }
    }
コード例 #3
0
 // -- DescStructをDescに適用する
 public override void ApplyDesc(CsObject from, CsObject to)
 {
     (from as PHSliderJointDescStruct).ApplyTo(to as PHSliderJointDesc);
 }
コード例 #4
0
ファイル: CDBoxBehaviour.cs プロジェクト: Springhead/SprUnity
 // -- DescStructをDescに適用する
 public override void ApplyDesc(CsObject from, CsObject to)
 {
     (from as CDBoxDescStruct).ApplyTo(to as CDBoxDesc);
 }
コード例 #5
0
 // -- DescStructをDescに適用する
 public override void ApplyDesc(CsObject from, CsObject to)
 {
     (from as PH1DJointNonLinearMotorDescStruct).ApplyTo(to as PH1DJointNonLinearMotorDesc);
 }
コード例 #6
0
 // -- DescStructをDescに適用する
 public override void ApplyDesc(CsObject from, CsObject to)
 {
     // (from as HISpidarGDescStruct).ApplyTo(to as HISpidarGDesc);
 }
コード例 #7
0
 // -- DescStructをDescに適用する
 public override void ApplyDesc(CsObject from, CsObject to)
 {
     (from as PHRootNodeDescStruct).ApplyTo(to as PHRootNodeDesc);
 }
コード例 #8
0
 // -- DescStructをDescに適用する
 public override void ApplyDesc(CsObject from, CsObject to)
 {
     (from as PHBallJointConeLimitDescStruct).ApplyTo(to as PHBallJointConeLimitDesc);
 }
コード例 #9
0
 // -- DescStructをDescに適用する
 public override void ApplyDesc(CsObject from, CsObject to)
 {
     (from as PHHuman1DJointResistanceDescStruct).ApplyTo(to as PHHuman1DJointResistanceDesc);
 }
コード例 #10
0
 // -- DescStructをDescに適用する
 public override void ApplyDesc(CsObject from, CsObject to)
 {
     (from as PHIKSpringActuatorDescStruct).ApplyTo(to as PHIKSpringActuatorDesc);
 }
コード例 #11
0
 // -- DescStructをDescに適用する
 public override void ApplyDesc(CsObject from, CsObject to)
 {
     (from as PHIKEndEffectorDescStruct).ApplyTo(to as PHIKEndEffectorDesc);
 }
コード例 #12
0
 // -- DescStructをDescに適用する
 public abstract void ApplyDesc(CsObject from, CsObject to);
コード例 #13
0
ファイル: PHOpBehaviour.cs プロジェクト: Springhead/SprUnity
 public override void ApplyDesc(CsObject from, CsObject to)
 {
     //commented because PHOpObjDescStruct initialization have bug
     //(from as PHOpObjDescStruct).ApplyTo(to as PHOpObjDesc);
 }
コード例 #14
0
 // -- DescStructをDescに適用する
 public override void ApplyDesc(CsObject from, CsObject to)
 {
     (from as PHHingeJointDescStruct).ApplyTo(to as PHHingeJointDesc);
     (from as PH1DJointDescStruct).ApplyTo(to as PH1DJointDesc);
 }
コード例 #15
0
 // -- DescStructをDescに適用する
 public override void ApplyDesc(CsObject from, CsObject to)
 {
     // Verticesには代入できないしすべきでないので、Materialだけを適用する
     (from as CDConvexMeshDescStruct).material.ApplyTo((to as CDConvexMeshDesc).material);
 }