示例#1
0
        public override IEnumerable <Command> CompGetGizmosExtra()
        {
            foreach (var compCom in base.CompGetGizmosExtra())
            {
                yield return(compCom);
            }

            Command_Action com = new Command_Action();

            if (IsMounted)
            {
                com.defaultLabel = txtCommandDismountLabel.Translate();
                com.defaultDesc  = txtCommandDismountDesc.Translate();
                com.icon         = ContentFinder <Texture2D> .Get("UI/Commands/IconUnmount");

                com.activateSound = SoundDef.Named("Click");
                com.action        = () => { this.Dismount(); };

                yield return(com);
            }
            else
            {
                Designator_Mount designator = new Designator_Mount();

                designator.vehicle      = parent;
                designator.defaultLabel = txtCommandMountLabel.Translate();
                designator.defaultDesc  = txtCommandMountDesc.Translate();
                designator.icon         = ContentFinder <Texture2D> .Get("UI/Commands/IconMount");

                designator.activateSound = SoundDef.Named("Click");

                yield return(designator);
            }
        }
示例#2
0
        public override IEnumerable<Command> CompGetGizmosExtra()
        {
            foreach (var compCom in base.CompGetGizmosExtra())
                yield return compCom;

            Command_Action com = new Command_Action();

            if (IsMounted)
            {
                com.defaultLabel = txtCommandDismountLabel.Translate();
                com.defaultDesc = txtCommandDismountDesc.Translate();
                com.icon = ContentFinder<Texture2D>.Get("UI/Commands/IconUnmount");
                com.activateSound = SoundDef.Named("Click");
                com.action = () => { this.Dismount(); };

                yield return com;
            }
            else
            {
                Designator_Mount designator = new Designator_Mount();

                designator.vehicle = parent;
                designator.defaultLabel = txtCommandMountLabel.Translate();
                designator.defaultDesc = txtCommandMountDesc.Translate();
                designator.icon = ContentFinder<Texture2D>.Get("UI/Commands/IconMount");
                designator.activateSound = SoundDef.Named("Click");

                yield return designator;
            }
        }