コード例 #1
0
        private void DisconnectWaypoints()
        {
            DestroyImmediate(currentConn.gameObject);

            if (parentNetwork.connections.Contains(currentConn))
            {
                parentNetwork.connections.Remove(currentConn);
            }

            currentConn = null;
        }
コード例 #2
0
        public void OnEnable()
        {
            multipleSelection = !(targets == null || targets.Length == 1);

            wp            = (Waypoint)target;
            parentNetwork = wp.parentNetwork;

            wps = new Waypoint[targets.Length];
            for (var i = 0; i < targets.Length; i++)
            {
                wps[i] = (Waypoint)targets[i];
            }

            if (multipleSelection && targets.Length == 2)
            {
                currentConn = GetConnectionBetweenSelectedWaypoints();
            }
        }
コード例 #3
0
        public void OnEnable()
        {
            multipleSelection = !(targets == null || targets.Length == 1);
            
            wp = (Waypoint)target;
            parentNetwork = wp.parentNetwork;

            wps = new Waypoint[targets.Length];
            for (var i = 0; i < targets.Length; i++)
            {
                wps[i] = (Waypoint)targets[i];
            }

            if (multipleSelection && targets.Length == 2)
            {
                currentConn = GetConnectionBetweenSelectedWaypoints();
            }
        }
コード例 #4
0
        private void ConnectWaypoints()
        {
            var connGo = new GameObject("Connection");

            connGo.transform.parent = GetConnectionsParent();

            var conn = connGo.AddComponent <WaypointsConnection>();

            conn.parentNetwork = parentNetwork;
            conn.wp01          = wps[0];
            conn.wp02          = wps[1];

            if (parentNetwork.connections == null)
            {
                parentNetwork.connections = new List <WaypointsConnection>();
            }

            parentNetwork.connections.Add(conn);
            currentConn = conn;
        }
コード例 #5
0
        private void ConnectWaypoints()
        {
            var connGo = new GameObject("Connection");
            connGo.transform.parent = GetConnectionsParent();

            var conn = connGo.AddComponent<WaypointsConnection>();
            conn.parentNetwork = parentNetwork;
            conn.wp01 = wps[0];
            conn.wp02 = wps[1];

            if (parentNetwork.connections == null)
            {
                parentNetwork.connections = new List<WaypointsConnection>();
            }

            parentNetwork.connections.Add(conn);
            currentConn = conn;
        }
コード例 #6
0
        private void DisconnectWaypoints()
        {
            DestroyImmediate(currentConn.gameObject);

            if (parentNetwork.connections.Contains(currentConn))
            {
                parentNetwork.connections.Remove(currentConn);
            }

            currentConn = null;
        }