void Awake() { connections = new List <GameObject>(); connectionPrefab = (GameObject)Resources.Load("Prefabs/ServiceConnection"); connectedServiceComponents = new List <ServiceNodeScript>(); #region clickable InteractableViaClickTouch ict = gameObject.GetComponent <InteractableViaClickTouch>(); if (ict == null) { ict = gameObject.AddComponent <InteractableViaClickTouch>(); } ict.handleActivationDeactivation.Add(handleActivationDeactivation); #endregion rotPivot = new GameObject("Rotation Pivot"); rotPivot.transform.position = transform.position; rotPivot.transform.SetParent(transform); ConnectionPool[] pools = FindObjectsOfType(typeof(ConnectionPool)) as ConnectionPool[]; if (pools.Length == 1) { connectionPool = pools[0]; } else { throw new Exception("No connection pool component found, or too many connection pools!"); } }
void Awake() { serviceNodes = new List <ServiceNodeScript>(); downwardConnections = new List <GameObject>(); connectionPrefab = (GameObject)Resources.Load("Prefabs/ServiceConnection"); DownwardConnectionContainer = GameObject.Find("DataManager").GetComponent <GlobalContainerHolder>().DownwardConnectionContainer; #region clickable InteractableViaClickTouch ict = gameObject.GetComponent <InteractableViaClickTouch>(); if (ict == null) { ict = gameObject.AddComponent <InteractableViaClickTouch>(); } ict.handleActivationDeactivation.Add(handleActivationDeactivation); #endregion }
void Awake() { connectionArrows = new List <GameObject>(); connectedDocks = new List <DependencyDock>(); dockWeights = new List <float>(); dependencyContainer = GameObject.Find("DataManager").GetComponent <GlobalContainerHolder>().DependencyContainer; #region clickable InteractableViaClickTouch ict = gameObject.GetComponent <InteractableViaClickTouch>(); if (ict == null) { ict = gameObject.AddComponent <InteractableViaClickTouch>(); } ict.handleActivationDeactivation.Add(handleActivationDeactivation); #endregion expanded = false; dockType = DockType.ImportDock; importArrowPrefab = (GameObject)Resources.Load("Prefabs/ImportArrow"); exportArrowPrefab = (GameObject)Resources.Load("Prefabs/ExportArrow"); arrowHeadPrefab = (GameObject)Resources.Load("Prefabs/ArrowHead"); rotPivot = new GameObject("Rotation Pivot"); rotPivot.transform.position = transform.position; rotPivot.transform.SetParent(transform); ConnectionPool[] pools = FindObjectsOfType(typeof(ConnectionPool)) as ConnectionPool[]; if (pools.Length == 1) { connectionPool = pools[0]; } else { throw new Exception("No connection pool component found, or too many connection pools! There can only be one."); } }