Пример #1
0
    public void update_move_his()
    {
		if (isNeedRecord() == false) 
		{
			return;
		}

        CreatureMoveHistory hist_move_hist = new CreatureMoveHistory();
        hist_move_hist._pos = get_position();
        hist_move_hist._dir = get_dir();

        switch (_state)
        {
            case creature_state.run:
                {
                    hist_move_hist._move = true;
                }
                break;
            case creature_state.idle:
                {
                    hist_move_hist._move = false;
                }
                break;
        }
        MolMoveHistory hist = get_last_history();
        hist._Creature_acts.Add(hist_move_hist);
        set_last_history(hist);

    }
Пример #2
0
    public void set_state(creature_state state)
    {
        //global_instance.Instance._crash_manager._History._mol_history.Count

        if (global_instance.Instance._crash_manager.getGameState() != gameState.game_playing)
        {
			return;
		}

        if (state != _state)
        {
            switch(state)
            {
                case creature_state.idle:
                    {
                        play_idle();
                    }
                    break;
                case creature_state.run:
                    {
                        play_run();
                    }
                    break;
                case creature_state.special:
                    {
                        play_special();
                    }
                    break;
                case creature_state.wound:
                    {
                        play_wound();
                    }
                    break;
            }
            _state = state;
        }
		if (isNeedRecord ()) 
		{
			MolMoveHistory his = get_last_history();
			CreatureMoveHistory creature_his = new CreatureMoveHistory();
			creature_his._dir = get_dir();
			if(_state == creature_state.idle)
			{
				creature_his._move = false;
			}
			else
			{
				creature_his._move = true;
			}
			creature_his.fram_index = _frame_count;
			creature_his._pos = get_position();
			his._Creature_acts.Add(creature_his);
			set_last_history(his);
		}

    }