コード例 #1
0
ファイル: Animation.cs プロジェクト: Taqmuraz/Humans2D
        private IEnumerator <IYieldInstruction> Play(HumanRenderer humanRenderer)
        {
            NextFrameWait wait      = new NextFrameWait();
            float         startTime = Time.time;

            for (int i = 0; i < frames.Length; i++)
            {
                frames[i].ApplyToSkeleton(humanRenderer.skeleton);

                wait.neededTime = startTime + frames[i].timeStartPercent * timeLength;
                yield return(wait);
            }
        }
コード例 #2
0
 public HumanSkeleton(HumanRenderer humanRenderer)
 {
     bones = new HumanBone[]
     {
         new HumanBone("Root", humanRenderer.root),
         new HumanBone("Body", humanRenderer.bodyBone),
         new HumanBone("Head", humanRenderer.headBone),
         new HumanBone("Neck", humanRenderer.neckBone),
         new HumanBone("HandL", humanRenderer.handLBone),
         new HumanBone("HandR", humanRenderer.handRBone),
         new HumanBone("LegL", humanRenderer.legLBone),
         new HumanBone("LegR", humanRenderer.legRBone),
         new HumanBone("KneeL", humanRenderer.kneeLBone),
         new HumanBone("ElbowL", humanRenderer.elbowLBone),
         new HumanBone("ElbowR", humanRenderer.elbowRBone),
         new HumanBone("KneeR", humanRenderer.kneeRBone)
     };
 }