示例#1
0
    override protected void Awake()
    {
        base.Awake();

        if (physicalBullet)
        {
            bulletFunction = PhysicalBulletAttack;
        }
        else
        {
            bulletFunction = BulletAttack;
        }

        ammoText = GameObject.Find("--HUD/Ammo/ammoText").GetComponent <Text>();
        Display();
    }
示例#2
0
    //UNIVERSAL FUNCTIONS
    void Start() //INITIALIZATION
    {
        Health      = MaxHealth;
        publicStats = new pStats(Health, Armor);

        if (gameObject.CompareTag("Player"))
        {
            HealthBar = GameObject.Find("--HUD/Stats/healthBar").GetComponent <Image>();
            ArmorBar  = GameObject.Find("--HUD/Stats/armorBar").GetComponent <Image>();
            HealthBar.rectTransform.localScale = new Vector3((float)Health / 100, 1, 1);
            ArmorBar.rectTransform.localScale  = new Vector3((float)Armor / 100, 1, 1);
            kill = playerKill;
            updt = playerUpdate;
        }
        else
        {
            kill = aiKill;
            updt = aiUpdate;
        }
    }