Inheritance: MonoBehaviour
Example #1
0
 // Use this for initialization
 void Awake()
 {
     nvAgent  = this.gameObject.GetComponent <UnityEngine.AI.NavMeshAgent>();
     playerTr = GameObject.FindWithTag("Player").GetComponent <Transform>();
     tr       = this.gameObject.GetComponent <Transform>();
     fireCtrl = this.gameObject.GetComponent <FireCtrl>();
 }
Example #2
0
 private void Awake()
 {
     player    = GameManager.instance.player;
     firectrl  = player.GetComponent <FireCtrl>();
     hpMax     = player.HP;
     bulletMax = firectrl.maxBullet;
 }
Example #3
0
 private void Awake()
 {
     fireCtrl    = GetComponent <FireCtrl>();
     playerTr    = GetComponent <Transform>();
     anim        = GetComponent <Animation>();
     playerRigid = GetComponent <Rigidbody>();
 }
Example #4
0
    // Use this for initialization
    void Start()
    {
        //init new prefs restart
        PlayerPrefs.SetInt("mon1", 0);
        PlayerPrefs.SetInt("mon2", 0);
        PlayerPrefs.SetInt("level", 0);

        PlayerPrefs.SetInt("skill1_lv", 0);
        PlayerPrefs.SetInt("skill2_lv", 0);
        PlayerPrefs.SetInt("skill_point_left", 10);
        //end

        tr        = GetComponent <Transform> ();
        _gameMgr  = GameObject.Find("GameManager").GetComponent <GameMgr> ();
        _fireCtrl = GetComponent <FireCtrl> ();

        _animation      = GetComponentInChildren <Animation> ();
        _animation.clip = anim.idle;
        _animation.Play();
        _mainCamera = GameObject.Find("Main Camera");

        normalSpeed = 7.0f;
        dashSpeed   = 20.0f;
        shootSpeed  = 3.0f;

        moveSpeed = 7.0f;
        rotSpeed  = 100.0f;
    }
Example #5
0
 void Start()
 {
     tr   = GetComponent <Transform>();
     ctrl = GetComponent <FireCtrl>();
     //Animation 컴포넌트를 변수에 할당
     anim = GetComponentInChildren <Animation>();
     rb   = GetComponent <Rigidbody>();
     //Animation 컴포넌트의 애니메이션 클립을 지정하고 실행
     anim.clip = playerAnim.idle;
     anim.Play();
     jumpCount  = 0;
     maxStamina = stamina;
 }
Example #6
0
    void Start()
    {
        fireC = GetComponent <FireCtrl>();

        tr = GetComponent <Transform>();
        //Animation 컴포넌트 변수 할당
        anim = GetComponent <Animation>();
        //Animation 컴포넌트의 애니메이션 클립 지정 실행
        anim.clip = playerAnim.idle;
        anim.Play();

        moveSpeed = GameManager.instance.gameData.speed;

        MSpeedText = CanvasManager.instance.Speed;
    }
Example #7
0
    void Start()
    {
        // 이동, 수리, 식사 등 상태에 관한 초기화입니다
        this.step      = STEP.NONE;                 // 현재 상태 초기화
        this.next_step = STEP.NONE;                 // 다음 상태 초기화

        // 수집 행동을 위해 ItemRoot 스크립트를 가져옵니다.
        this.item_root         = GameObject.Find("GameRoot").GetComponent <ItemRoot>();
        this.guistyle.fontSize = 16;

        this.skill_root    = GameObject.Find("GameRoot").GetComponent <SkillRoot>();
        this.carried_skill = skill_root.Skill_list[0];    // 스킬 설정

        inventory.ItemUsed    += Inventory_ItemUsed;
        inventory.ItemRemoved += Inventory_ItemRemoved;

        //fireCtrl가져온거
        fireCtrl = GameObject.FindGameObjectWithTag("Enemy").GetComponent <FireCtrl>();
    }
Example #8
0
 private void Start()
 {
     InitializeWeapon();
     firectrl = GetComponentInParent <FireCtrl>();
 }
Example #9
0
 private void Start()
 {
     playerTr       = GetComponent <Transform>();
     fireCtrl       = this.transform.root.GetComponent <FireCtrl>();
     flameGunDamage = this.GetComponentInParent <Gun>()._bulletDamage;
 }
Example #10
0
 // Use this for initialization
 void Start()
 {
     originalPosition = transform.localPosition;
     firectrl         = GetComponentInParent <FireCtrl>();
 }
Example #11
0
 public virtual void Awake()
 {
     animator = GetComponent <Animator>();
     dmgCheck = GetComponent <CapsuleCollider2D>();
     fireCtrl = GetComponent <FireCtrl>();
 }
Example #12
0
 // Use this for initialization
 void Start()
 {
     fireCtrl  = GameObject.Find("Player").GetComponent <FireCtrl> ();
     startTime = GameObject.Find("GameManager").GetComponent <GameMgr>().startTime;
     //skill1_text.text = "0";
 }