void StartAbilityUsedTransition(GunAbility calledFrom) { switch (calledFrom) { case GunAbility.RESET_WITH_SAVE_1: ability1Transition.SetTrigger("AbilityUsed"); break; case GunAbility.RESET_WITHOUT_SAVE_2: ability2Transition.SetTrigger("AbilityUsed"); break; case GunAbility.RESET_AND_DELETE_PREV_3: ability3Transition.SetTrigger("AbilityUsed"); break; case GunAbility.HARD_RESET_4: ability4Transition.SetTrigger("AbilityUsed"); break; default: Debug.LogError("Unexpected default state reached!"); break; } lastGunAbilityUsed = calledFrom; }
/** * used to initialise new gun prefabs created within the gun creator tool */ public void InitializeGun(GunData gunData, GunAbility ability) { fireComponent = GetComponent <GunFireComponent>(); reloadComponent = GetComponent <GunReloadComponent>(); this.gunData = gunData; if (ability == null) { return; } this.ability = ability; }
void GunBehaviourSettings() { isHitscan = EditorGUILayout.Toggle("Hitscan?", isHitscan); if (hasAbility = EditorGUILayout.Toggle("Has Gun Ability?", hasAbility)) { EditorGUILayout.LabelField("Ability:"); selectedAbility = EditorGUILayout.ObjectField(selectedAbility, typeof(GunAbility), false) as GunAbility; } else { selectedAbility = null; } }