public void ConnectTo(OnClick onClick) { if (!onClick || !onClick.GetComponent <RotateBroadcaster>()) { connectorSource.Dest = null; OnDisconnected.Invoke(); } else { OnConnected.Invoke(); } }
public void OnClickDelegateImplementation(OnClick onClickScript) { UnityEngine.Assertions.Assert.IsNotNull(onClickScript); // deselect everything foreach (var clickTarget in clickTargets) { var rendererClickTarget = clickTarget.GetComponent <Renderer>(); if (rendererClickTarget != null) { rendererClickTarget.material = materialDeselect; } } var rendererOnClickScript = onClickScript.GetComponent <Renderer>(); if (rendererOnClickScript != null) { rendererOnClickScript.material = materialSelect; } }