// Start is called before the first frame update
 void Start()
 {
     o_scale = this.transform.localScale;
     ee      = GameObject.FindGameObjectWithTag("EventEmitter").GetComponent <EventEmitter>();
     GRD     = this.GetComponent <IsGrounded>();
     passableObjectsLayerMask = (1 << LayerMask.NameToLayer("onewayplatform")) | (1 << LayerMask.NameToLayer("plant")) | (1 << LayerMask.NameToLayer("collectible")) | (1 << 2);
 }
Пример #2
0
    void Attacking()
    {
        if (Input.GetKeyDown(KeyCode.C) && lookingUp == false && lookingDown == false && canAttack == true)
        {
            Instantiate(attackHurtBoxForward, attackDirection);
            attackTimer = attackTimerMaxValue;
            hitStick.Play();
        }
        if (Input.GetKeyDown(KeyCode.C) && lookingUp == true && canAttack == true)
        {
            Instantiate(attackHurtBoxUp, attackDirection);
            attackTimer = attackTimerMaxValue;
            hitStick.Play();
        }

        GameObject groundCheck = GameObject.Find("GroundCheck");
        IsGrounded isAirborn   = groundCheck.GetComponent <IsGrounded>();

        if (Input.GetKeyDown(KeyCode.C) && lookingDown == true && lookingUp == false &&
            canAttack == true && isAirborn.isGrounded == false)
        {
            Instantiate(attachHurtBoxDown, attackDirection);
            attackTimer = attackTimerMaxValue;

            hitStick.Play();



            //rbodyPlayer.velocity = transform.up * 10;
        }
    }
 // Use this for initialization
 void Start()
 {
     rBody = GetComponent<Rigidbody2D>();
     //sGround = GetComponent<StayGrounded>();
     groundCheck = GetComponentInChildren<IsGrounded>();
     iCont = GetComponent<InputController>();
     IAction[] attachedActions = GetComponents<IAction>();
     for (int i = 0; i < attachedActions.Length; i++)
     {
         if (attachedActions[i].IsAttack())
             specialAttack = attachedActions[i];
         else
             specialDefense = attachedActions[i];
     }
     GameObject go = GameObject.FindGameObjectWithTag("Baton");
     if (go != null)
         crown = go.transform;
     startLocation = transform.position;
     renderers = new List<SpriteRenderer>();
     renderers.AddRange(GetComponentsInChildren<SpriteRenderer>());
     renderers.Add(GetComponent<SpriteRenderer>());
     colliders = new List<Collider2D>();
     colliders.AddRange(GetComponentsInChildren<Collider2D>());
     colliders.AddRange(GetComponents<Collider2D>());
     aController = GetComponent<Animator>();
     crownLocation = transform.FindChild("CrownLocation");
     GetComponentInChildren<TankGun>().playerID = playerID;
     movementSpeed *= Manager.instance.moveMultiplier;
     explosionParticles = transform.FindChild("player explosion").GetComponent<ParticleSystem>();
     jumpParticles = transform.FindChild("Jump poof").GetComponent<ParticleSystem>();
     dustParticles = transform.FindChild("dust poof").GetComponent<ParticleSystem>();
 }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     anim      = Animator.GetComponent <Animator>();
     rb        = GetComponent <Rigidbody>();
     _shake    = Camera.main.GetComponent <CameraShake>();
     _grounded = GroundDetector.GetComponent <IsGrounded> ();
 }
Пример #5
0
 void Start()
 {
     spr  = GetComponent <SpriteRenderer>();
     rb   = GetComponent <Rigidbody2D>();
     anim = GetComponent <Animator>();
     sc   = _partner.GetComponent <IsGrounded>();
 }
Пример #6
0
    // Use this for initialization
    void Start()
    {
        check = GetComponent <IsGrounded>();

        feet = GetComponentInChildren <Transform>();

        rb2D = GetComponent <Rigidbody2D>();
    }
Пример #7
0
    // Use this for initialization
    void Start()
    {
        jump = 0.0f;

        newPosition = Vector2.zero;

        groundCheck = GetComponent <IsGrounded>();
        rb2D        = GetComponent <Rigidbody2D>();
    }
Пример #8
0
    // Use this for initialization
    void Start()
    {
        newPosition = Vector2.zero;

        feet = GetComponentInChildren <Transform>();

        groundCheck = GetComponent <IsGrounded>();
        rb2D        = GetComponent <Rigidbody2D>();
    }
    void Start()
    {
        ee = GameObject.FindGameObjectWithTag("EventEmitter").GetComponent <EventEmitter>();
        ee = FindObjectOfType <EventEmitter>();
        ee.on("win", DeactivateSquishCollision);

        passableObjectsLayerMask = (1 << LayerMask.NameToLayer("onewayplatform")) | (1 << LayerMask.NameToLayer("plant")) | (1 << LayerMask.NameToLayer("collectible")) | (1 << LayerMask.NameToLayer("passable")) | (1 << 2);

        player = GameObject.FindGameObjectWithTag("Player");
        Gr     = player.GetComponent <IsGrounded>();
    }
Пример #10
0
    // Start is called before the first frame update
    void Start()
    {
        player = GameObject.Find("Player");

        isGrounded = GetComponent <IsGrounded>();
        respawn    = player.GetComponent <Respawn>();
        progress   = player.GetComponent <Progress>();

        logger = GameObject.Find("Telemetry").GetComponent <Logger>();
        sfx    = GameObject.Find("SFX").GetComponent <SFXScript>();

        hud = GameObject.Find("HUD");
    }
Пример #11
0
 private void Start()
 {
     ig     = gameObject.GetComponentInChildren <IsGrounded>();
     source = gameObject.GetComponent <AudioSource>();
 }
Пример #12
0
 // Use this for initialization
 void Start()
 {
     anim = Animator.GetComponent<Animator>();
     rb = GetComponent<Rigidbody>();
     _shake = Camera.main.GetComponent<CameraShake>();
     _grounded = GroundDetector.GetComponent<IsGrounded> ();
 }
 // Start is called before the first frame update
 void Start()
 {
     rb   = GetComponent <Rigidbody>();
     feed = GameObject.Find("Feed").GetComponent <IsGrounded>();
 }
Пример #14
0
    // Use this for initialization
    protected virtual void Start()
    {
        //Set component references
        rb = GetComponent<Rigidbody2D>();
        characterAnimator = GetComponent<Animator>();
        //groundCheckTransform = transform.FindChild("raycasts/groundCheck").transform;

        currentHealth = maxHealth;

        ground = transform.Find("Colliders/Feet").GetComponent<IsGrounded>();
        //Debug.Log("groundmask values:");
        //Debug.Log(groundMask.value);
    }