public Weapon CreatWeapon(Type weaponType) { WeaponShareAttribute attribute = FactoryManger.AttributeFactory.GetWeaponShareAttribute(weaponType); GameObject go = FactoryManger.AssetFactory.LoadWeapon(weaponType.ToString()); return(Activator.CreateInstance(weaponType, attribute, go) as Weapon); }
protected Weapon(WeaponShareAttribute attribute, GameObject gameObject) { Attribute = attribute; _GameObject = gameObject; Transform effect = gameObject.transform.Find("Effect"); ParticleSystem = effect.GetComponent <ParticleSystem>(); LineRenderer = effect.GetComponent <LineRenderer>(); AudioSource = effect.GetComponent <AudioSource>(); Light = effect.GetComponent <Light>(); }
public WeaponRocket(WeaponShareAttribute attribute, GameObject gameObject) : base(attribute, gameObject) { }