void Start() { p_i = gameObject.GetComponentInParent <Player_Input>(); pb = gameObject.GetComponent <ProblemBattery_Script>(); pp = gameObject.GetComponent <ProblemPower_Script>(); pe = gameObject.GetComponent <ProblemEngine_Script>(); }
private void Awake() { //Find the PlayerInput component playerInput = GameObject.Find("Main Camera").GetComponent <Player_Input>(); //Subscription here playerInput.OnInventoryPress += InventoryCheck; }
public PlayerAnimations(Animator animator, Transform player) { playerInput = player.GetComponent <Player_Input>(); this.animator = animator; playerInput.OnJumpUp += OnJumpInputUp; playerInput.OnJumpDown += OnJumpInputDown; playerInput.OnAttack += OnAttack; }
private void OnTriggerEnter(Collider other) { if (other.name == "Controller (left)" || other.name == "Controller (right)") { goController = other.gameObject.GetComponent <Player_Input>(); bCanGrab = true; } }
private void OnTriggerExit(Collider other) { if (other.name == "Controller (left)" || other.name == "Controller (right)") { goController = null; bCanGrab = false; } }
private void Start() { playerInput = GetComponent<Player_Input>(); m_Player = GetComponent<CharacterController>(); originalFOV = Camera.main.fieldOfView; SpawnWeapon(); InitWeapon(); }
private void Start() { weaponController = GetComponent <Weapon_Controller>(); cameraController = GetComponent <Camera_Controller>(); playerInput = GetComponent <Player_Input>(); m_Player = GetComponent <CharacterController>(); m_Anim = weaponController.ActiveWeaponAnimator; }
void Start() { pi = gameObject.GetComponent <Player_Input>(); bat = gameObject.GetComponentInChildren <ProblemBattery_Script>(); pow = gameObject.GetComponentInChildren <ProblemPower_Script>(); eng = gameObject.GetComponentInChildren <ProblemEngine_Script>(); }
void Start() { fpsCam = transform.parent.GetComponent <Camera>(); playerInput = transform.root.GetComponent <Player_Input>(); playerController = transform.root.GetComponent <Player_Controller>(); m_Player = transform.root.GetComponent <CharacterController>(); m_Anim = GetComponent <Animator>(); currentAmmoInClip = weaponStats.magazineSize; totalAmmo = weaponStats.ammoCarryingCapacity - weaponStats.magazineSize; }
void Awake() { player = GameObject.FindGameObjectWithTag(Tags.player); playerViewport = GameObject.FindGameObjectWithTag(Tags.playerViewport).GetComponent<Camera>(); playerHealth = player.GetComponent<Player_Health>(); playerInput = player.GetComponent<Player_Input>(); fader = player.GetComponentInChildren<Camera_UI>(); spawnPosition = player.transform.position; spawnRotation = player.transform.rotation; }
private void AttachPlayers() { Player_Input inputScript = GetComponent <Player_Input>(); inputScript.Player1 = playerOne; inputScript.Player2 = playerTwo; inputScript.Player1_rb = playerOne.GetComponent <Rigidbody2D>(); inputScript.Player2_rb = playerTwo.GetComponent <Rigidbody2D>(); playersInstantiated = true; }
void Awake() { player = GameObject.FindGameObjectWithTag(Tags.player); if(player != null) { playerViewport = player.GetComponentInChildren<Camera>(); viewportBlur = player.GetComponentInChildren<Blur>(); playerInput = player.GetComponent<Player_Input>(); } contextMessage.text = ""; if (SceneManager.GetActiveScene().buildIndex == 2) levelController = GameObject.FindGameObjectWithTag(Tags.levelController).GetComponent<MainLevelController>(); }
void Awake() { playerHead = GameObject.FindGameObjectWithTag(Tags.playerHead); playerViewport = GameObject.FindGameObjectWithTag(Tags.playerViewport); playerInput = GameObject.FindGameObjectWithTag(Tags.player).GetComponent<Player_Input>(); rigid = GetComponent<Rigidbody>(); col = GetComponent<CapsuleCollider>(); ForwardSpeed = maximumNormalSpeed; StrafeSpeed = maximumNormalSpeed * 0.8f; BackwardsSped = maximumNormalSpeed * 0.8f; characterTargetRotation = transform.localRotation; cameraTargetRotation = playerViewport.transform.localRotation; }
private void Awake() { Instance = this; player_Animation = GetComponent <Player_Animation>(); player_Stats = GetComponent <Player_Stats>(); player_Collision = GetComponent <Player_Collision>(); player_Actions = GetComponent <Player_Actions>(); player_Input = GetComponent <Player_Input>(); player_Equipment = GetComponent <Player_Equipment>(); player_Quest = GetComponent <Player_Quest>(); player_Event = GetComponent <Player_Events>(); animator = GetComponent <Animator>(); rb2D = GetComponent <Rigidbody2D>(); }
private void Start() { GameManager.instance.drone = gameObject; transform.position = GameManager.instance.dronePosition; target = GameManager.instance.player.transform; playerInput = GameManager.instance.player.GetComponent <Player_Input>(); seeker = GetComponent <Seeker>(); rb = GetComponent <Rigidbody2D>(); if (target == null) { Debug.Log("No Player found"); return; } seeker.StartPath(transform.position, target.position - offset, OnPathComplete); StartCoroutine(UpdatePath()); }
void Awake() { prefeb = GameObject.Find("prefeb"); prefeb.SetActive(false); ao = new AsyncObject(UID, BUFFER_SIZE); pi = new Player_Input(); psl = new Player_State_List(2); gameObjects = new GameObject[psl.userCount]; isInstantiate = new bool[psl.userCount]; for (int i = 0; i < psl.userCount; i++) { psl.states[i] = new Player_State(i); isInstantiate[i] = false; } positionThread = new Thread(Positioning); positionThread.IsBackground = true; Console.WriteLine("Starting client..."); positionThread.Start(); }
private void findLookDirection() { Player_Input input = gameObject.transform.parent.GetComponentInChildren <Player_Input>(); if (input.quad1) { gameObject.transform.parent.rotation = Quaternion.Euler(0, 180, 0); if (animationManager.animationDataObject != faceAwayFromPlayer) { animationManager.changeAnimation(faceAwayFromPlayer); } } else if (input.quad2) { gameObject.transform.parent.rotation = Quaternion.Euler(0, 0, 0); if (animationManager.animationDataObject != faceAwayFromPlayer) { animationManager.changeAnimation(faceAwayFromPlayer); } } else if (input.quad3) { gameObject.transform.parent.rotation = Quaternion.Euler(0, 180, 0); if (animationManager.animationDataObject != faceToPlayer) { animationManager.changeAnimation(faceToPlayer); } } else if (input.quad4) { gameObject.transform.parent.rotation = Quaternion.Euler(0, 0, 0); if (animationManager.animationDataObject != faceToPlayer) { animationManager.changeAnimation(faceToPlayer); } } else { } }
void getBody(int i, int BODY_SIZE) { ao[i].WorkingSocket.Receive(ao[i].Buffer, 0, BODY_SIZE, SocketFlags.None); string jsonData = System.Text.Encoding.UTF8.GetString(ao[i].Buffer); if (jsonData == "connection failed") // 연결 종료 { psl.isConnected[i] = 0; ao[i].ClearBuffer(); ao[i].WorkingSocket.Close(); gameObjects[i].SetActive(false); Console.WriteLine("[" + i + "] 접속 종료"); return; } else // 키 입력 데이터 받음. { Player_Input pi = Converter.JsonToOject <Player_Input>(jsonData); pil.list[i] = pi; } // 데이터를 받은 후엔 다시 버퍼를 비워주고 같은 방법으로 수신을 대기한다. ao[i].ClearBuffer(); }
private void Start() { playerInput = GetComponent<Player_Input>(); playerCam = Camera.main; Cursor.lockState = CursorLockMode.Locked; }
void Start() { instance = this; }
private void Awake() { player = GetComponent <Player>(); player_Input = player.player_Input; }
void Start() { ss = GameObject.FindObjectOfType <Spawn_Script>(); player = GameObject.FindObjectOfType <Player_Input>(); }
void Awake() { player = GameObject.FindGameObjectWithTag(Tags.player); playerInput = player.GetComponent<Player_Input>(); tutorialController = GameObject.Find("TutorialController").GetComponent<TutorialController>(); }
/** * 入力の読み込み */ public void setInput(Player_Input input) { this.input = input; }
// Start is called before the first frame update void Start() { player = GetComponent <Player_Input>(); currWeapon = weaponList[0]; player.currWeapon = currWeapon; }
// Start is called before the first frame update void Start() { charactercontroller = GetComponent <CharacterController>(); playerstat = GetComponent <Player_Stat>(); playerin = GetComponent <Player_Input>(); }