コード例 #1
0
    void Start()
    {
        playerBar = GameObject.FindGameObjectWithTag("Player").GetComponent <ui_healthbar>();
        p_move    = GameObject.FindGameObjectWithTag("Player").GetComponent <p_movement>();
        //theCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<camera>();


        bar       = transform.FindChild("HealthBar").GetComponent <Scrollbar>();
        text      = transform.FindChild("HealthBar").FindChild("Text").GetComponent <Text>();
        livesText = transform.FindChild("HealthBar").FindChild("LivesText").GetComponent <Text>();
    }
コード例 #2
0
    void Start()
    {
        regenCooldown = Time.time;
        spawnPosition = transform.position;

        maxHealth = health;
        healthbar = GetComponent <ui_healthbar>();

        healthbar.SetMaxHealth(maxHealth);

        if (notPlayer)
        {
            ai_spider = GetComponent <ai_skullspider>();
        }
        else
        {
            healthbar.lives = lives;
            p_anim          = GetComponent <p_animation>();
            p_move          = GetComponent <p_movement>();
            p_comb          = GetComponent <p_combat>();
            InvokeRepeating("HealthRegen", 0, 0.3F);
        }
    }
コード例 #3
0
 // Start is called before the first frame update
 void Start()
 {
     TargetPlayer = GameObject.FindGameObjectWithTag("Player").GetComponent <p_movement>();
 }
コード例 #4
0
 void Start()
 {
     anim    = GetComponent <p_animation>();
     p_move  = GetComponent <p_movement>();
     main_ui = GameObject.FindGameObjectWithTag("MainCanvas").GetComponent <ui_game>();
 }