Example #1
0
        private EditorBlockerShape AddBlocker(int shapeType)
        {
            var gObj = Instantiate(_blockerShapePrototype);
            var curr = gObj.GetComponent <EditorBlockerShape>();

            CurrentShape = curr;
            curr.InjectController(this);
            ChangeCurrentShape(shapeType);
            if (_editorFile != null)
            {
                _editorFile.BlockerShapes.Add(curr);
            }
            return(curr);
        }
Example #2
0
 public void DeleteSelectedShape()
 {
     if (_currentShape == null || _currentShape == _playerShape)
     {
         return;
     }
     if (_currentShape is EditorShape)
     {
         _editorFile.FreeShapes.Remove(_currentShape as EditorShape);
     }
     else if (_currentShape is EditorTargetShape)
     {
         _editorFile.TargetShapes.Remove(_currentShape as EditorTargetShape);
     }
     else if (_currentShape is EditorBlockerShape)
     {
         _editorFile.BlockerShapes.Remove(_currentShape as EditorBlockerShape);
     }
     Destroy(_currentShape.gameObject);
     _currentShape = null;
 }