Example #1
0
 public void SetupWindow(JellyObject targetJelly)
 {
     _target  = targetJelly;
     _texture = _target.GetComponent <SpriteRenderer>().sprite.texture;
     if (_target.GetComponent <PolygonCollider2D>())
     {
         _points = _target.GetComponent <PolygonCollider2D>().points;
     }
     else
     {
         _points = _target.gameObject.AddComponent <PolygonCollider2D>().points;
     }
     _render = true;
 }
 public void SetupWindow(JellyObject targetJelly)
 {
     _target = targetJelly;
     _texture = _target.GetComponent<SpriteRenderer>().sprite.texture;
     if (_target.GetComponent<PolygonCollider2D>())
     {
         _points = _target.GetComponent<PolygonCollider2D>().points;
     }
     else
     {
         _points = _target.gameObject.AddComponent<PolygonCollider2D>().points;
     }
     _render = true;
 }
Example #3
0
        public override void OnInspectorGUI()
        {
            _target = target as JellyObject;

            _target.SpringK         = EditorGUILayout.FloatField("SpringK:", _target.SpringK);
            _target.Damping         = EditorGUILayout.FloatField("Damping:", _target.Damping);
            _target.detail          = EditorGUILayout.IntField("Shape detail:", _target.detail);
            _target.type            = (JellyObject.JellyType)EditorGUILayout.EnumPopup("shape type", _target.type);
            _target.GravityModifier = EditorGUILayout.Slider("Gravity modifier (-2,2):", _target.GravityModifier, -2f, 2f);
            _target.BaseMaterial    = EditorGUILayout.ObjectField(_target.BaseMaterial, typeof(Material), false) as Material;
            if (GUILayout.Button("Build Shape"))
            {
                LoadOutlinePoints();
            }
        }