void transition_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            e.Handled = true;

            if (action == actions.select || action == actions.moveTrans)
            {
                Transition currentTrans = diagram.getTransition(sender);

                if (currentTrans == null)
                {
                    return;
                }

                if (diagram.mutexSelect(currentTrans))
                {
                    action             = actions.moveTrans;
                    diagram.isDragging = true;
                    updateUiOnTransitionSelectionChanged(true);
                }
                else
                {
                    diagram.isDragging = false;
                }
            }
        }
    //Function to add Actions to Array


    public void AddEvent(actions action)
    {
        checkpoint = AtomicTags.FindByTag(checkpointTag.Value).GetComponent <SavePoint>();
        if (myActions == null)
        {
            myActions = new actions[checkpoint.hasBeenActivated.Length + 1];
        }

        /*for (int i=checkpoint.numActive+1;i<checkpoint.hasBeenActivated.Length;i++)
         * {
         *      if (!checkpoint.hasBeenActivated[i])
         *      {
         *              events[i] -= action;
         *              events[i] += action;
         *              Debug.Log("Added " + action.GetMethodInfo() +" to checksave " +i);
         *      }
         * }*/


        if (checkpoint.numActive >= myActions.Length)
        {
            Debug.Log("returning empty");
            return;
        }

        Debug.Log(action.GetMethodInfo());
        myActions[checkpoint.numActive + 1] -= action;
        myActions[checkpoint.numActive + 1] += action;
    }
示例#3
0
 public void Talking()
 {
     _startFrame     = _talkStartFrame;
     _endFrame       = _talkEndFrame;
     _animationTimer = 0;
     state           = actions.Talking;
 }
示例#4
0
 public void Idle()
 {
     _startFrame     = _idleStartFrame;
     _endFrame       = _idleEndFrame;
     _animationTimer = 0;
     state           = actions.Idle;
 }
示例#5
0
 // Start is called before the first frame update
 void Awake()
 {
     hpNow    = hpMax;
     ia       = GetComponent <ia>();
     movement = GetComponent <movement>();
     actions  = GetComponent <actions>();
 }
示例#6
0
    void DoAction(actions action)
    {
        if (mobileInputs == null)
        {
            Debug.Log(action);
        }
        else
        {
            switch (action)
            {
            case actions.JUMP:
                mobileInputs.Jump(-_y); break;

            case actions.SHOOT:
                mobileInputs.Shoot(); break;

            case actions.DOUBLESHOOT:
                mobileInputs.ShootTriple(); break;

            case actions.DASH:
                mobileInputs.Dash(); break;

            case actions.RIGHT:
                mobileInputs.HorizontalDash(1); break;

            case actions.LEFT:
                mobileInputs.HorizontalDash(-1); break;
            }
        }

        //field.text += " action:" + action;
    }
示例#7
0
    private void LateUpdate()
    {
        if (canMove)
        {
            actions act = atb.GetActions();

            //Pegando posição do mouse no mundo
            Vector2 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
            //Comparando com a do jogador
            Vector2 delta = mousePos;
            delta.x -= transform.position.x;
            delta.y -= transform.position.y;
            //Ajustando mira
            float distTarget = delta.magnitude;
            //Caso o mouse estaja mais distance que alcance da arma
            if (distTarget > act.ReachNow())
            {
                distTarget = act.ReachNow();
            }
            Vector2 posTarget = Vector2.up * distTarget;
            //transformTarget.localPosition = posTarget;

            //Fazer camera seguir
            Vector3 posCam = Camera.main.transform.position;
            posCam.x = transform.position.x;
            posCam.y = transform.position.y;
            Camera.main.transform.position = posCam;
        }
    }
示例#8
0
 public void GoodJob()
 {
     _startFrame     = _thumbStartFrame;
     _endFrame       = _thumbEndFrame;
     _animationTimer = 0;
     state           = actions.ThumbsUp;
 }
 public void SetSpeed(float speed)
 {
     if (speed > 4.5f)
     {
         if (action != actions.run)
         {
             anim.CrossFade("run", 0.2f);
         }
         action = actions.run;
     }
     else if (speed > 0.1f)
     {
         if (action != actions.walk)
         {
             anim.CrossFade("walk", 0.2f);
         }
         action = actions.walk;
     }
     else if (speed < 0.1f && action != actions.idle)
     {
         if (action != actions.idle)
         {
             anim.CrossFade("idle", 0.2f);
         }
         action = actions.idle;
     }
 }
示例#10
0
        //Считает результат в зависимости от нажатой специальной кнопки (sin, sqrt, fact)
        public void specialActions(actions action)
        {
            if (textBox1.Text != "")
            {
                if (formatCheck(textBox1.Text))
                {
                    if (checkNum(double.Parse(textBox1.Text)))
                    {
                        num1 = double.Parse(textBox1.Text);
                        switch (action)
                        {
                        case actions.sin:
                            textBox1.Text = String.Format("{0:0.###}", Math.Sin(num1));
                            label1.Text   = "Результат:";
                            break;

                        case actions.sqr:
                            textBox1.Text = String.Format("{0:0.###}", Math.Sqrt(num1));
                            label1.Text   = "Результат:";
                            break;

                        case actions.fact:
                            textBox1.Text = String.Format("{0:0.###}", getFactorial(num1));
                            label1.Text   = "Результат:";
                            break;
                        }
                        needEqual = false;
                    }
                }
            }
            else
            {
                MessageBox.Show("Введите первое число!", "Сообщение");
            }
        }
示例#11
0
 public void Down()
 {
     _startFrame     = _downStartFrame;
     _endFrame       = _downEndFrame;
     _animationTimer = 0;
     state           = actions.Down;
 }
示例#12
0
    void search_action()
    {
        if (player_position())
        {
            GetComponentInChildren <SpriteRenderer>().flipX = false;
        }
        else
        {
            GetComponentInChildren <SpriteRenderer>().flipX = true;
        }

        if (time_rush_elapsed >= time_rush)
        {
            atual             = actions.Rush;
            time_rush_elapsed = 0;
            anim_control.SetTrigger("Rush");
        }
        else if (on_range_punch)
        {
            atual = actions.Punch;
            time_punch_elapsed = 0;
            anim_control.SetTrigger("Atk");
        }
        else
        {
            atual             = actions.Walk;
            time_walk_elapsed = 0;
            anim_control.SetTrigger("Walk");
        }
    }
示例#13
0
    public void setKey(string name, string newKey)
    {
        actions actionName = getAction(name);

        saveKey(actionName, newKey);
        keys[actionName] = setKey(actionName, newKey);
    }
示例#14
0
        partial void actionButton(Foundation.NSObject sender)
        {
            /* This will take the title of the button that was pressed and convert it to a NSString -> String */
            string actionPressed = (NSString)sender.ValueForKey((NSString)"title");

            switch (actionPressed)
            {
            case "*":
                currentAction = actions.multiply;
                break;

            case "/":
                currentAction = actions.divide;
                break;

            case "-":
                currentAction = actions.subtract;
                break;

            case "+":
                currentAction = actions.add;
                break;
            }

            if (!isOnAction)
            {
                isOnAction = true;
            }

            screenText = "";

            /* addToTextField(actionPressed.ToString()); */
        }
 // return true to exit program
 private static bool Process(actions AAction, List<string> AParameters)
 {
     switch (AAction)
     {
         case actions.help:
             Console.WriteLine("CommandParser.exe [/?] [/help] [-help] [-k key value] [-ping] [-print <print a value>]");
             return true;
         case actions.kv:
             for (int i = 0; i < AParameters.Count; i += 2)
             {
                 Console.WriteLine("{0} - {1}", AParameters[i],
                     i + 1 < AParameters.Count ? AParameters[i + 1] : "null");
             }
             return false;
         case actions.ping:
             Console.WriteLine("Pinging...");
             Console.Beep();
             return false;
         case actions.print:
             Console.WriteLine(String.Join(" ", AParameters));
             return false;
         case actions.error:
             Console.WriteLine("Command <{0}> is not supported, use CommandParser.exe /? to see set of allowed commands",
                 String.Join(" ", AParameters));
             return true;
         default:
             return true;
     }
 }
示例#16
0
        static private bool Process(actions AAction, List <string> AParameters) // return true to exit program
        {
            switch (AAction)
            {
            case actions.help:
                Console.WriteLine("CommandParser.exe [/?] [/help] [-help] [-k key value] [-ping] [-print <print a value>]");
                return(true);

            case actions.kv:
                for (int i = 0; i < AParameters.Count; i += 2)
                {
                    Console.WriteLine("{0} - {1}", AParameters[i],
                                      i + 1 < AParameters.Count ? AParameters[i + 1] : "null");
                }
                return(false);

            case actions.ping:
                Console.WriteLine("Pinging...");
                Console.Beep();
                return(false);

            case actions.print:
                Console.WriteLine(String.Join(" ", AParameters));
                return(false);

            case actions.error:
                Console.WriteLine("Command <{0}> is not supported, use CommandParser.exe /? to see set of allowed commands",
                                  String.Join(" ", AParameters));
                return(true);

            default:
                return(true);
            }
        }
示例#17
0
    public void AddAmmunition(float percent)
    {
        actions act   = atb.GetActions();
        int     limit = act.GetWeaponInfs().GetLimitBulets();
        int     value = (int)(limit * percent);

        AddAmmunition(value);
    }
示例#18
0
 void Start()
 {
     curAction       = actions.idle;
     rb              = GetComponent <Rigidbody2D>();
     yPosPlane       = new Plane(Vector3.forward, Vector3.forward * Constants.SIDEWALK_Y_POS);
     outline         = GetComponent <Outline>();
     selectedObjects = new MouseControl[2];
 }
示例#19
0
 private Options()
 {
     hideControls = new Dictionary<DateTime, Control>();
     currentFigure = new List<Cell>();
     currentAction = actions.OPEN_CELL;
     commandNames = new Dictionary<string, Color>();
     success = false;
     lastRound = false;
 }
示例#20
0
文件: Task.cs 项目: AidanofVT/Goliad
 public Task(Unit_local doneBy, actions doWhat, Vector2 where, Unit doneTo = null, int howMuch = 0, float extraData = 0)
 {
     subjectUnit = doneBy;
     nature      = doWhat;
     center      = where;
     objectUnit  = doneTo;
     quantity    = howMuch;
     dataA       = extraData;
 }
示例#21
0
 public void Run()
 {
     if (state == states.DEAD || state == states.CRASH)
     {
         return;
     }
     action = actions.RUNNING;
     anim.Play("avatar_run");
 }
示例#22
0
 void stun()
 {
     print("stuned");
     if (time_stun_elapsed >= time_stun)
     {
         atual = actions.NoAction;
         anim_control.SetTrigger("Stop_stun");
     }
 }
示例#23
0
 // Use this for initialization
 void Start()
 {
     atual         = actions.Punch;
     player        = GameObject.FindGameObjectWithTag("Player");
     canAC         = false;
     rain          = false;
     totaltimerain = 10f;
     timecoxa      = 1f;
 }
示例#24
0
 void Awake()
 {
     isClickable    = true;
     hasTent        = false;
     tent           = null;
     turnActionType = actions.none;
     gameManager    = GameObject.FindGameObjectWithTag("Game Manager").GetComponent <GameManager>();
     citizenData    = CitizenData.CreateCitizen();
 }
示例#25
0
 void OnMouseUp()
 {
     switch (curAction)
     {
     case actions.dragging:
         curAction = actions.idle;
         startRigidBody();
         break;
     }
 }
示例#26
0
 /// <summary>
 /// Find UI element by the action it represents
 /// </summary>
 /// <param name="a">action enum value</param>
 /// <returns>either a UIelement object or a null if not found</returns>
 public UIElementBase find_element(actions a)
 {
     foreach (UIElementBase u in stored_elements)
     {
         if (u.get_action() == a)
         {
             return(u);
         }
     }
     return(null);
 }
示例#27
0
 void setAction()
 {
     if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
     {
         curAction = actions.multiSelect;
     }
     else
     {
         curAction = actions.dragging;
     }
 }
示例#28
0
    public void Play(string fileName, int time)
    {
        Sound        sound   = new Sound(fileName, false, true);
        SoundChannel channel = new SoundChannel(_channelID);

        channel     = sound.Play();
        _targetTime = time + Time.time;
        state       = actions.Talking;
        channels.Add(channel);
        _channelID++;
    }
示例#29
0
 private void setNewBind(actions actionToModify)
 {
     //parse through the system's KeyCodes and check if we had that key get pressed, if so set the new keycode to our keybinds array
     foreach (KeyCode indexKey in System.Enum.GetValues(typeof(KeyCode)))
     {
         if (Input.GetKeyDown(indexKey))
         {
             keybinds[(int)actionToModify] = indexKey;
         }
     }
 }
 public void Push(actions value)
 {
     if (IsFull())
     {
         throw new StackOverflowException("Full stack");
     }
     else
     {
         list.SetValue(value, front + 1);
         front++;
     }
 }
 private void btnAddTrans_Click(object sender, RoutedEventArgs e)
 {
     mutexClick((RibbonGroup)btnAddTrans.Parent, (RibbonToggleButton)sender);
     if (btnAddTrans.IsChecked == true)
     {
         action = actions.addTransitionStartingPt;
     }
     else
     {
         action = actions.none;
     }
 }
示例#32
0
 public void pushButton()
 {
     if (currentAction == actions.nextTrack)
     {
         jukebox.nextTrack();
     }
     else if (currentAction == actions.shutter)
     {
         sockets.handleShuttering();
     }
     currentAction = actions.empty;
 }
示例#33
0
 public void OnGround()
 {
     action = actions.RUNNING;
 }
示例#34
0
 /// <summary>
 /// Changes the action of the enemy
 /// </summary>
 /// <param name="newAction">Action to change to</param>
 public void changeAction(actions newAction)
 {
     // Change action
     action = newAction;
     callChangeOfActions();
 }
示例#35
0
		assertCorrectPlacement(actions);
示例#36
0
 void queryAction(object sender, actions action) {
   try {
   var cmd = sender as OleMenuCommand; if (cmd == null) return;
   adjustFileContext(ref actCtx);
   cmd.Visible = actCtx != null && actCtx.hasAction(action);
   } catch (Exception exp) {
     vsNetServer.log.ErrorLineFmt(action.ToString(), "SolutionToolbarPackage.queryAction, {0}", LowUtils.ExceptionToString(exp));
   }
 }
示例#37
0
 public bool hasAction(actions act) { return (availableActions & act) != 0; }
示例#38
0
    //**********  RUN x BROWSE

    void doAction(actions action) {
      try {
        vsNetServer.log.clear();
        adjustFileContext(ref actCtx); if (actCtx == null) return;
        switch (action) {
          case actions.xref:
            break;
          case actions.browse:
            progressStart();
            try {
              var html = vsNetServer.getHtmFromTemplate(actCtx);
              var fn = Path.GetTempPath() + "page.htm";
              File.WriteAllText(fn, html, Encoding.UTF8);
              if (!vsNetServer.log.hasError) navigate(fn, null);
            } finally { progressEnd(); }
            break;
          case actions.saveHtml:
            vsNetServer.saveHtmlData(actCtx);
            break;
          case actions.addEx:
            new AddExForm(action, actCtx, addExs).ShowDialog();
            break;
          case actions.build:
            DeployForm.show(actCtx);
            //using (var str = File.OpenWrite(@"d:\temp\prod.zip")) vsNetServer.build(str, actCtx);
            break;
          default:
            new AddForm(action, actCtx, addFolder).ShowDialog();
            break;
        }
      } catch (Exception exp) {
        vsNetServer.log.ErrorLineFmt(action.ToString(), "SolutionToolbarPackage.doAction, {0}", LowUtils.ExceptionToString(exp) );
      }
      if (vsNetServer.log.hasError) {
        var fn = Path.GetTempPath() + "error.htm";
        File.WriteAllText(fn, vsNetServer.log.LogHtml(), Encoding.UTF8);
        navigate(fn, null);
      }
    }
示例#39
0
文件: AddExForm.cs 项目: PavelPZ/REW
 public AddExForm(actions action, fileContext file, Action<string[], string> onFinish)
   : this() {
   this.file = file; this.action = action; this.onFinish = onFinish;
   HomeBtn_Click(null, null);
   //new browserEx.browser(webBrowser, () => HomeBtn_Click(null, null));
 }
示例#40
0
 void Jump()
 {
     jumpAcceleration = speedJump;
     action = actions.JUMPING_UP;
 }
 public virtual remoteReturn FGmodifyFile(actions option, Users myUser, string sourceLocation, string targetLocation)
 {
     throw new System.NotImplementedException();
 }
 public virtual remoteReturn FGmodifyUser(actions option, Users myUser, string targetUser)
 {
     throw new System.NotImplementedException();
 }
示例#43
0
 void JumpDown()
 {
     jumpAcceleration = inertia;
     action = actions.JUMPING_DOWN;
 }
示例#44
0
 public void clearAction()
 {
     this.currentAction = actions.OPEN_CELL;
 }