예제 #1
0
            public void Initialize(SpeculativeRigidbody rigbody)
            {
                m_cables = new List <ArbitraryCableDrawer>();
                GameObject           thisIsCrazy = new GameObject("cableHelper");
                GameObject           superCrazy  = UnityEngine.Object.Instantiate <GameObject>(thisIsCrazy, rigbody.UnitCenter, Quaternion.identity);
                ArbitraryCableDrawer cable       = superCrazy.gameObject.GetOrAddComponent <ArbitraryCableDrawer>();

                cable.Initialize(rigbody.transform, superCrazy.transform);
                m_cables.Add(cable);

                m_rigidbody = rigbody;

                cable.GetComponent <Mesh>().SetColors(new List <Color>()
                {
                    Color.red
                });
            }