コード例 #1
0
ファイル: Player.cs プロジェクト: Bluhman/BummerMen
    public override void OnStartLocalPlayer()
    {
        GameObject myHUD = Instantiate(LocalHUD);

        LocalHUDControl        = myHUD.GetComponent <PlayerHUDController>();
        LocalHUDControl.player = this;
    }
コード例 #2
0
 void Start()
 {
     SourceSound    = GetComponent <AudioSource>();
     SourceAnimator = GetComponent <Animator>();
     rb             = GetComponent <Rigidbody2D>();
     PlayerHud      = GameObject.FindGameObjectWithTag("HUD").GetComponent <PlayerHUDController>();
 }
コード例 #3
0
    public void InitiatePlayer(global_game_controller game, Transform par)
    {
        global_game_controller = game;
        this.parent            = par;

        // initiate HUD & Map
        if (controll == Player_Controll.Player)
        {
            toggle_canvas = FindObjectOfType <toggle_canvas>();
            toggle_canvas.initiate(this);

            leveluppanel = FindObjectOfType <LevelUpPanel_Controller>();
            leveluppanel.initiate(this);

            playerhud = FindObjectOfType <PlayerHUDController>();
            playerhud.initiate(this);
            playerhud.updateAllLabels();
        }

        map_reference = GetComponentInParent <Map_script>();
        map_reference.initiate(this);

        initiated = true;
        controller.initiate(this);

        setDifficultDependent(controller.difficulty);
    }
コード例 #4
0
 void Awake()
 {
     _firstPersonController = GetComponent <FirstPersonController>();
     _actionController      = GetComponent <ActionController>();
     _visionToggler         = GetComponent <VisionToggler>();
     _leanScript            = GetComponentInChildren <Lean>();
     _camera = GetComponentInChildren <Camera>();
     _postProcessingBehaviour = GetComponentInChildren <PostProcessingBehaviour>();
     _audioListener           = GetComponentInChildren <AudioListener>();
     _playerHudController     = GetComponent <PlayerHUDController>();
     _glitchEffect            = GetComponentInChildren <GlitchEffect>();
 }
コード例 #5
0
 public static void InitializeCanvases()
 {
     PlayerHud           = GameObject.Find("PlayerHUD");
     PlayerHudController = PlayerHud.GetComponent <PlayerHUDController>();
     PlayerHud.SetActive(false);
     PauseMenu = GameObject.Find("PauseMenu");
     PauseMenu.SetActive(false);
     InventoryMenu           = GameObject.Find("InventoryMenu");
     InventoryMenuController = InventoryMenu.GetComponent <InventoryMenuController>();
     InventoryMenu.SetActive(false);
     DeathMenu = GameObject.Find("DeathMenu");
     DeathMenu.SetActive(false);
 }
コード例 #6
0
    private void OnEnable()
    {
        animator = GetComponentInChildren <Animator>();
        GameManager.OnGameStarted  += OnGameStart;
        GameManager.OnGameFinished += OnGameFinished;

        CurrentPlayerState = PlayerState.JOINED;
        Controller.enabled = false;
        //Camera.enabled = false;iok 0
        HUD = GameManager.Instance.GetPlayerHUD(Input);
        //HUD.SetReady(false);
        GameManager.OnGameStarting += HUD.GameStarting;
        animator.SetFloat("Forward", 0);
    }
コード例 #7
0
    public void PlayerJoined(PlayerInput player)
    {
        activePlayers.Add(player);
        Debug.Log($"Player {player.playerIndex} Joined");
        if (activePlayers.Count >= PlayerInputManager.instance.maxPlayerCount)
        {
            PlayerInputManager.instance.DisableJoining();
        }

        PlayerHUDController hud = GetPlayerHUD(player);

        _walls[player.playerIndex].SetOwner(player.GetComponent <PlayerController>());
        _walls[player.playerIndex].SetColor(this.colors[player.playerIndex]);
        hud.SetActive(true);
        hud.SetPlayerNum(player.playerIndex);
        hud.SetReady(false);
        _hud34Parent.gameObject.SetActive(activePlayers.Count >= 3);
        p3_camera.SetActive(activePlayers.Count > 0);
        _countdownText.transform.parent.gameObject.SetActive(false);
    }
コード例 #8
0
 // Start is called before the first frame update
 void Start()
 {
     PlayerHud = GameObject.FindGameObjectWithTag("HUD").GetComponent <PlayerHUDController>();
 }
コード例 #9
0
 private void Start()
 {
     playerHUD = GameObject.FindWithTag("HUD").GetComponent <PlayerHUDController>();
 }
コード例 #10
0
 // Use this for initialization
 void Start()
 {
     fpsCamera           = GetComponentInChildren <Camera>();
     xRayVision          = fpsCamera.GetComponent <XRayVision>();
     playerHudController = GetComponent <PlayerHUDController>();
 }
コード例 #11
0
 // We set TimeScale to = 1.0 since when player die the time scale change then we restart the level.
 // Assigning playerHUD and making sure the deathCanvas is disabled.
 private void Start()
 {
     Time.timeScale      = 1.0f;
     deathCanvas.enabled = false;
     playerHUD           = GameObject.FindWithTag("HUD").GetComponent <PlayerHUDController>();
 }
コード例 #12
0
    void Awake()
    {
        rigidbody = GetComponent<Rigidbody2D>();
        body = GetComponent<PolygonCollider2D>();
        feet = GetComponent<CircleCollider2D>();
        health = GetComponent<Health>();
        movementEnabled = true;
        standing = body.points;
        crouched = new Vector2[standing.Length];
        grounded = false;
        onWall = false;
        upSlope = false;
        downSlope = false;
        anim = GetComponent<Animator>();
        hud = GetComponent<PlayerHUDController>();
        headLight = GameObject.Find ("HeadLight");

        int min = 0;
        for (int i = 0; i < standing.Length; i++)
        {
            if (standing[i].y < standing[min].y)
                min = i;
        }
        for (int i = 0; i < standing.Length; i++)
        {
            float newY = (standing[i].y - standing[min].y) * 0.5f + standing[min].y;
            crouched[i] = new Vector2(standing[i].x, newY);
        }
    }
コード例 #13
0
 // Start is called before the first frame update
 void Start()
 {
     PlayerHud = GameObject.FindGameObjectWithTag("HUD").GetComponent <PlayerHUDController>();
     StartCoroutine(StartMission());
     ObjectiveText.text = Objective;
 }
コード例 #14
0
 // Start is called before the first frame update
 void Start()
 {
     SearchZone = GetComponent <ShopSearchZone>();
     PlayerHud  = GameObject.FindGameObjectWithTag("HUD").GetComponent <PlayerHUDController>();
 }