Exemple #1
0
    private void Start()
    {
        rig          = GetComponent <Rigidbody>();                       // 取得元件 (rigidbody) 存入 rig (相同屬性面板)
        ani          = GetComponent <Animator>();
        hpMpManager  = GetComponentInChildren <HpMpManager>();
        hpText       = transform.GetChild(3).GetChild(3).GetComponent <Text>();
        joystick     = GameObject.Find("固態搖桿").GetComponent <Joystick>(); // 取得指定元件 (Joystick中的固態搖桿)
        target       = GameObject.Find("目標").transform;                   // 短版的指定元件
        levelManager = FindObjectOfType <LevelManager_Ifinite>();
        skillData    = FindObjectOfType <SkillData>();

        data.hp        = data.hpMax; // 設定生命力
        hp             = data.hp;
        hpMax          = data.hpMax;
        attack         = data.attack;
        attack_WP      = data.WeaponAttack;
        criticalAttack = data.CriticalAttack;
        cd             = data.cd;
        speed          = data.speed;
        rehp           = data.rehp;

        bullet = test_bullet; // 設定預設子彈
        pet1   = test_pet;    // 設定預設寵物

        Instantiate(pet1);
    }
    private void Start()
    {
        ani         = GetComponent <Animator>();
        agent       = GetComponent <NavMeshAgent>();
        hpMpManager = GetComponentInChildren <HpMpManager>();
        LM_I        = FindObjectOfType <LevelManager_Ifinite>();

        agent.speed            = data.speed;
        agent.stoppingDistance = data.StopDistanse;
        hp = data.hp;

        target = GameObject.Find("玩家_IFI").transform;
    }
Exemple #3
0
    private void Start()
    {
        property = data.attributes.ToString();

        ani         = GetComponent <Animator>();
        agent       = GetComponent <NavMeshAgent>();
        hpMpManager = GetComponentInChildren <HpMpManager>();

        agent.speed            = data.speed;
        agent.stoppingDistance = data.StopDistanse;
        hp = data.hp;

        target = GameObject.Find("玩家").transform;
    }