46 lines
1.8 KiB
C#
46 lines
1.8 KiB
C#
using UnityEngine;
|
|
|
|
namespace Passer.CreatureControl {
|
|
|
|
// An insect target rig....
|
|
public class InsectRig : TargetRig {
|
|
public TargetLeg leftFrontLeg;
|
|
public TargetLeg leftMiddleLeg;
|
|
public TargetLeg leftBackLeg;
|
|
|
|
public TargetLeg rightFrontLeg;
|
|
public TargetLeg rightMiddleLeg;
|
|
public TargetLeg rightBackLeg;
|
|
|
|
public override void PoseLimbs() {
|
|
this.leftBackLeg.PoseLimb();
|
|
this.leftMiddleLeg.PoseLimb();
|
|
this.leftFrontLeg.PoseLimb();
|
|
this.rightBackLeg.PoseLimb();
|
|
this.rightMiddleLeg.PoseLimb();
|
|
this.rightFrontLeg.PoseLimb();
|
|
}
|
|
|
|
public override void MatchTo(Creature creature, ref bool anythingChanged) {
|
|
base.MatchTo(creature, ref anythingChanged);
|
|
if (creature is not Insect insect)
|
|
return;
|
|
|
|
if (this.leftFrontLeg != null && insect.leftFrontLeg != null)
|
|
this.leftFrontLeg.MatchTo(insect.leftFrontLeg);
|
|
if (this.leftMiddleLeg != null && insect.leftMiddleLeg != null)
|
|
this.leftMiddleLeg.MatchTo(insect.leftMiddleLeg);
|
|
if (this.leftBackLeg != null && insect.leftHindLeg != null)
|
|
this.leftBackLeg.MatchTo(insect.leftHindLeg);
|
|
|
|
if (this.rightFrontLeg != null && insect.rightFrontLeg != null)
|
|
this.rightFrontLeg.MatchTo(insect.rightFrontLeg);
|
|
if (this.rightMiddleLeg != null && insect.rightMiddleLeg != null)
|
|
this.rightMiddleLeg.MatchTo(insect.rightMiddleLeg);
|
|
if (this.rightBackLeg != null && insect.rightHindLeg != null)
|
|
this.rightBackLeg.MatchTo(insect.rightHindLeg);
|
|
}
|
|
|
|
}
|
|
|
|
} |