예제 #1
0
    void CreateAmmoBar()
    {
        Player t_player = PlayerManager.m_Instance.m_Player;

        m_ammobar = Instantiate(AssetManager.m_Instance.GetPrefab("AmmoBar")).GetComponent <AmmoBar>();

        m_ammobar.AttachTo(t_player.gameObject);
        m_ammobar.Resize(new Vector2(1, 1.1f));
    }
예제 #2
0
    private SpriteRenderer sprite; //для доступа к св-ву flip: инверсия спрайтов

    // Use this for initialization
    private void Awake()
    {
        //получим ссылки на компоненты
        rigidbody = GetComponent <Rigidbody2D>();
        animator  = GetComponent <Animator>();
        sprite    = GetComponentInChildren <SpriteRenderer>();
        bullet    = Resources.Load <Bullet>("Bullet"); //from dir Resources load type Bullet and same name
        lb        = FindObjectOfType <LivesBar>();
        ab        = FindObjectOfType <AmmoBar>();
        sb        = FindObjectOfType <StarsBar>();
    }
예제 #3
0
 void Start()
 {
     cl_AmmoBar = this;
 }
예제 #4
0
 private void Awake()
 {
     singleton = this;
 }