Exemplo n.º 1
0
        public override void OnEnable()
        {
            base.OnEnable();
            body = (ObiSoftbody)target;

            particlePropertyNames.AddRange(new string[] { "Rotational Mass" });
        }
Exemplo n.º 2
0
        static void CreateObiSoftbody()
        {
            GameObject c = new GameObject("Obi Softbody");

            Undo.RegisterCreatedObjectUndo(c, "Create Obi Softbody");
            ObiSoftbody        body    = c.AddComponent <ObiSoftbody>();
            ObiSoftbodySkinner skinner = c.AddComponent <ObiSoftbodySkinner>();

            body.Solver = c.AddComponent <ObiSolver>();
        }
        public void Awake()
        {
            // autoinitialize "target" with the first skinned mesh renderer we find up our hierarchy.
            m_Target = GetComponent <SkinnedMeshRenderer>();

            // autoinitialize "source" with the first softbody we find up our hierarchy.
            if (Source == null)
            {
                Source = GetComponentInParent <ObiSoftbody>();
            }
            else
            {
                Source.OnInterpolate += UpdateBones;
            }
        }
Exemplo n.º 4
0
        public void Awake()
        {
            // autoinitialize "target" with the first skinned mesh renderer we find up our hierarchy.
            target = GetComponent <SkinnedMeshRenderer>();

            // autoinitialize "source" with the first softbody we find up our hierarchy.
            if (source == null)
            {
                source = GetComponentInParent <ObiSoftbody>();
            }

            Source_OnInitialized(this, null);

            CreateBones();
        }