Ejemplo n.º 1
0
    public string MoveYConsoleCmd(string[] arg)
    {
        string log = "";

        if (arg.Length == 2)
        {
            int y     = 0;
            int speed = 0;

            y     = System.Convert.ToInt32(arg[0]);
            speed = System.Convert.ToInt32(arg[1]);

            luaAction action = new luaAction();
            action.moveOnY  = y;
            action.speed    = speed;
            action.movement = true;
            actions.Enqueue(action);
            log += "El objeto " + gameObject.name + " se moverá " + y + " en X, a " + speed + " de velocidad...";
        }
        else
        {
            log += "Error de parámetros. Parámetros válidos: 'cantidad' 'velocidad'...";
        }


        return(log);
    }
Ejemplo n.º 2
0
    public string ChangeColorConsoleCmd(string[] arg)
    {
        string log   = "";
        int    index = -1;

        if (arg != null)
        {
            index = System.Convert.ToInt32(arg[0]);
        }

        if (index > 0 && index < 3)
        {
            luaAction action = new luaAction();
            action.movement = false;
            action.color    = index;
            actions.Enqueue(action);

            log += "Color cambiado...";
        }
        else
        {
            log += "Error índice de color. Índice válido: 1 (para rojo), 2 (para blanco)...";
        }

        return(log);
    }
Ejemplo n.º 3
0
    public void ChangeColor(int index)
    {
        luaAction action = new luaAction();

        action.movement = false;
        action.color    = index;

        actions.Enqueue(action);
    }
Ejemplo n.º 4
0
    public void MoveZ(float z, float speed)
    {
        luaAction action = new luaAction();

        action.moveOnZ  = z;
        action.speed    = speed;
        action.movement = true;

        actions.Enqueue(action);
    }
Ejemplo n.º 5
0
    public void MoveX(float x, float speed)
    {
        luaAction action = new luaAction();

        action.moveOnX  = x;
        action.speed    = speed;
        action.movement = true;

        actions.Enqueue(action);
    }
Ejemplo n.º 6
0
    public void MoveY(float y, float speed)
    {
        luaAction action = new luaAction();

        action.moveOnY  = y;
        action.speed    = speed;
        action.movement = true;


        actions.Enqueue(action);
    }