void Setup_ShooterMeleeInput(GameObject prefab) { if (prefab.GetComponent <vShooterMeleeInput>() || prefab.GetComponent <PUN_ShooterMeleeInput>()) { vShooterMeleeInput org = prefab.GetComponent <vShooterMeleeInput>(); if (!prefab.GetComponent <PUN_ShooterMeleeInput>()) { prefab.AddComponent <PUN_ShooterMeleeInput>(); PUN_ShooterMeleeInput newComp = prefab.GetComponent <PUN_ShooterMeleeInput>(); PUN_Helpers.CopyComponentTo(org, newComp); } prefab.GetComponent <PUN_ShooterMeleeInput>().enabled = false; } }
protected override void Start() { base.Start(); shooterMelee = this.tpInput as vShooterMeleeInput; }