예제 #1
0
    // Use this for initialization
    void Start()
    {
        //the cklass with the main player animations
        AnimationClass = GetComponent <MainPlayerAnimations>();

        var DamageBar = GameObject.FindGameObjectsWithTag("LiveBar");

        //rigid body control
        rigid = GetComponent <Rigidbody2D>();

        DamageBarAnimation = DamageBar[0];
        liveBar            = DamageBarAnimation.GetComponent("MainPlayerLiveBar") as MainPlayerLiveBar;
    }
예제 #2
0
    //the up movement is in basic attack as it doesnt produce any movement at all



    // Use this for initialization
    void Start()
    {
        //rigid body control
        rigid = GetComponent <Rigidbody2D>();
        //we use this to flip the sprite
        sprite = GetComponent <SpriteRenderer>();
        //the cklass with the main player animations
        AnimationClass = GetComponent <MainPlayerAnimations>();


        //we crate a box collider for the foot,  it will allow us know when the player is touching the floor
        footCollider           = this.gameObject.AddComponent <BoxCollider2D>();
        footCollider.offset    = new Vector3(0, footPosition, 0);
        footCollider.size      = new Vector3(footWidth, footHigh, 0);
        footCollider.isTrigger = true;
    }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        //the cklass with the main player animations
        AnimationClass     = GetComponent <MainPlayerAnimations>();
        backgroundPosition = DeadBG.position;
        var DamageBar = GameObject.FindGameObjectsWithTag("LiveBar");

        //rigid body control
        rigid = GetComponent <Rigidbody2D>();

        DamageBarAnimation = DamageBar[0];
        liveBar            = DamageBarAnimation.GetComponent("MainPlayerLiveBar") as MainPlayerLiveBar;


        // liveBar.Damage(totalDamage);
    }
예제 #4
0
    // Use this for initialization
    void Start()
    {
        //we use this to flip the sprite
        sprite = GetComponent <SpriteRenderer>();
        //the cklass with the main player animations
        AnimationClass = GetComponent <MainPlayerAnimations>();



        //rigid body control
        rigid = GetComponent <Rigidbody2D>();

        var DamageBar = GameObject.FindGameObjectsWithTag("LiveBar");

        DamageBarAnimation = DamageBar[0];
        liveBar            = DamageBarAnimation.GetComponent("MainPlayerLiveBar") as MainPlayerLiveBar;



        player = GetComponent <Transform>();
    }