public async Task <Connection[]> GetOpenConnections()
        {
            while (!pConnectionSet || Main == null)
            {
                await Task.Delay(25);
            }

            return(MainBugPart.GetOpenConnections(mChildrenIDs, Main.Locations, transform.position, pDistance, transform.lossyScale.x));
        }
Beispiel #2
0
        public virtual bool SetConnection(Connection connection, IConnectable connector, GameObject parent, MainBugPart main)
        {
            Main = main;
            ID   = main.PartID;

            if (connection == Connection.None)
            {
                Destroy(gameObject);
                return(false);
            }

            transform.SetParent(parent.transform);

            transform.position = GetConnectionPos(connection, parent.transform.position, pDistance * parent.transform.lossyScale.x);

            connector.ConnectTo(connection, ID);
            Parent = connector;

            pParentConnection = connection;
            pConnectionSet    = true;

            return(true);
        }
 public override bool SetConnection(Connection connection, IConnectable connector, GameObject parent, MainBugPart main)
 {
     pDistance = 0.7f;
     try
     {
         mChildrenIDs[connection] = parent.GetComponent <BugPart>().ID;
     }
     catch
     {
         mChildrenIDs[connection] = main.ID;
     }
     return(base.SetConnection(connection, connector, parent, main));
 }
 private void DestroyBug(MainBugPart bug) // Subscribed Function
 {
     Bugs.Remove((Bug)bug);
 }