private void Awake() { rgdb2d = GetComponent <Rigidbody2D>(); character = GetComponent <CharacterController2D>(); toolbarController = GetComponent <ToolbarController>(); animator = GetComponent <Animator>(); }
private void PrepareToolbar() { var tc = new ToolbarController(new RootViewController()); tc.Toolbar.Title = "Transitioned"; tc.Toolbar.Detail = "View Controller"; }
public ToolbarTests() { TestToolbarView test_toolbar_view = new TestToolbarView(); // Setup Toolbar Controller toolbar_controller_m = new ToolbarController(); toolbar_controller_m.AddView(test_toolbar_view); }
public void OnClicked(int id) { ToolbarController controller = GameObject.FindGameObjectWithTag("Toolbar").GetComponent <ToolbarController>(); if (controller != null) { ToolbarController.ToolbarState state = id == 0 ? ToolbarController.ToolbarState.BUILDING : ToolbarController.ToolbarState.UNIT; controller.SetDisplayState(state); changeImageBackgounds(id); } }
private void Awake() { // Create a singleton if (Instance == null) { Instance = this; } else { Destroy(this.gameObject); } }
public override void OnCreated() { base.OnCreated(); toolbarController = GameObject.FindGameObjectWithTag("Toolbar").GetComponent <ToolbarController>(); PlayerDataEnvironment.PlayerEnvironment pEnv = PlayerDataEnvironment.GetPlayerEnvironment(GetPlayer()); foreach (BaseUnit unit in spawnableUnits) { pEnv.GetBuildableObjects().AddObject(GetPlayer(), unit, this); } }
// Start is called before the first frame update void Start() { character = GetComponent <PlayerControl>(); rgbd2d = GetComponent <Rigidbody2D>(); fields = new Dictionary <Vector2Int, TileData>(); crops = new Dictionary <Vector2Int, CropData>(); toolbarController = GetComponent <ToolbarController>(); inventoryController = GetComponent <InventoryController>(); var shopPanelAll = Resources.FindObjectsOfTypeAll <UI_ShopController>(); shopPanel = shopPanelAll[0]; }
public ToolBarHandler() { Control = new UIToolbar(); Control.AutoresizingMask = UIViewAutoresizing.FlexibleWidth; Control.BarStyle = UIBarStyle.Default; if (!Platform.IsIpad) { Dock = ToolBarDock.Bottom; } Controller = new ToolbarController { Handler = this, View = Control }; }
public static void UpdateVisibleTools() { if (Singleton == null) { return; } var tool = ToolbarController.GetCurrentTool(); var selectTool = SelectToolOptionsController.GetCurrentTool(); Singleton.translateParent.SetActive(tool == Tool.Select && selectTool == SelectToolOptionsController.SelectTool.Translate && CubeSelectionController.GetAllCubes().Length > 0); Singleton.rotateParent.SetActive(tool == Tool.Select && selectTool == SelectToolOptionsController.SelectTool.Rotate && CubeSelectionController.GetAllCubes().Length > 0); Singleton.scaleParent.SetActive(tool == Tool.Select && selectTool == SelectToolOptionsController.SelectTool.Scale && CubeSelectionController.GetAllCubes().Length > 0); }
public StartingState(ToolbarController toolbar_controller_p) { ToolbarController_m = toolbar_controller_p; // Test ToolbarViewModel ToolbarViewModel toolbar_view_model = new ToolbarViewModel(); toolbar_view_model.Title = "Testing Title"; toolbar_view_model.Background_Color = Brushes.Blue; toolbar_view_model.Font_Color = Brushes.White; toolbar_view_model.Naigation_btn = toolbar_view_model.BuildImageButton("../images/HamburgerMenuWhite.png", NavigationBtn_Click); ToolbarController_m.UpdateViews(toolbar_view_model); }
void Start() { toolbarController = GameObject.FindGameObjectWithTag("Toolbar").GetComponent <ToolbarController>(); Player player = PlayerManager.humanPlayer; PlayerDataEnvironment.PlayerEnvironment pEnv = PlayerDataEnvironment.GetPlayerEnvironment(player); foreach (BaseBuilding building in spawnableBuildings) { pEnv.GetBuildableObjects().AddObject(player, building, this); } m_Started = true; }
public MainWindow() { InitializeComponent(); // Setup Toolbar Controller toolbar_controller_m = new ToolbarController(); toolbar_controller_m.AddView(MainToolbar); ApplicationContext app_context = new ApplicationContext(new StartingState(toolbar_controller_m)); // Add Item Modifer Buttons //tool_bar_view_model.ItemModifers.Add(tool_bar_view_model.BuildImageButton("../images/DeleteWhite.png", DeleteBtn_Click)); //tool_bar_view_model.ItemModifers.Add(tool_bar_view_model.BuildImageButton("../images/EditWhite.png", EditBtn_Click)); }
public MainWindow() { InitializeComponent(); // Setup Toolbar Controller toolbar_controller_m = new ToolbarController(); toolbar_controller_m.AddView(MainToolbar); // Test ToolbarViewModel ToolbarViewModel toolbar_view_model = new ToolbarViewModel(); toolbar_view_model.Title = "Testing Title"; toolbar_view_model.Background_Color = Brushes.Blue; toolbar_view_model.Font_Color = Brushes.White; toolbar_view_model.Naigation_btn = toolbar_view_model.BuildImageButton("../images/HamburgerMenuWhite.png", NavigationBtn_Click); toolbar_controller_m.UpdateViews(toolbar_view_model); // Add Item Modifer Buttons //tool_bar_view_model.ItemModifers.Add(tool_bar_view_model.BuildImageButton("../images/DeleteWhite.png", DeleteBtn_Click)); //tool_bar_view_model.ItemModifers.Add(tool_bar_view_model.BuildImageButton("../images/EditWhite.png", EditBtn_Click)); }
private void Start() { // Looking for the crop item in the game foreach (SeedSlot itemSlot in GameManager.instance.allSeedsContainer.slots) { if (itemSlot.item.Name == "corn") { corn = itemSlot.item; } else if (itemSlot.item.Name == "parsley") { parsley = itemSlot.item; } else if (itemSlot.item.Name == "potato") { potato = itemSlot.item; } else if (itemSlot.item.Name == "strawberry") { strawberry = itemSlot.item; } else if (itemSlot.item.Name == "tomato") { tomato = itemSlot.item; } } fields = ToolsCharacterController.fields; crops = new Dictionary <Vector3Int, Crop>(); corns = new Dictionary <Vector3Int, Crop>(); parsleys = new Dictionary <Vector3Int, Crop>(); potatoes = new Dictionary <Vector3Int, Crop>(); strawberries = new Dictionary <Vector3Int, Crop>(); tomatoes = new Dictionary <Vector3Int, Crop>(); toolbarController = GetComponent <ToolbarController>(); }
public override void Hit() { toolbar = GameObject.FindWithTag("toolbar"); toolbarController = GetComponent <ToolbarController>(); switch (toolbarController.GetItem.Name) { case "Food_Corn": Debug.Log("Zjadłeś kukurydze"); AddHunger(20); break; case "Food_Parsley": Debug.Log("Zjadłeś pietruszkę"); AddHealth(5); AddHunger(10); break; case "Food_Potato": Debug.Log("Zjadłeś ziemniaka"); AddHealth(5); AddHunger(40); break; case "Food_Strawberry": Debug.Log("Zjadłeś truskawkę"); AddHealth(30); AddHunger(10); break; case "Food_Tomato": Debug.Log("Zjadłeś pomidora"); AddHunger(30); break; } GameManager.instance.inventoryContainer.RemoveItem(GameManager.instance.toolbarControllerGlobal.GetItem, 1); toolbar.SetActive(!toolbar.activeInHierarchy); toolbar.SetActive(true); }
public StartingState(ToolbarController toolbar_controller_p, WorkspaceController workspace_controller_p) { ToolbarController_m = toolbar_controller_p; WorkspaceController_m = workspace_controller_p; }
public AddTransactionState(ToolbarController toolbar_controller_p, WorkspaceController workspace_controller_p) { ToolbarController_m = toolbar_controller_p; WorkspaceController_m = workspace_controller_p; }
private void Awake() { character = GetComponent <PlayerMovement>(); rgdb2d = GetComponent <Rigidbody2D>(); toolbarController = GetComponent <ToolbarController>(); }