void Awaken() { uiMan.FadeOutTitle (); CameraControl.main.m_MinSize = 12f; sequencer = gameObject.AddComponent<ResourceSequence>(); joiner = GetComponent<InputMan>(); joiner.OnStartPressed += (sender, e) => { uiMan.FadeInSequencePrompt(); sequencer.StartInput(joiner.devices[0]); uiMan.FadeOutStart(); uiMan.FadeInTimer(); }; joiner.OnStartAvailable += (sender, e) => {uiMan.FadeInStart();}; // joiner.OnStartPressed += (sender, e) => {HardCodeStart();}; joiner.OnPlayerJoined += (sender, e) => {uiMan.FadeOutText();}; sequencer.OnInputted += (sender, e) => { resourceDisplay[e.index].SetResourceIcon(ResourceType.NONE); resourceDisplay[e.index].SetFadeActive(true); }; sequencer.OnInputAgain += HandleOnInputAgain; sequencer.OnCheckInputFalse += (sender, e) => { resourceDisplay[0].GetComponentInParent<LocalPositionSpring>().velocity += new Vector3(20f, 0f, 0f); HandleOnInputAgain(sender, e);}; sequencer.OnCheckInputTrue += HandleOnInputAgain; SoundMan.main.StartTitleMusic (); }
// Use this for initialization void Awake() { playerInput = GameManagers.Instance.InputMan; GameManagers.Instance.LocalPlayer = this; Instantiate(zombie[Random.Range(0, zombie.Length)]); playerHealth = PlayerHitPoints; }
// Update is called once per frame void Update() { if (InputMan.GetButtonDown(flingKey) && !flingHeld) { flingHeld = true; flingStartTime = Time.time; } if (flingHeld) { float percentComplete = (Time.time - flingStartTime) / TweenTime; currentImpuleVelocity = Mathf.Lerp(MINvelocity, MAXvelocityPower, percentComplete); if (InputMan.GetButtonUp(flingKey)) { Fling(); flingHeld = false; } } if (InputMan.GetButtonDown(endKey)) { gameOverText.gameObject.SetActive(true); InputMan.DisableControls(); DOVirtual.DelayedCall(3, () => SceneManager.LoadScene(endGameSceneName)); } }
// Use this for initialization void Awake() { rgb = GetComponent <Rigidbody>(); myAudioSource = GetComponent <AudioSource>(); gameOverText.gameObject.SetActive(false); InputMan.EnableControls(); }
// Use this for initialization void Start() { Bounds = transform.GetComponentInChildren <SelectionBounds>(); cursor = transform.GetComponentInChildren <Cursor>(); MainCamera.SetLookAt(MyArmy.transform.Find("Flag").transform.position); inputMan = transform.GetComponent <InputMan>(); InvokeRepeating("NotifySelection", 1.1f, 1.1f); }
void Awake() { if (instance == null) { instance = this; } else if (instance != null) { Destroy(this); } DontDestroyOnLoad(this); }
void Start() //verifying distance, setting start distance. { //Calling InputManager InputManager = GetComponent <InputMan>(); //Distance needs to be between min and max dist-values. Distance = Mathf.Clamp(Distance, DistMin, DistMax); //StartDistance(Validate D in awake and store it.) startDistance = Distance; //Calling Reset() method. Reset(); }
void HandleInput() //Looking for mouse/joystick input and process it. { //Creating variable for DeadZone, so bumping doesn't move camera. // There is a tiny zone on mousewheel - + axis that doesn't register //movement var DeadZone = 0.01f; //Getting the x-axis data from mouse/RightHorizontal // multiply with x_sensitivity += horizontal input. Horizontal += InputMan.RightHorizontal() * xSensitivity; //Get y-axis input data * y_sensitivity -= vertical input. Vertical -= InputMan.RightVertical() * ySensitivity; //X is unlimited (orbiting around Proto) //LIMITING VERTICAL //Y limits: Clamping distance between DistMin and DistMax. //HelperClass(Helper.cs): ClampAngle(angle, DMin, DMax) //Helper converts whatever rotation sended to 0-360 either + or - //Makes sure it is clamped and returns it to camera. Vertical = Helper.ClampAngle(Vertical, YMin, YMax); if (Input.GetAxis("Mouse ScrollWheel") < -DeadZone || Input.GetAxis("Mouse ScrollWheel") > DeadZone) { desiredDist = Mathf.Clamp(Distance - Input.GetAxis("Mouse ScrollWheel") * MWSensitivity, DistMin, DistMax); preOccludedDist = desiredDist; //matching these two together distSmoothing = DistSmooth; } //mouseWheel. Checking camera is outside DeadZone //Applying mouseWheel-sensitivity //Subtract the value from current distance. //Clamped Distance (minmax) stored in desiredDistance }
void CheckAim() { currentRotation += InputMan.GetLHorizontal() * aimSpeed * Time.deltaTime; }
// Use this for initialization void Awake() { rig2D = GetComponent<Rigidbody2D>(); anim = GetComponentInChildren<Animator>(); jumpForce = JumpForce; GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); foreach (GameObject item in players) { if (item.transform != transform) { enemy = item.transform; } } attack = new bool[AttackCount]; attackTimer = new float[AttackCount]; timesPressed = new int[AttackCount]; if (PC) { inputManager = gameObject.AddComponent<PCInputMan>(); //inputManager = new PCInputMan(PlayerNum, AttackCount); inputManager.AttacksCount = AttackCount; ((PCInputMan)inputManager).PlayerNum = PlayerNum; } else { inputManager = inpt; //inputManager = new PCInputMan(PlayerNum, AttackCount); inputManager.AttacksCount = AttackCount; } }
// Use this for initialization void Start() { uiManager = GetComponent<UIMan>(); soundManager = GetComponent<SoundMan>(); speedFactor = 0; Meter = 0; HighScore = PlayerPrefs.GetInt("HighScore"); liveObstacles = new List<GameObject>(); # if UNITY_STANDALONE InputManager = (InputMan)gameObject.AddComponent<PCInputMan>(); #elif UNITY_ANDROID InputManager = (InputMan)gameObject.AddComponent<AndroidInputMan>(); #endif //InputManager.enabled = false; }
public void ChangePrimaryHand(bool isRightHanded) { InputMan.ChangePrimaryHand(isRightHanded); }
private void Awake() { Instance = this; GameObject.DontDestroyOnLoad(this.gameObject); }