コード例 #1
0
 void Start()
 {
     p_i = gameObject.GetComponentInParent <Player_Input>();
     pb  = gameObject.GetComponent <ProblemBattery_Script>();
     pp  = gameObject.GetComponent <ProblemPower_Script>();
     pe  = gameObject.GetComponent <ProblemEngine_Script>();
 }
コード例 #2
0
    private void Awake()
    {
        //Find the PlayerInput component
        playerInput = GameObject.Find("Main Camera").GetComponent <Player_Input>();

        //Subscription here
        playerInput.OnInventoryPress += InventoryCheck;
    }
コード例 #3
0
 public PlayerAnimations(Animator animator, Transform player)
 {
     playerInput             = player.GetComponent <Player_Input>();
     this.animator           = animator;
     playerInput.OnJumpUp   += OnJumpInputUp;
     playerInput.OnJumpDown += OnJumpInputDown;
     playerInput.OnAttack   += OnAttack;
 }
コード例 #4
0
ファイル: Door.cs プロジェクト: Nozyka/Eden-0.01
 private void OnTriggerEnter(Collider other)
 {
     if (other.name == "Controller (left)" || other.name == "Controller (right)")
     {
         goController = other.gameObject.GetComponent <Player_Input>();
         bCanGrab     = true;
     }
 }
コード例 #5
0
ファイル: Door.cs プロジェクト: Nozyka/Eden-0.01
 private void OnTriggerExit(Collider other)
 {
     if (other.name == "Controller (left)" || other.name == "Controller (right)")
     {
         goController = null;
         bCanGrab     = false;
     }
 }
コード例 #6
0
 private void Start()
 {
     playerInput = GetComponent<Player_Input>();
     m_Player = GetComponent<CharacterController>();
     originalFOV = Camera.main.fieldOfView;
     SpawnWeapon();
     InitWeapon();
 }
コード例 #7
0
 private void Start()
 {
     weaponController = GetComponent <Weapon_Controller>();
     cameraController = GetComponent <Camera_Controller>();
     playerInput      = GetComponent <Player_Input>();
     m_Player         = GetComponent <CharacterController>();
     m_Anim           = weaponController.ActiveWeaponAnimator;
 }
コード例 #8
0
    void Start()
    {
        pi = gameObject.GetComponent <Player_Input>();

        bat = gameObject.GetComponentInChildren <ProblemBattery_Script>();
        pow = gameObject.GetComponentInChildren <ProblemPower_Script>();
        eng = gameObject.GetComponentInChildren <ProblemEngine_Script>();
    }
コード例 #9
0
 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;
 }
コード例 #10
0
 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;
 }
コード例 #11
0
    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;
    }
コード例 #12
0
ファイル: GameUI.cs プロジェクト: sixeco/Unnoticed
 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>();
 }
コード例 #13
0
ファイル: Player_Movement.cs プロジェクト: sixeco/Unnoticed
    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;
    }
コード例 #14
0
    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>();
    }
コード例 #15
0
ファイル: DroneAI.cs プロジェクト: FouadAH/2D-platformer
    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());
    }
コード例 #16
0
 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();
 }
コード例 #17
0
    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
        {
        }
    }
コード例 #18
0
ファイル: Server.cs プロジェクト: kevin1113-github/Weekend
    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();
    }
コード例 #19
0
 private void Start()
 {
     playerInput = GetComponent<Player_Input>();
     playerCam = Camera.main;
     Cursor.lockState = CursorLockMode.Locked;
 }
コード例 #20
0
 void Start()
 {
     instance = this;
 }
コード例 #21
0
 private void Awake()
 {
     player       = GetComponent <Player>();
     player_Input = player.player_Input;
 }
コード例 #22
0
 void Start()
 {
     ss     = GameObject.FindObjectOfType <Spawn_Script>();
     player = GameObject.FindObjectOfType <Player_Input>();
 }
コード例 #23
0
ファイル: TriggerZone03.cs プロジェクト: sixeco/Unnoticed
	void Awake()
    {
        player = GameObject.FindGameObjectWithTag(Tags.player);
        playerInput = player.GetComponent<Player_Input>();
        tutorialController = GameObject.Find("TutorialController").GetComponent<TutorialController>();
    }
コード例 #24
0
 /**
  * 入力の読み込み
  */
 public void setInput(Player_Input input)
 {
     this.input = input;
 }
コード例 #25
0
ファイル: PlayerInventory.cs プロジェクト: doomproject/doom
 // Start is called before the first frame update
 void Start()
 {
     player            = GetComponent <Player_Input>();
     currWeapon        = weaponList[0];
     player.currWeapon = currWeapon;
 }
コード例 #26
0
ファイル: Player_Movement.cs プロジェクト: KLDMS/3Ddemo
 // Start is called before the first frame update
 void Start()
 {
     charactercontroller = GetComponent <CharacterController>();
     playerstat          = GetComponent <Player_Stat>();
     playerin            = GetComponent <Player_Input>();
 }