public void Start()
 {
     if (!Driver)
     {
         Driver = GetComponentInParent <GridDriver>();
     }
     Rigidbody = GetComponentInParent <Rigidbody>();
 }
示例#2
0
 public static bool GetCellInfo(int rowHandle, GridColumn col, ref IExplorerObject explorerObject, ref PropertyDefinition propDef)
 {
     if (ExplorerApp.Application.ExplorerForm.ExplorerViewPanel.ExplorerControl is ItemMasterControl itemMasterControl)
     {
         var        mcBinder = new InternalBinder(itemMasterControl);
         var        prop     = mcBinder.GetField("m_itemsGridOptions");
         GridDriver gd       = prop as GridDriver;
         return(gd.GetCellInfo(rowHandle, col, ref explorerObject, ref propDef));
     }
     return(false);
 }
        public void Start()
        {
            Effect          = GetComponentInChildren <VisualEffect>();
            mMenu_thrusting = new TerminalMenu("Enabled",
                                               new ButtonTerminal(ForceThrust));
            var driver = GetComponentInParent <GridDriver>();

            if (driver)
            {
                Driver = driver;
            }
        }
示例#4
0
        protected override void VerifyLocation(GridLocation oldLocation, GridLocation newLocation)
        {
            if (oldLocation.Grid == newLocation.Grid)
            {
                return;
            }

            BlockGrid  grid   = newLocation.Grid;
            GridDriver driver = grid.GetComponent <GridDriver>();

            if (!driver)
            {
                driver      = grid.gameObject.AddComponent <GridDriver>();
                driver.Grid = grid;
            }
            Driver = driver;
        }
示例#5
0
        public void FixedUpdate()
        {
            Player     player = Player;
            GridDriver driver = Driver;

            if (player)
            {
                Inputs inputs = player.Inputs;
                if (inputs.scndary)
                {
                    OnExit();
                }
                else
                {
                    Quaternion chair = LocalChairRotation;
                    driver.Move = Quaternion.Inverse(chair) * inputs.move;
                    driver.Look = Quaternion.Inverse(chair) * inputs.look;

                    SetPlayerPosRot(player);
                }
            }
        }