protected void OnBlockPrefabChanged(ChangeValueEventArgs <Block> e) { DbLog.Log(string.Format("Block prefab changed from [{0}] to [{1}]", e.OldValue, e.NewValue), Color.magenta, this); spawnRotation = new Vector3(); spawnBaseAttachmentIndex = 0; SpawnPreviewBlock(); }
private void SetLimit(ChangeValueEventArgs <HingeJoint> obj) { hingeJointComponent.useLimits = true; hingeJointComponent.limits = new JointLimits { min = currentAngle, max = currentAngle + LIMIT_RANGE }; }
protected void UpdateAttachmentBlockCluster(ChangeValueEventArgs <BlockCluster> e) { if (e.NewValue == null) { Destroy(ConfigurableJoint); return; } AddJointComponent(connectedAttachment); }
protected void OnEnableBlockPreviewValueChanged(ChangeValueEventArgs <bool> e) { if (e.NewValue) { if (previewBlock == null) { SpawnPreviewBlock(); } } else { if (previewBlock != null) { Destroy(previewBlock.gameObject); } } DbLog.Log(string.Format("Block preview {0}", e.NewValue ? "enabled" : "disabled"), Color.magenta, this); }
private void UpdateTextFields <T>(ChangeValueEventArgs <T> e) { UpdateTextFields(); }
protected void UpdateHingeJointComponent(ChangeValueEventArgs <HingeJoint> e) { hingeJointComponent = e.NewValue; }
private void UpdateBlockMass(ChangeValueEventArgs <float> e) { var valueDelta = e.NewValue - e.OldValue; rigidbodyComponent.mass += valueDelta; }
protected void SwitchButtonInteraction(ChangeValueEventArgs <InstrumentType> e) { button.interactable = e.NewValue != instrumentType; }
protected virtual void OnValueChanged(ChangeValueEventArgs e) { ValueChanged?.Invoke(this, e); }
protected void UpdateTextFields <T>(ChangeValueEventArgs <T> e) { UpdateTextFields(); }
protected void OnBlockPrefabChanged(ChangeValueEventArgs <Block> e) { button.interactable = !(e.NewValue == blockPrefab); }