Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class AppCtrl : MonoBehaviour {
- public GameObject girlCharacter;
- private GameObject Lleg,Rleg,Llydka,Rlydka;
- private int klatka;
- private float mouse_dostance_x;
- void Start () {
- Debug.Log("start");
- klatka = 1;
- GameObject mArm;
- mArm = GameObject.Find("unitychan/Character1_Reference/Character1_Hips/Character1_Spine/Character1_Spine1/Character1_Spine2/Character1_LeftShoulder/Character1_LeftArm");// ("Character1_LeftArm");
- mArm.transform.Rotate(0,75,0);
- mArm = GameObject.Find("unitychan/Character1_Reference/Character1_Hips/Character1_Spine/Character1_Spine1/Character1_Spine2/Character1_RightShoulder/Character1_RightArm");// ("Character1_LeftArm");
- mArm.transform.Rotate(0, -75, 0);
- string nazwa = "unitychan/Character1_Reference/Character1_Hips/Character1_RightUpLeg";
- nazwa = "unitychan/Character1_Reference/Character1_Hips/Character1_LeftUpLeg";
- Lleg = GameObject.Find(nazwa);
- string nazwa1 = "unitychan/Character1_Reference/Character1_Hips/Character1_RightUpLeg";
- Rleg = GameObject.Find(nazwa1);
- string nazwa2 = "unitychan/Character1_Reference/Character1_Hips/Character1_LeftUpLeg/Character1_LeftLeg";
- Llydka = GameObject.Find(nazwa2);
- string nazwa3 = "unitychan/Character1_Reference/Character1_Hips/Character1_RightUpLeg/Character1_RightLeg";
- Rlydka = GameObject.Find(nazwa3);
- }
- Vector2 pos;
- void Rotatecam()
- {
- float Sensitivity = 0.2f;
- if (Input.GetMouseButtonDown(0))
- {
- pos = Input.mousePosition;
- }
- if (Input.GetMouseButton(0))
- {
- transform.localEulerAngles += new Vector3((Input.mousePosition.y - pos.y) * Sensitivity, (-Input.mousePosition.x + pos.x) * Sensitivity, 0);
- pos = Input.mousePosition;
- }
- if (Input.GetMouseButtonDown(1))
- {
- pos = Input.mousePosition;
- }
- if (Input.GetMouseButton(1))
- {
- Sensitivity = 0.02f;
- transform.Translate((Input.mousePosition.x - pos.x) * Sensitivity,0.0f, (Input.mousePosition.y - pos.y) * Sensitivity);
- pos = Input.mousePosition;
- }
- }
- // Update is called once per frame
- void Update () {
- klatka++;
- Rotatecam();
- if (klatka < 90)
- {
- Lleg.transform.Rotate(0, 0, -0.5f);
- Llydka.transform.Rotate(0, 0, 0.5f);
- if (klatka>30)
- girlCharacter.transform.Translate(0.0f, 0.01f, 0.0f);
- Rleg.transform.Rotate(0, 0, 0.25f);
- }
- if (klatka>=90 && klatka < 180 )
- {
- Rleg.transform.Rotate(0, 0, -0.75f);
- Rlydka.transform.Rotate(0, 0, 0.5f);
- if (klatka > 120)
- girlCharacter.transform.Translate(0.0f, 0.01f, 0.0f);
- Lleg.transform.Rotate(0, 0, 0.75f);
- Llydka.transform.Rotate(0, 0, -0.5f);
- }
- if (klatka >= 180 && klatka < 270)
- {
- Lleg.transform.Rotate(0, 0, -1);
- Llydka.transform.Rotate(0, 0, 0.5f);
- if (klatka > 210)
- girlCharacter.transform.Translate(0.0f, 0.01f, 0.0f);
- Rleg.transform.Rotate(0, 0, 0.75f);
- Rlydka.transform.Rotate(0, 0, -0.5f);
- }
- if (klatka >= 270 && klatka < 360)
- {
- Rleg.transform.Rotate(0, 0, -0.75f);
- Rlydka.transform.Rotate(0, 0, 0.5f);
- if (klatka > 300)
- girlCharacter.transform.Translate(0.0f, 0.01f, 0.0f);
- Lleg.transform.Rotate(0, 0, 1);
- Llydka.transform.Rotate(0, 0, -0.5f);
- Rleg.transform.Rotate(0, 0, 0.5f);
- Rlydka.transform.Rotate(0, 0, -0.5f);
- Lleg.transform.Rotate(0, 0, -0.25f);
- //Llydka.transform.Rotate(0, 0, 0.5f);
- }
- }
- }
Add Comment
Please, Sign In to add comment