Ejemplo n.º 1
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);
        }