void Awake() { signals = new List <ChipSignal> (); selectedSignals = new List <ChipSignal> (); groupsByID = new Dictionary <int, ChipSignal[]> (); inputBounds = GetComponent <BoxCollider2D> (); MeshShapeCreator.CreateQuadMesh(ref quadMesh); handleMat = CreateUnlitMaterial(handleCol); highlightedHandleMat = CreateUnlitMaterial(highlightedHandleCol); selectedHandleMat = CreateUnlitMaterial(selectedHandleCol); previewSignals = new ChipSignal[maxGroupSize]; for (int i = 0; i < maxGroupSize; i++) { var previewSignal = Instantiate(signalPrefab); previewSignal.SetInteractable(false); previewSignal.gameObject.SetActive(false); previewSignal.signalName = "Preview"; previewSignal.transform.SetParent(transform, true); previewSignals[i] = previewSignal; } propertiesUI.gameObject.SetActive(false); deleteButton.onClick.AddListener(DeleteSelected); FindObjectOfType <CreateGroup> ().onGroupSizeSettingPressed += SetGroupSize; modeDropdown.onValueChanged.AddListener(ModeChanged); }
private void Awake() { newChipsToPlace = new List <Chip>(); selectedChips = new List <Chip>(); allChips = new List <Chip>(); MeshShapeCreator.CreateQuadMesh(ref selectionMesh); }
void Start() { if (Application.isPlaying) { MeshShapeCreator.CreateQuadMesh(ref quadMesh); CreateMatrices(); } }
void Awake() { newChipsToPlace = new List <Chip> (); selectedChips = new List <Chip> (); allChips = new List <Chip> (); MeshShapeCreator.CreateQuadMesh(ref selectionMesh); editChipMenu = GameObject.Find("Edit Chip Menu").GetComponent <EditChipMenu>(); editChipMenu.Init(); }
void Awake () { signals = new List<ChipSignal> (); inputBounds = GetComponent<BoxCollider2D> (); MeshShapeCreator.CreateQuadMesh (ref quadMesh); handleMat = CreateUnlitMaterial (handleCol); highlightedHandleMat = CreateUnlitMaterial (highlightedHandleCol); selectedHandleMat = CreateUnlitMaterial (selectedHandleCol); previewSignal = Instantiate (signalPrefab); previewSignal.gameObject.SetActive (false); previewSignal.signalName = "Preview"; previewSignal.transform.SetParent (transform, true); deleteButton.onClick.AddListener (Delete); }
void Update() { if (!Application.isPlaying) { MeshShapeCreator.CreateQuadMesh(ref quadMesh); CreateMatrices(); UpdateSignalAreaSizeAndPos(inputSignalArea); UpdateSignalAreaSizeAndPos(outputSignalArea); } for (int i = 0; i < 4; i++) { Graphics.DrawMesh(quadMesh, trs[i], material, 0); } }