protected override void RegisterToSnapColliderGroup()
 {
     MyCodeBlock.GetSnapColliderGroup().RegisterSnapCollider(
         new KeyValuePair <Type, int>(
             typeof(VariableSnapCollider),
             0),
         this);
 }
Пример #2
0
 protected override void RegisterToSnapColliderGroup()
 {
     MyCodeBlock.GetSnapColliderGroup().RegisterSnapCollider(
         new KeyValuePair <Type, int>(
             typeof(ArrayElementSnapCollider),
             index),
         this);
 }
Пример #3
0
 /// <summary>
 /// Snaps to best non-null candidate.
 /// If candidate is null, removes from parent
 /// CurSnapCollidersInContact cannot be empty in this case
 /// or else bestCandidate would just be whatever is in that set
 /// </summary>
 private void EvaluateBestCandidateCollider()
 {
     if (bestCandidateSnapCollider != null)
     {
         bestCandidateSnapCollider.DoSnapAction(MyCodeBlock);
     }
     else
     {
         Assert.IsTrue(curSnapCollidersInContact.Empty());
         MyCodeBlock.RemoveFromParentSnapCollider(true);
     }
 }
Пример #4
0
 public override InstructionReturnValue RunInstruction()
 {
     if (!nextInstructionAddedToStack)
     {
         Interpreter.instance.AddToInstructionStack(GetNextInstruction());
         nextInstructionAddedToStack = true;
     }
     EvaluateArgumentsOfInstruction();
     if (conditionIsTrue)
     {
         Interpreter.instance.AddToInstructionStack(this);
         SetCurIter(curIter + 1);
         MyCodeBlock.UpdateText();
         return(new InstructionReturnValue(null, GetNestedInstruction()));
     }
     return(null); // done with loop
 }
Пример #5
0
 private void RemoveCurrentBlockArg()
 {
     if (HasCodeBlockArgAttached())
     {
         CodeBlock tmpargBlock = MyCodeBlockArg;
         if (MyCodeBlockArg.GetCodeBlockSnap() != CodeBlockSnap.CurrentlyDraggingCodeBlockSnap)
         {
             MyCodeBlockArg.transform.localPosition = MyCodeBlockArg.transform.localPosition + new Vector3(0.25f, 1.1f, 1.25f);
         }
         tmpargBlock.transform.SnapToCodeBlockManager();
         tmpargBlock.GetCodeBlockObjectMesh().ResizeChain();
         // need to resize myself as well
         MyCodeBlock.GetCodeBlockObjectMesh().ResizeChain();
         // somehow has hori issue on unsnap, not resizing its parents?
         AudioManager.instance.PlaySoundAtObject(MyCodeBlock.transform, AudioManager.popAudioClip);
         // TODO: probably needs a log
     }
 }
 protected override void RegisterToSnapColliderGroup()
 {
     MyCodeBlock.GetSnapColliderGroup().RegisterSnapCollider(
         CommonSCKeys.RightConditional,
         this);
 }
Пример #7
0
 protected override void RegisterToSnapColliderGroup()
 {
     MyCodeBlock.GetSnapColliderGroup().RegisterSnapCollider(CommonSCKeys.LeftNumber, this);
 }
Пример #8
0
 private void SetCurIter(int num)
 {
     curIter = num;
     MyCodeBlock.UpdateText();
 }
Пример #9
0
 private void AddNewCodeBlockArg(CodeBlock collidedCodeBlock)
 {
     SnapToParentCenter(collidedCodeBlock, transform.parent);
     AudioManager.instance.PlaySoundAtObject(MyCodeBlock.transform, AudioManager.snapAudioClip);
     MyCodeBlock.GetCodeBlockObjectMesh().ResizeChain();
 }