Beispiel #1
0
        protected virtual void Start()
        {
            ConnectionAnchor[] connectionAnchors = new ConnectionAnchor[_objectsCount];
            for (int i = 0; i < _objectsCount; i++)
            {
                GameObject newObj = Instantiate(_spawnableObject, _spawnTransform.position + Vector2InPlaneToWorld(Radius * Random.insideUnitCircle, _spawnTransform), _spawnTransform.rotation, transform);

                PlatformMover platformMover = newObj.GetComponent <PlatformMover>();
                if (platformMover != null)
                {
                    platformMover.Init(_plane);
                }
                else
                {
                    Debug.LogError("Spawnable object doesn't have platform mover");
                }

                connectionAnchors[i] = newObj.GetComponentInChildren <ConnectionAnchor>();
                if (connectionAnchors[i] == null)
                {
                    Debug.LogError("Spawnable object doesn't have connection anchor");
                }
            }

            GetComponent <ConnectionCreator>().Init(connectionAnchors);
        }
Beispiel #2
0
 public Port(int x, int y, int width, int height) : base(x, y, width, height)
 {
     ConnectionAnchor = new ConnectionAnchor(this);
 }