/// <summary> /// Create a cable given route, radius, resolution and material. /// </summary> /// <param name="radius">Radius of the cable.</param> /// <param name="resolutionPerUnitLength">Resolution of the cable.</param> /// <param name="material">Shape material of the cable.</param> /// <returns>Cable component.</returns> public static Cable CreateCable(float radius = 0.05f, float resolutionPerUnitLength = 5.0f, ShapeMaterial material = null) { GameObject go = new GameObject(CreateName <Cable>()); Cable cable = go.AddComponent <Cable>(); cable.Radius = radius; cable.ResolutionPerUnitLength = resolutionPerUnitLength; cable.Material = material; return(cable); }
public bool IsListening(Cable cable) { var invocationList = OnPropertyUpdated.GetInvocationList(); foreach (var listener in invocationList) { if (cable.Equals(listener.Target)) { return(true); } } return(false); }