コード例 #1
0
ファイル: NpcBehaviour.cs プロジェクト: AG4W/Projekt42
    void Start()
    {
        if (weapon == null)
        {
            weapon = Resources.Load <Weapon>("Data/Items/Weapons/Fists");
        }

        player        = GameManager.player;
        currentHealth = maxHealth;

        playerAnimator = player.GetComponentInChildren <Animator>();
        animator       = this.GetComponentInChildren <Animator>();

        //request UI healthbar etc
        this.GetComponent <ActorHealthbar>().Initialize(this);

        OnHealthChanged(currentHealth, maxHealth);
    }