public virtual void Initialize(bool forceUpdate = false)
        {
            Softbody2D = GetComponent <Softbody2D>();

            if (MeshFilter.sharedMesh == null)
            {
                MeshFilter.sharedMesh = new Mesh();
            }
        }
Beispiel #2
0
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            if (GUILayout.Button("Generate Softbody2D"))
            {
                Softbody2D script = (Softbody2D)target;
                script.Generate(true);
            }

            if (GUILayout.Button("Clear Forces"))
            {
                Softbody2D script = (Softbody2D)target;
                script.ClearForces();
            }
        }
Beispiel #3
0
 void Awake()
 {
     StartingPosition = this.transform.localPosition;
     ParentSoftbody2D = this.transform.GetComponentInParent <Softbody2D> ();
     m_collider       = this.GetComponent <BoxCollider2D> ();
 }