protected override void Awake() { //_health.Initialize(_InitHealth, _InitHealth); if (_instacne == null) { base.Awake(); _instacne = this; DontDestroyOnLoad(gameObject); _currnetHP = 80; _Renderer = transform.GetChild(1).GetComponent <SpriteRenderer>(); _health.Initialize(_currnetHP, _currnetHP); _Rigidbody = gameObject.GetComponent <Rigidbody2D>(); _DashEffect = transform.GetChild(5).GetComponent <ParticleSystem>(); _MoveSpeed = 5.0f; _Critical = 20; _CriticalDamage = 50; _JumpPower = 6; _WeaPon = transform.GetChild(3).GetChild(1).GetComponent <cWeaPon>(); _Buff = transform.GetChild(6).GetComponent <Animator>(); _Clip.Add(Resources.Load <AudioClip>("Sound/Jumping")); _Clip.Add(Resources.Load <AudioClip>("Sound/Hit_Player")); _Clip.Add(Resources.Load <AudioClip>("Sound/ui-sound-13-dash")); _WeaPonRenderer = _WeaPon.GetComponent <SpriteRenderer>(); } else if (_instacne != null) { Destroy(this.gameObject); } }
private void Awake() { _Panel.gameObject.SetActive(false); _SellSound = GetComponent <AudioSource>(); _SellClip = Resources.Load <AudioClip>("Sound/coin2"); _Weapon = FindObjectOfType <cWeaPon>(); }
private void Awake() { _Panel.gameObject.SetActive(false); _EmptyItem = Resources.Load("Prefabs/Inventory/EmptyItem") as GameObject; _SellSound = GetComponent <AudioSource>(); _SellClip = Resources.Load <AudioClip>("Sound/coin2"); _Weapon = FindObjectOfType <cWeaPon>(); }
private void Start() { _WeaPon = transform.GetChild(1).GetComponent <cWeaPon>(); }