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)); }
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>(); }
void Start() { cl_AmmoBar = this; }
private void Awake() { singleton = this; }