Exemplo n.º 1
0
 //to upload
 public fileinfo(string fileName, string destination, directionEnum direction, bool mkdirFlag)
 {
     this.completeFileName = fileName;
     this.destination      = destination;
     this.direction        = direction;
     this.mkdirFlag        = mkdirFlag;
 }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        sr = GetComponent <SpriteRenderer> ();
        rb = GetComponent <Rigidbody2D> ();
        //direction = 3;
        direction = directionEnum.DOWN;

        this_anim = GetComponent <Animator> ();        //Animator of this object set to "this_anim"
    }
Exemplo n.º 3
0
        public string Move(int playerid = 0, directionEnum direction = 0)
        {
            var jArgs = new JObject();

            if (playerid != null)
            {
                var jpropplayerid = JToken.FromObject(playerid, _client.Serializer);
                jArgs.Add(new JProperty("playerid", jpropplayerid));
            }
            if (direction != null)
            {
                var jpropdirection = JToken.FromObject(direction, _client.Serializer);
                jArgs.Add(new JProperty("direction", jpropdirection));
            }
            var jRet = _client.GetData <string>("Player.Move", jArgs);

            return(jRet);
        }
Exemplo n.º 4
0
 public fileinfo(string fileName, string destination, directionEnum direction)
     : this(fileName, destination, direction, false)
 {
 }
Exemplo n.º 5
0
    void animate()
    {
        //Decide which animation to play
        //Priorities: Left > Right > Up > Down

        //Animator variables
        //	Running (run):
        //		down = 1
        //		up = 2
        //		left = 3
        //		right = 4
        //	IDLE (IDLE)
        //		down = 1
        //		Up = 2
        //		left = 3
        //		right = 4



        //When pressing a key to run
        if (Input.GetKey(KeyCode.A))                    //play running_left
        {
            this_anim.SetInteger("IDLE", 0);
            this_anim.SetInteger("Run", 3);
            iLastRunAnimValue = 3;
            direction         = directionEnum.LEFT;
        }
        else if (Input.GetKey(KeyCode.D))                //play running_right
        {
            this_anim.SetInteger("IDLE", 0);
            this_anim.SetInteger("Run", 4);
            iLastRunAnimValue = 4;
            direction         = directionEnum.RIGHT;
        }
        else if (Input.GetKey(KeyCode.W))                //play running_up
        {
            this_anim.SetInteger("IDLE", 0);
            this_anim.SetInteger("Run", 2);
            iLastRunAnimValue = 2;
            direction         = directionEnum.UP;
        }
        else if (Input.GetKey(KeyCode.S))                //play running_down
        {
            this_anim.SetInteger("IDLE", 0);
            this_anim.SetInteger("Run", 1);
            iLastRunAnimValue = 1;
            direction         = directionEnum.DOWN;
        }
        else
        {
            //When releasing a key to stop
            if (iLastRunAnimValue == 3)                     //play IDLE_left
            {
                this_anim.SetInteger("Run", 0);
                this_anim.SetInteger("IDLE", 3);
                direction = directionEnum.LEFT;
            }
            else if (iLastRunAnimValue == 4)                //play IDLE_right
            {
                this_anim.SetInteger("Run", 0);
                this_anim.SetInteger("IDLE", 4);
                direction = directionEnum.RIGHT;
            }
            else if (iLastRunAnimValue == 2)                //play IDLE_up
            {
                this_anim.SetInteger("Run", 0);
                this_anim.SetInteger("IDLE", 2);
                direction = directionEnum.UP;
            }
            else                //play IDLE_down
            {
                this_anim.SetInteger("Run", 0);
                this_anim.SetInteger("IDLE", 1);
                direction = directionEnum.DOWN;
            }
        }
    }