Пример #1
0
        public void Setup(string[] joints, List <Transformer> args, TREE tree)
        {
            if (joints != null)
            {
                MakeDefaults(joints.Length);
                root = tree.gameObject;

                initialRotation.Clear();
                selectedJoints.Clear();

                for (var i = 0; i < joints.Length; i++)
                {
                    var firstList     = TREEUtils.makeList(joints [i], tree.GetComponent <TREE>());
                    var initRotations = new List <Vector3>();

                    foreach (var t in firstList)
                    {
                        var g = TREEUtils.findJoint(t, 0, root.transform.GetChild(0).gameObject);
                        initRotations.Add(g.transform.localEulerAngles);
                    }

                    initialRotation.Add(initRotations);
                    selectedJoints.Add(firstList);
                }

                Transformers = args;
            }
        }
Пример #2
0
        public static List <List <int[]> > ArgsArrayToJointList(string[] joints, TREE tree)
        {
            GameObject           root           = tree.gameObject;
            List <List <int[]> > SelectedJoints = new List <List <int[]> > ();

            for (int i = 0; i < joints.Length; i++)
            {
                List <int[]> firstList = TREEUtils.makeList(joints[i], tree.GetComponent <TREE>());

                for (int p = 0; p < firstList.Count; p++)
                {
                    GameObject g = TREEUtils.findJoint(firstList[p], 0, root.transform.GetChild(0).gameObject);
                }

                SelectedJoints.Add(firstList);
            }

            return(SelectedJoints);
        }
Пример #3
0
        public void Setup(string[] joints, string[] args, TREE tree)
        {
            //		if (!defaultsMade) {
            if (joints != null)
            {
                makeDefaults(joints.Length);
                root         = tree.gameObject;
                defaultsMade = true;
                //		}

                initialRotation.Clear();
                SelectedJoints.Clear();

                for (int i = 0; i < joints.Length; i++)
                {
                    List <int[]>   firstList     = TREEUtils.makeList(joints [i], tree.GetComponent <TREE> ());
                    List <Vector3> initRotations = new List <Vector3> ();

                    for (int p = 0; p < firstList.Count; p++)
                    {
                        GameObject g = TREEUtils.findJoint(firstList [p], 0, root.transform.GetChild(0).gameObject);
                        initRotations.Add(g.transform.localEulerAngles);
                    }

                    initialRotation.Add(initRotations);
                    SelectedJoints.Add(firstList);

                    string[] arg = args [i].Split(new string[] { "," }, System.StringSplitOptions.None);
                    for (int j = 0; j < arg.Length; j++)
                    {
                        string[] a = arg [j].Split(new string[] { ":" }, System.StringSplitOptions.None);
                        if (a.Length > 1)
                        {
                            Transforms [i] [a [0]] = float.Parse(a [1]);
                        }
                    }
                }
            }
        }