示例#1
0
 void Start()
 {
     animator      = GetComponent <Animator>();
     playerBody    = GetComponent <Rigidbody2D>();
     groundSensor  = transform.Find("GroundSensor").GetComponent <Sensor_Bandit>();
     currentHealth = maxHealth;
 }
 // Use this for initialization
 void Start()
 {
     m_hook         = GetComponent <Hook>();
     m_animator     = GetComponent <Animator>();
     m_body2d       = GetComponent <Rigidbody2D>();
     m_groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_Bandit>();
 }
示例#3
0
 // Use this for initialization
 void Start()
 {
     m_animator     = GetComponent <Animator>();
     m_body2d       = GetComponent <Rigidbody2D>();
     m_groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_Bandit>();
     playerCombat   = GetComponent <PlayerCombat>();
 }
示例#4
0
 // Use this for initialization
 void Start()
 {
     m_animator     = GetComponent <Animator>();
     m_body2d       = GetComponent <Rigidbody2D>();
     m_groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_Bandit>();
     knightMoement.GetComponent <KnightFight>();
 }
示例#5
0
文件: Player.cs 项目: Bacur/CMTRY
 void Start()
 {
     _animator         = GetComponent <Animator>();
     _body2d           = GetComponent <Rigidbody2D>();
     _groundSensor     = transform.Find("GroundSensor").GetComponent <Sensor_Bandit>();
     _LayerMaskToEnemy = LayerMask.GetMask("Enemy", "Bullet");
     _HealthBar.SetIndex(_Health);
     _DefaultAttackPointPosition = _AttackPoint.localPosition;
 }
示例#6
0
 // Use this for initialization
 void Start()
 {
     Time.timeScale = 1f;
     m_animator     = GetComponent <Animator>();
     m_body2d       = GetComponent <Rigidbody2D>();
     m_groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_Bandit>();
     currentHealth  = maxHealth;
     healthBar.SetMaxHealth(maxHealth);
 }
示例#7
0
 // Use this for initialization
 void Start()
 {
     transform.localScale  = new Vector3(-1.0f, 1.0f, 1.0f);
     m_animator            = GetComponent <Animator>();
     m_body2d              = GetComponent <Rigidbody2D>();
     m_groundSensor        = transform.Find("GroundSensor").GetComponent <Sensor_Bandit>();
     SlashCollider.enabled = false;
     Combo.SetActive(false);
 }
示例#8
0
    // Start is called before the first frame update
    void Awake()
    {
        inputs = new PlayerInputActions();
        rb     = GetComponent <Rigidbody2D>();
        sens   = transform.Find("GroundSensor").GetComponent <Sensor_Bandit>();

        inputs.Player.Jump.started  += ctx => JumpStarted();
        inputs.Player.Jump.canceled += ctx => JumpCancelled();
    }
 void Start()
 {
     m_animator     = GetComponent <Animator>();
     m_body2d       = GetComponent <Rigidbody2D>();
     m_groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_Bandit>();
     curHealth      = maxHealth;
     m_wallSensor   = transform.Find("WallSensor").GetComponent <Sensor_Bandit>();
     m_animator.SetInteger("AnimState", 1);
 }
示例#10
0
 // Use this for initialization
 void Start()
 {
     winText.gameObject.SetActive(false);
     deadText.gameObject.SetActive(false);
     m_animator     = GetComponent <Animator>();
     m_body2d       = GetComponent <Rigidbody2D>();
     m_groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_Bandit>();
     sprite         = GetComponent <SpriteRenderer>();
     countText.text = "Money: " + (coins * 100).ToString();
 }
示例#11
0
 // Use this for initialization
 void Start()
 {
     m_animator     = GetComponent <Animator>();
     m_body2d       = GetComponent <Rigidbody2D>();
     m_groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_Bandit>();
     sword          = GameObject.FindGameObjectWithTag("Sword");
     sword.gameObject.SetActive(false);
     steepAudio = GetComponent <AudioSource>();
     //sword.transform.position = new Vector3(sword.transform.position.x, transform.position.y, 200);
 }
示例#12
0
    void Start()
    {
        animator         = GetComponent <Animator>();
        BoxColliderClick = gameObject.GetComponent <SpriteRenderer>();
        _UIManager       = GameObject.Find("GameMaster").GetComponent <UIManager>();
        _UIManager.SetPlayHPMax(3);
        _UIManager.SetPlayMPMax(100);

        mSensor_Bandit = gameObject.transform.GetChild(0).gameObject.GetComponent <Sensor_Bandit>();
        playStatu      = 0;
    }
示例#13
0
 // Use this for initialization
 void Start()
 {
     m_animator     = GetComponent <Animator>();
     m_body2d       = GetComponent <Rigidbody2D>();
     m_groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_Bandit>();
     GetComponent <SpriteRenderer>().flipX = true;
     click     = GlobalVariables.getClick();
     dashTime  = startDashTime;
     timeStamp = Time.time + cooldown;
     power     = GlobalVariables.getPower();
 }
示例#14
0
    // Use this for initialization
    void Start()
    {
        m_animator     = GetComponent <Animator>();
        m_body2d       = GetComponent <Rigidbody2D>();
        m_groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_Bandit>();

        currentHealth1 = maxHealth1;
        healthBar1.SetMaxHealth(maxHealth1);

        currentFB = 0;
        fillableBar.SetHealth(currentFB);
    }
    void Start()
    {
        Time.timeScale = 1;
        m_animator     = GetComponent <Animator>();
        m_body2d       = GetComponent <Rigidbody2D>();
        m_groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_Bandit>();

        spriteRenderer = GetComponent <SpriteRenderer>();
        AudioSource.PlayClipAtPoint(fightVoice, Camera.main.transform.position);

        StartCoroutine("attackVoiceTimer");
    }
示例#16
0
    void Start()
    {
        controller = GetComponent <Controller2D> ();

        gravity         = -(2 * maxJumpHeight) / Mathf.Pow(timeToJumpApex, 2);
        maxJumpVelocity = Mathf.Abs(gravity) * timeToJumpApex;
        minJumpVelocity = Mathf.Sqrt(2 * Mathf.Abs(gravity) * minJumpHeight);

        m_animator     = GetComponent <Animator>();
        m_body2d       = GetComponent <Rigidbody2D>();
        m_groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_Bandit>();

        originalPos = new Vector3(gameObject.transform.position.x, gameObject.transform.position.y, gameObject.transform.position.z);
    }
示例#17
0
    private void Start()
    {
        currentHealth = maxHealth;
        //display health bar at full health
        healthBar.SetMaxHealth(maxHealth);

        //if enemy keeps attacking, the enemies gruond sensor might have been tagged as player for some reason
        playerTarget = GameObject.FindGameObjectWithTag("Player");
        attackDelay  = 2f;
        damage       = 30;
        attackRange  = 150;
        //set animator, rigidbody and ground sensor components
        m_animator     = GetComponent <Animator>();
        m_body2d       = GetComponent <Rigidbody2D>();
        m_groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_Bandit>();
    }
示例#18
0
 private void Start()
 {
     animator     = GetComponent <Animator>();
     rb           = GetComponent <Rigidbody2D>();
     groundSensor = transform.Find("GroundSensor").GetComponent <Sensor_Bandit>();
 }
示例#19
0
 // Use this for initialization
 void Start()
 {
     m_animator     = GetComponent <Animator>();
     m_body2d       = GameObject.Find("Player").GetComponent <Rigidbody2D>();
     m_groundSensor = GameObject.Find("Body").GetComponent <Sensor_Bandit>();
 }