// -- Sprオブジェクトの構築を行う public override ObjectIf Build() { PHHingeJointIf jo = gameObject.GetComponent <PHHingeJointBehaviour>().sprObject as PHHingeJointIf; if (jo == null) { Debug.Log("No Joint"); return(null); } PH1DJointNonLinearMotorDesc d = (PH1DJointNonLinearMotorDesc)desc; PH1DJointNonLinearMotorIf m = jo.CreateMotor(PH1DJointNonLinearMotorIf.GetIfInfoStatic(), d) as PH1DJointNonLinearMotorIf; if (m == null) { Debug.Log("Motor Null"); return(null); } arraywrapper_double s_double, d_double; switch (springMode) { case 0: s_double = new arraywrapper_double(2); Copy(springParam, s_double, 2); break; case 1: s_double = new arraywrapper_double(4); Copy(springParam, s_double, 4); break; default: springMode = 0; s_double = new arraywrapper_double(4); Copy(springParam, s_double, 4); break; } switch (damperMode) { case 0: d_double = new arraywrapper_double(2); Copy(damperParam, d_double, 2); break; case 1: d_double = new arraywrapper_double(4); Copy(damperParam, d_double, 4); break; default: damperMode = 0; d_double = new arraywrapper_double(4); Copy(damperParam, d_double, 4); break; } // m.SetFuncFromDatabase(springMode, damperMode, s_double, d_double); return(m); }
// -- Sprオブジェクトの構築を行う public override ObjectIf Build() { PHHingeJointIf jo = gameObject.GetComponent <PHHingeJointBehaviour>().sprObject as PHHingeJointIf; if (jo == null) { return(null); } PHHuman1DJointResistanceIf motor = jo.CreateMotor(PHHuman1DJointResistanceIf.GetIfInfoStatic(), (PHHuman1DJointResistanceDesc)desc) as PHHuman1DJointResistanceIf; return(motor); }