Exemplo n.º 1
0
    // Start is called before the first frame update
    void Awake()
    {
        #region Singelton check
        if (Instance != null)
        {
            Destroy(gameObject);
        }
        else
        {
            Instance = this;
        }
        #endregion
        DontDestroyOnLoad(gameObject);
        throwScript   = GetComponent <Throw>();
        move          = GetComponent <PlayerMovement>();
        animeScript   = GetComponent <PlayerAnimationScript>();
        summon        = GetComponent <Summon>();
        grapplingHook = GetComponent <GrapplingHook>();
        coll          = GetComponent <Collision>();
        pickUp        = GetComponent <PickUp>();
        SetCameraToFollowPlayer();
        maxHealth = health;

        scripts.Add(throwScript);
        scripts.Add(summon);
        scripts.Add(grapplingHook);
    }
Exemplo n.º 2
0
    // OnStateExit is called when a transition ends and the state machine finishes evaluating this state
    override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        PlayerAnimationScript pls = animator.GetComponent <PlayerAnimationScript>();

        pls.rolling      = false;
        pls.hasDirection = false;
    }
Exemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        coll             = GetComponent <Collision>();
        _rb2D            = GetComponent <Rigidbody2D>();
        betterJumpScript = GetComponent <BetterJumping>();
        anime            = GetComponent <PlayerAnimationScript>();

        orginalGravityScale = _rb2D.gravityScale;
        InstantiateGhost();
    }
Exemplo n.º 4
0
 void Awake()
 {
     playersNaSaida = 0;
     //Loading dos componentes
     rb              = GetComponent <Rigidbody2D>();
     partners        = GetComponent <PartnersFunctionsScript>();
     playerAnimation = GetComponent <PlayerAnimationScript>();
     //Registro das variaveis importantes
     totalCount = counter;
     corzinha   = new Color(0.4185208f, 0.7152144f, 0.9339623f);
 }
Exemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        currenthealth                 = maxHealth;
        anim                          = GetComponent <Animator>();
        playerMovement                = GetComponent <PlayerTwoMovement>();
        playerAnim                    = GetComponent <PlayerTwoAnimationScript>();
        m_PlayerTwoHealthSlider       = GameObject.Find("P2_Slider").GetComponent <Slider>();
        m_PlayerTwoHealthSlider.value = maxHealth;
        m_WinnerText                  = GameObject.Find("WinnerText").GetComponent <Text>();

        p1 = GameObject.Find("Player01").GetComponent <PlayerAnimationScript>();
        p2 = GetComponent <PlayerTwoAnimationScript>();
    }
Exemplo n.º 6
0
    void Start()
    {
        playerRB      = GetComponent <Rigidbody2D>();
        windowToClean = FindObjectOfType <Window>();

        itemHeld = ItemHeld.Wiper;

        horizontalSpeed = data.regularSpeed;
        upSpeed         = data.regularUpSpeed;
        downSpeed       = data.regularDownSpeed;
        currentItem     = 1;

        playerAnimationScript = GetComponent <PlayerAnimationScript>();
    }
Exemplo n.º 7
0
    // Start is called before the first frame update
    void Start()
    {
        move     = GetComponent <PlayerMovement>();
        material = GetComponent <Renderer>().material;

        weaponRb2D        = weapon.GetComponent <Rigidbody2D>();
        throwWeaponScript = weapon.GetComponent <ThrowWeapon>();
        pAnimScript       = GetComponent <PlayerAnimationScript>();
        throwWeaponScript.AddThrowWeaponScript(this);
        coll = GetComponent <Collision>();

        origLockPos = weapon.localPosition;
        origLockRot = weapon.localEulerAngles;

        arrowOrigPosition = arrow.localPosition;

        if (arrow.gameObject.activeInHierarchy)
        {
            arrow.gameObject.SetActive(false);
        }

        ChangeState(State.Idle);
    }
    // Use this for initialization
    void Start()
    {
        currenthealth = maxHealth;
        anim = GetComponent<Animator>();
        playerMovement = GetComponent<PlayerMovement>();
        playerAnim = GetComponent<PlayerAnimationScript>();
        m_PlayerHealthSlider = GameObject.Find("P1_Slider").GetComponent<Slider>();
        m_WinnerText = GameObject.Find("WinnerText").GetComponent<Text>();
        m_PlayerHealthSlider.value = currenthealth;

        p1 = GetComponent<PlayerAnimationScript>();
        p2 = GameObject.Find("Player02").GetComponent<PlayerTwoAnimationScript>();
    }
Exemplo n.º 9
0
 // Start is called before the first frame update
 void Start()
 {
     move  = PlayerManager.Instance.gameObject.GetComponent <PlayerMovement>();
     anime = PlayerManager.Instance.gameObject.GetComponent <PlayerAnimationScript>();
     sr    = GetComponent <SpriteRenderer>();
 }