Example #1
0
        void ProcessLocalHostKeyboard(Localhost ent, PlayerInput input)
        {
            float   speed  = 0.1f;
            Vector3 newPos = ent.transform.position;

            if (input.W)
            {
                newPos += ent.Cam.transform.forward * speed;
            }
            if (input.S)
            {
                newPos -= ent.Cam.transform.forward * speed;
            }
            if (input.A)
            {
                newPos -= ent.Cam.transform.right * speed;
            }
            if (input.D)
            {
                newPos += ent.Cam.transform.right * speed;
            }
            ent.transform.position = newPos;

            if (input.Debug_SetTexture1)
            {
                ent.SetTexture("test.png");
            }
            if (input.Debug_SetTexture2)
            {
                ent.SetTexture("test2.png");
            }
        }
Example #2
0
        void ProcessHostMouse(Localhost ent)
        {
            Vector3 rotation = new Vector3(ent.Pitch, ent.Yaw, 0.0f);

            ent.transform.eulerAngles = rotation;
        }