Example #1
0
    //準備
    void Preparation()
    {
        parent      = transform.root.gameObject;
        parts       = GetAllChildren(parent);
        clingJoints = GetAllClingJoint();
        mascles     = GetAllMascle();
        foreach (GameObject obj in parts)
        {
            var tmpRb = obj.GetComponent <Rigidbody>();
            if (tmpRb != null)
            {
                tmpRb.maxAngularVelocity = 30f;
            }
        }

        Spine1  = FindChild("Spine1").GetComponent <Rigidbody>();
        R_UpLeg = FindChild("R_UpLeg").GetComponent <Rigidbody>();
        L_UpLeg = FindChild("L_UpLeg").GetComponent <Rigidbody>();

        mslL_Leg   = FindChild("L_Leg").GetComponent <mascle>();
        mslR_Leg   = FindChild("R_Leg").GetComponent <mascle>();
        mslL_UpLeg = FindChild("L_UpLeg").GetComponent <Trank>();
        mslR_UpLeg = FindChild("R_UpLeg").GetComponent <Trank>();


        rb         = GetComponent <Rigidbody>();
        base_pos   = rb_Trapaze.transform.InverseTransformPoint(rb.position);
        base_pos.x = 0f;
    }
Example #2
0
 public RezeptViewModel(Trank trank)
 {
     if (trank == null)
     {
         throw new ArgumentNullException(nameof(trank));
     }
     _rezept = trank.Rezept;
 }
Example #3
0
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            if (values == null)
            {
                throw new ArgumentNullException(nameof(values));
            }
            int mod = 0;

            if (values.Length > 3 && values[0] is LaborID lab1 && values[1] is LaborID lab2 && values[2] is bool chym)
            {
                mod = Trank.CalculateLaborMod(lab1, lab2) + (chym ? -1 : 0);
                for (int i = 3; i < values.Length; i++)
                {
                    mod += System.Convert.ToInt32(values[i], culture);
                }
            }
            return(mod);
        }
Example #4
0
 public BrauenViewModel(Trank trank) : this()
 {
     _trank = trank;
 }
Example #5
0
 public BrauenViewModel(Character character) : this()
 {
     _trank = new Trank(character);
 }
Example #6
0
 public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
 {
     if (values == null)
     {
         throw new ArgumentNullException(nameof(values));
     }
     if (values.Length >= 3 && values[0] is int mod && values[1] is LaborID lab1 && values[2] is LaborID lab2)
     {
         return((int)Math.Max(0, Math.Ceiling(System.Convert.ToDouble(mod) * 1.5) - Trank.CalculateLaborMod(lab1, lab2)));
     }
     return(0);
 }
 public HaltbarkeitViewModel(Trank trank) : this()
 {
     Trank = trank;
 }