Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class chracaterResizing : MonoBehaviour {
- public bool isBig = false;
- public bool isNormal = true;
- public bool isSmall = false;
- public bool isEnabled = false;
- public Transform character;
- public float bigSize = 10.259745f;
- public float normalSize = 4.259745f;
- public float smallSize = 2.259745f;
- void Update () {
- if (Input.GetKeyDown (KeyCode.RightBracket) && isEnabled == true && isNormal == true) {
- isNormal = false;
- isBig = true;
- }
- if (Input.GetKeyDown (KeyCode.RightBracket) && isEnabled == true && isSmall == true) {
- isSmall = false;
- isNormal = true;
- }
- if (Input.GetKeyDown (KeyCode.LeftBracket) && isEnabled == true && isBig == true) {
- isNormal = true;
- isBig = false;
- }
- if (Input.GetKeyDown (KeyCode.LeftBracket) && isEnabled == true && isNormal == true) {
- isNormal = false;
- isSmall = true;
- }
- if (character.GetComponent<characterController>().enabled == true) {
- isEnabled = true;
- }
- if (character.GetComponent<characterController>().enabled == false) {
- isEnabled = false;
- }
- if (isBig == true) {
- character.GetComponent<Transform>().localScale = new Vector3(bigSize, bigSize);
- }
- if (isNormal == true) {
- character.GetComponent<Transform>().localScale = new Vector3(normalSize, normalSize);
- }
- if (isSmall == true) {
- character.GetComponent<Transform>().localScale = new Vector3(smallSize, smallSize);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement