コード例 #1
0
        public override bool link(SimObject owner, AnatomyIdentifier parentAnatomy, ref String errorMessage)
        {
            SimObject targetSimObject = owner.getOtherSimObject(targetSimObjectName);

            if (targetSimObject == null)
            {
                errorMessage = String.Format("Could not find target SimObject {0}", targetSimObjectName);
                return(false);
            }
            transparencyInterface = targetSimObject.getElement(targetTransparencyInterfaceName) as TransparencyInterface;
            if (transparencyInterface == null)
            {
                errorMessage = String.Format("Could not find target TransparencyInterface '{0}' in '{1}'", targetTransparencyInterfaceName, targetSimObject.Name);
                return(false);
            }
            foreach (AnatomyCommand command in parentAnatomy.Commands)
            {
                if (command.UIText == TransparencyAnatomyCommand.UI_TEXT)
                {
                    transparencyAnatomyCommand = (TransparencyAnatomyCommand)command;
                    break;
                }
            }
            if (transparencyAnatomyCommand == null)
            {
                errorMessage = String.Format("Can not have a TransparencySectionAnatomyCommand on AnatomyIdentifier {0} because it has no TransparencyAnatomyCommand.", parentAnatomy.AnatomicalName);
                return(false);
            }
            transparencyAnatomyCommand.NumericValueChanged += transparencyAnatomyCommand_NumericValueChanged;
            transparencyAnatomyCommand.SmoothBlendApplied  += transparencyAnatomyCommand_SmoothBlendApplied;
            return(true);
        }
コード例 #2
0
        public void initialize(Skeleton skeleton, Fossa fossa, SimObject owner)
        {
            this.fossa = fossa;
            this.owner = owner;
            float current = boneStartOffset;

            for (int i = 1; skeleton.hasBone(boneBaseName + i); ++i)
            {
                Bone bone = skeleton.getBone(boneBaseName + i);
                bone.setManuallyControlled(true);
                bones.Add(new DiscBonePair(bone, current));
                current += boneDelta;
            }
            followSimObject = owner.getOtherSimObject(followSimObjectName);

            //if (boneBaseName == "RightEmenence")
            //{
            //    SceneNodeElement node = owner.getElement("Node") as SceneNodeElement;
            //    Entity entity = node.getNodeObject("Entity") as Entity;
            //    entity.setDisplaySkeleton(true);
            //}
        }