Наследование: MonoBehaviour
Пример #1
0
 void Awake()
 {
     gunParticles = GetComponent <ParticleSystem>();
     gunLine      = GetComponent <LineRenderer>();
     gunAnim      = transform.parent.GetComponent <GunAnimation>();
     gunSound     = GetComponent <GunSound>();
 }
Пример #2
0
 private void Start()
 {
     animAction = GetComponent <EnemyAnimation>();
     motor      = GetComponent <EnemyMotor>();
     gun        = GetComponent <Gun>();
     gunAnim    = GetComponent <GunAnimation>();
 }
Пример #3
0
 //为子类提供重写Start方法的机会
 protected virtual void Start()
 {
     ammoUi = GameObject.Find("ammo").GetComponentInChildren <Text>();
     // print("Gun-Start");
     anim        = GetComponent <GunAnimation>();
     muzzleFlash = GetComponentInChildren <MuzzleFlash>();
     audioSource = GetComponent <AudioSource>();
 }
Пример #4
0
 public void Awake()
 {
     gun       = GetComponent <Gun>();
     animation = GetComponent <GunAnimation>();
 }
Пример #5
0
 //为子类提供重写的机会
 protected virtual void Stark()
 {
     anim = GetComponent <GunAnimation>();
 }
Пример #6
0
 public void Start()
 {
     animation = GetComponent <GunAnimation>();
 }
Пример #7
0
 private void Start()
 {
     source = GetComponent <AudioSource>();
     anim   = GetComponent <GunAnimation>();
     flash  = firePoint.GetComponent <MuzzleFlash>();
 }