Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 private void SetLimit(ChangeValueEventArgs <HingeJoint> obj)
 {
     hingeJointComponent.useLimits = true;
     hingeJointComponent.limits    = new JointLimits
     {
         min = currentAngle,
         max = currentAngle + LIMIT_RANGE
     };
 }
Exemplo n.º 3
0
 protected void UpdateAttachmentBlockCluster(ChangeValueEventArgs <BlockCluster> e)
 {
     if (e.NewValue == null)
     {
         Destroy(ConfigurableJoint);
         return;
     }
     AddJointComponent(connectedAttachment);
 }
Exemplo n.º 4
0
 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();
 }
Exemplo n.º 6
0
 protected void UpdateHingeJointComponent(ChangeValueEventArgs <HingeJoint> e)
 {
     hingeJointComponent = e.NewValue;
 }
Exemplo n.º 7
0
        private void UpdateBlockMass(ChangeValueEventArgs <float> e)
        {
            var valueDelta = e.NewValue - e.OldValue;

            rigidbodyComponent.mass += valueDelta;
        }
Exemplo n.º 8
0
 protected void SwitchButtonInteraction(ChangeValueEventArgs <InstrumentType> e)
 {
     button.interactable = e.NewValue != instrumentType;
 }
Exemplo n.º 9
0
 protected virtual void OnValueChanged(ChangeValueEventArgs e)
 {
     ValueChanged?.Invoke(this, e);
 }
Exemplo n.º 10
0
 protected void UpdateTextFields <T>(ChangeValueEventArgs <T> e)
 {
     UpdateTextFields();
 }
Exemplo n.º 11
0
 protected void OnBlockPrefabChanged(ChangeValueEventArgs <Block> e)
 {
     button.interactable = !(e.NewValue == blockPrefab);
 }