Esempio n. 1
0
    // Start is called before the first frame update
    void Start()
    {
        item_manager = GameObject.Find("ItemManager").GetComponent <ItemManager>();

        cow       = null; tiger = null; chicken = null;
        HPMax     = 1000;
        hp        = HPMax;
        hp_bar    = GameObject.FindWithTag("EChickenHp");
        hpbar_sx  = hp_bar.transform.localScale.x;
        hpbar_tx  = hp_bar.transform.localPosition.x;
        hpbar_tmp = hpbar_sx / HPMax;   //최대 체력에 따른 hp바 이동량 설정

        chicken_hp = GameObject.FindWithTag("chicken").GetComponent <Chicken_Attack>();
        cow_hp     = GameObject.FindWithTag("cow").GetComponent <Cow_Attack>();
        tiger_hp   = GameObject.FindWithTag("tiger").GetComponent <Tiger_Attack>();

        e_attack_data = GameObject.Find("E_AttackData").GetComponent <E_AttackData>();
        attack        = e_attack_data.Echicken_attack;

        //농장씬에서 죽었는지 파악
        if (!item_manager.cow_die)
        {
            cow = GameObject.Find("Cow").gameObject;
        }
        if (!item_manager.chicken_die)
        {
            chicken = GameObject.Find("Chicken").gameObject;
        }
        if (!item_manager.tiger_die)
        {
            tiger = GameObject.Find("tiger").gameObject;
        }

        Debug.Log("적닭 공격력: " + attack);
    }
Esempio n. 2
0
    // Start is called before the first frame update
    void Start()
    {
        Debug.Log("Start Tree");

        a_Cow = gameObject.GetComponent <Cow_Attack>();

        //root에 더함
        root.AddChild(selector);

        //selector에 더함
        selector.AddChild(seqBehavior);//행동

        find_Target.Cow_attack    = a_Cow;
        basic_Attack.Cow_attack   = a_Cow;
        special_Attack.Cow_attack = a_Cow;

        //행동들
        seqBehavior.AddChild(find_Target);
        seqBehavior.AddChild(basic_Attack);
        seqBehavior.AddChild(special_Attack);


        behaviorProcess = BehaviorProcess();
        StartCoroutine(behaviorProcess);
    }
Esempio n. 3
0
    // Start is called before the first frame update
    void Start()
    {
        // isDie = GameObject.Find("Tiger_p").transform.GetChild(0).GetComponent<Tiger_Move>().isDie;

        HPMax     = 1000;
        hp        = HPMax;
        hp_bar    = GameObject.FindWithTag("TigerHp");
        hpbar_sx  = hp_bar.transform.localScale.x;
        hpbar_tx  = hp_bar.transform.localPosition.x;
        hpbar_tmp = hpbar_sx / HPMax;   //최대 체력에 따른 hp바 이동량 설정

        //hp 가져오기
        E_chicken_hp = GameObject.FindWithTag("chicken_enemy").GetComponent <E_ch_Attack>();
        E_cow_hp     = GameObject.FindWithTag("cow_enemy").GetComponent <E_cow_Attack>();
        E_tiger_hp   = GameObject.FindWithTag("tiger_enemy").GetComponent <E_t_Attack>();
        //

        fPazik = transform.GetChild(1).gameObject;
        fPazik.SetActive(false);
        cow     = GameObject.FindWithTag("cow").GetComponent <Cow_Attack>();
        chicken = GameObject.FindWithTag("chicken").GetComponent <Chicken_Attack>();

        //공격 레벨 가져오기
        item_manager = GameObject.Find("ItemManager").GetComponent <ItemManager>();
        level        = item_manager.tiger_level;

        //공격력 가져오기
        attack_data = GameObject.Find("AttackData").GetComponent <Attack_Data>();
        attack      = attack_data.getAttackValue(level);

        Debug.Log("호랑이 레벨: " + level + ", 공격력: " + attack);

        animator = GetComponent <Animator>();
    }
Esempio n. 4
0
 // Start is called before the first frame update
 void Start()
 {
     E_cow  = GameObject.FindWithTag("cow_enemy").GetComponent <E_cow_Attack>();
     Camera = GameObject.FindWithTag("MainCamera").GetComponent <camera_shake>();
     cow    = GameObject.FindWithTag("cow").GetComponent <Cow_Attack>();
 }