private 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);
	}
Example #4
0
    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);
        }
    }