Пример #1
0
    //NOTE: we call the correct anims for diff chars by using the same naming conventions for each char's animations. this way, we can just fill in the char's name to retrieve a particular animation for a particular character!


    // Use this for initialization
    void Start()
    {
        anim       = GetComponent <Animator>();         //tell unity to seek the animator attached to the player obj.
        motor      = GetComponent <PlayerMotor>();      //tell unity to seek the playermotor
        controller = GetComponent <PlayerController>(); //tell unity to seek the player controller
        stamina    = FindObjectOfType <StaminaManager>();
    }
Пример #2
0
    private void Start()
    {
        var gameController = GameObject.FindWithTag("GameController");

        inventory = gameController.GetComponent <InventoryManager>();
        stamina   = gameController.GetComponent <StaminaManager>();
    }
Пример #3
0
    void Start()
    {
        var gameController = GameObject.FindWithTag("GameController");

        inventory = gameController.GetComponentInChildren <InventoryManager>();
        score     = gameController.GetComponentInChildren <ScoreManager>();
        stamina   = gameController.GetComponentInChildren <StaminaManager>();
    }
Пример #4
0
    private void Start()
    {
        mover = GetComponent <PlayerMover>();
        var gameController = GameObject.FindWithTag("GameController");

        inventory = gameController.GetComponentInChildren <InventoryManager>();
        stamina   = gameController.GetComponentInChildren <StaminaManager>();
    }
Пример #5
0
    public override void OnStartLocalPlayer()
    {
        GameObject.Find("NetworkManager").GetComponent <GameState>().GameMode = Constants.GameMode.match;

        GetComponent <MeshRenderer>().material.color = Color.cyan;
        //StaminaText = transform.parent.gameObject.GetComponent<Canvas>().GetComponent<Text>();
        _staminaManager = GetComponent <StaminaManager>();

        _spawnLocations = FindObjectsOfType <NetworkStartPosition>();
    }
    private void SetComponents()
    {
        FindComponents();

        rb             = GetComponent <Rigidbody2D>();
        animator       = GetComponent <Animator>();
        staminaManager = gameObject.GetComponent <StaminaManager>();
        staminaManager.Init(moveSpeed);

        if (gameObject.GetComponent <PlayerAnimator>() == null)
        {
            gameObject.AddComponent <PlayerAnimator>();
        }
        else
        {
            playerAnimator = gameObject.GetComponent <PlayerAnimator>();
        }

        playerAnimator.Init(animator);
    }
Пример #7
0
 private void Start()
 {
     stamina = GameObject.FindWithTag("GameController").GetComponentInChildren <StaminaManager>();
 }
Пример #8
0
 private void Awake()
 {
     _PC = GetComponent <PlayerController>();
     _IM = GetComponent <InputManager>();
     _SM = GetComponent <StaminaManager>();
 }
Пример #9
0
 // Use this for initialization
 void Start()
 {
     mySM             = GameObject.FindGameObjectWithTag("SoundManager").GetComponent <SoundManager>();
     myStaminaManager = GameObject.FindGameObjectWithTag("StaminaManager").GetComponent <StaminaManager>();
 }