Topic: [Tutorial] Mirror Particles
If you have particles that require mirroring when on 2P side, here's how to do it.
Because particle game objects themselves might not behave right when you try to rotate them, it's recommended your particle prefab has the parent most game object as an empty (put your particle inside an empty, basically). Have the particle child rotated as if triggered from 1P side and it should work fine.
Open MoveSetScript.cs, and inside:
public class ParticleInfo:ICloneable {
add:
public bool mirrorOn2PSide;
------
Then in ControlsScript.cs, look for:
// Check Particle Effects
foreach (MoveParticleEffect particleEffect in move.particleEffects){
and inside this after the line where pTemp is declared, add:
if (particleEffect.particleEffect.mirrorOn2PSide && mirror > 0) {
pTemp.transform.localEulerAngles = new Vector3(pTemp.transform.localEulerAngles.x, pTemp.transform.localEulerAngles.y + 180, pTemp.transform.localEulerAngles.z);
}
*NOTE* If you have also added the XWeaponTrail mod, you should put this into the else half of the if statement (if (particleEffect.particleEffect.isWeaponTrail) {), just after the pTemp = Instantiate() bit.
------
Finally in MoveEditorWindow.cs, look for:
moveInfo.particleEffects[i].particleEffect.prefab = (GameObject) EditorGUILayout.ObjectField("Particle Effect:", moveInfo.particleEffects[i].particleEffect.prefab, typeof(UnityEngine.GameObject), true);
and above, add:
moveInfo.particleEffects[i].particleEffect.mirrorOn2PSide = EditorGUILayout.Toggle("Mirror on Right Side:", moveInfo.particleEffects[i].particleEffect.mirrorOn2PSide, toggleStyle);
*NOTE* If you have also added the XWeaponTrail mod, you should put this into the else half of the statement, literally just after:
} else {