Пример #1
0
        // Use this for initialization
        void Start()
        {
            ac          = m_ObjectToAnimate.GetComponent <Animator>();
            ac_parms    = ac.parameters;
            skel_script = m_SkeletonObject.GetComponent <DASkeleton>();

            Toggle chk_skel = GameObject.Find("DAChkBox_Skel").GetComponent <Toggle>();

            chk_skel.isOn = skel_script.m_ShowSkeleton;
        }
Пример #2
0
        public void goInit(GameObject child_in, GameObject skel_root_in)
        {
            skel_root     = skel_root_in;
            parent_script = skel_root.GetComponent <DASkeleton>();

            child_go = child_in;

            transform.localPosition = child_go.transform.localPosition;


            // Add Bone Line Renderer (Background)
            lr_bg               = transform.Find("Line_BG").gameObject.AddComponent <LineRenderer>();
            lr_bg.material      = new Material(Shader.Find("Sprites/Default"));
            lr_bg.useWorldSpace = true;
            lr_bg.positionCount = 2;
            lr_bg.startWidth    = .3f;
            lr_bg.endWidth      = .13f;
            lr_bg.sortingOrder  = 990;
            lr_bg.startColor    = parent_script.m_BoneBGColor;
            lr_bg.endColor      = parent_script.m_BoneBGColor;

            // Add Bone Line Renderer (Foregound)
            lr_fg               = transform.Find("Line_FG").gameObject.AddComponent <LineRenderer>();
            lr_fg.material      = new Material(Shader.Find("Sprites/Default"));
            lr_fg.useWorldSpace = true;
            lr_fg.positionCount = 2;
            lr_fg.startWidth    = .2f;
            lr_fg.endWidth      = .03f;
            lr_fg.sortingOrder  = 991;
            lr_fg.startColor    = parent_script.m_BoneFGColor;
            lr_fg.endColor      = parent_script.m_BoneFGColor;


            // Set Joint color
            transform.Find("Joint/Sphere").gameObject.GetComponent <Renderer>().material.color = parent_script.m_JointColor;

            // Set Glow color
            transform.Find("Joint/Glow").gameObject.GetComponent <Renderer>().material.color = parent_script.m_JointGlowColor;
        }