// Start is called before the first frame update void Awake() { rb = GetComponent <Rigidbody2D>(); sr = GetComponent <SpriteRenderer>(); anim = GetComponent <Animator>(); bc = GetComponent <BoxCollider2D>(); controlsManager = FindObjectOfType <ControlsManager>(); //get all colliders attached to player hitboxes = new List <Collider2D>(GetComponentsInChildren <BoxCollider2D>()); //get the hitboxes List <Collider2D> acceptableColliders = new List <Collider2D>(); foreach (BoxCollider2D bc in hitboxes) { if (bc.gameObject.CompareTag("HitBox")) { acceptableColliders.Add(bc); } } hitboxes = acceptableColliders; //get the other player GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); Debug.Log(players.Length); foreach (GameObject player in players) { //if their player ids dont match then it is the other player if (PlayerID != player.GetComponent <PlayerControls>().PlayerID) { otherPlayer = player; } } }
void GrabControls() { if (!ActivityManager.Instance) { return; } //Store the controls manager ControlsManager mgr = ActivityManager.Instance.HUDController; if (mgr) { loadedControls = ActivityManager.Instance.HUDController.LoadedControls; } if (loadedControls) { //When we grab... hide all the controls... loadedControls.Shoot.gameObject.SetActive(false); loadedControls.Shield.gameObject.SetActive(false); loadedControls.Overheat.gameObject.SetActive(false); } //Take the hud off when we grab. ActivityManager.Instance.ToggleHud(false); }
private void Init() { ChangeFormDimensions(); CountryCMB.SelectedIndex = 0; IsInitialized = true; DoubleBuffered = true; CurrentActiveYear = Config.LastYear; GraphicsPB.Left = 0; GraphicsPB.Height = 960; GraphsPanel.Controls.Add(GraphicsPB); FetchedClubs = FetchedClubs ?? new List <ClubHistory>(); SelectedClubs = SelectedClubs ?? new Dictionary <int, ClubHistory>(); TableMarkup.Initialize(GraphicsPB); ControlsManager.Initialize(YearsLbl, YearsLbl2); CriteriaCMB.SelectedIndex = 0; for (var i = Config.FirstYear; i <= Config.LastYear; i++) { SeasonYearCMB.Items.Add(" Season " + (i - 1) + " / " + i); } }
public void OnUngrab(GameObject go) { if (whileHeldOnly) { ControlsManager.RemoveControl(go.name.Contains("Left") ? (ControlName)((int)controlButton - 1) : controlButton, this); } }
// Use this for initialization void Start() { unitManager = GameObject.Find("UnitManager").GetComponent <UnitManager>(); controlsManager = GameObject.Find("ControlsManager").GetComponent <ControlsManager>(); map = new MapTile[mapWidth, mapHeight]; MapSetup(); }
private void Awake() { DontDestroyOnLoad(this); Instance = this; KeyCode KeyForward; KeyCode KeyBackward; KeyCode KeyLeft; KeyCode KeyRight; KeyCode KeyJump; KeyCode KeySneak; KeyCode KeySprint; KeyCode KeyBlockBreak; KeyCode KeyBlockPlace; int RenderDistance; int Fov; Enum.TryParse(PlayerPrefs.GetString("KeyForward", "W"), out KeyForward); Enum.TryParse(PlayerPrefs.GetString("KeyBackward", "S"), out KeyBackward); Enum.TryParse(PlayerPrefs.GetString("KeyLeft", "A"), out KeyLeft); Enum.TryParse(PlayerPrefs.GetString("KeyRight", "D"), out KeyRight); Enum.TryParse(PlayerPrefs.GetString("KeyJump", "Space"), out KeyJump); Enum.TryParse(PlayerPrefs.GetString("KeySneak", "LeftShift"), out KeySneak); Enum.TryParse(PlayerPrefs.GetString("KeySprint", "LeftControl"), out KeySprint); Enum.TryParse(PlayerPrefs.GetString("KeyBlockBreak", "Mouse0"), out KeyBlockBreak); Enum.TryParse(PlayerPrefs.GetString("KeyBlockPlace", "Mouse1"), out KeyBlockPlace); RenderDistance = PlayerPrefs.GetInt("RenderDistance", 10); Fov = PlayerPrefs.GetInt("Fov", 60); settings = new Settings(KeyForward, KeyBackward, KeyLeft, KeyRight, KeyJump, KeySneak, KeySprint, KeyBlockBreak, KeyBlockPlace, RenderDistance, Fov); }
public CommonForm() { fComponents = new Container(); fToolTip = new ToolTip(this.fComponents); fControlsManager = new ControlsManager(); }
private void Start() { this.characterMotor = this.GetComponent <CharacterMotor>(); this.controlsManager = (ControlsManager)Object.FindObjectOfType(typeof(ControlsManager)); this.controlsManager.moveForward.stateChanged += delegate(float amount) { this.characterMotor.MoveZ(amount); }; this.controlsManager.moveBackward.stateChanged += delegate(float amount) { this.characterMotor.MoveZ(-amount); }; this.controlsManager.moveRight.stateChanged += delegate(float amount) { this.characterMotor.MoveX(amount); }; this.controlsManager.moveLeft.stateChanged += delegate(float amount) { this.characterMotor.MoveX(-amount); }; this.controlsManager.speedUp.stateChanged += delegate(float amount) { this.characterMotor.SpeedUp(amount); }; this.controlsManager.turn.stateChanged += delegate(float amount) { this.characterMotor.Turn(amount); }; this.controlsManager.look.stateChanged += delegate(float amount) { this.characterMotor.Look(amount); }; this.controlsManager.jump.stateChanged += delegate(float amount) { this.characterMotor.Jump(amount); }; this.controlsManager.sit.stateChanged += delegate(float amount) { this.characterMotor.Sit(); }; this.controlsManager.stand.stateChanged += delegate(float amount) { this.characterMotor.Stand(); }; this.controlsManager.pickItem.stateChanged += delegate(float amount) { this.Pick(); }; this.controlsManager.throwItem.stateChanged += delegate(float amount) { this.Throw(); }; this.controlsManager.useItem.stateChanged += delegate(float amount) { this.UseItem(); }; this.controlsManager.useItemAlternatively.stateChanged += delegate(float amount) { this.UseItemAlternatively(); }; this.controlsManager.switchItem.stateChanged += delegate(float amount) { if (amount > 0) { this.NextItem(); } if (amount < 0) { this.PreviousItem(); } }; this.controlsManager.switchUsageMode.stateChanged += delegate(float amount) { this.SwitchUsageMode(); }; this.controlsManager.switchItemMode.stateChanged += delegate(float amount) { this.SwitchItemMode(); }; }
// Use this for initialization void Start() { car = FindObjectOfType <CarController2>(); arduino = FindObjectOfType <ArduinoConnectorScriptCar2>(); rb = GetComponent <Rigidbody>(); controlsManager = FindObjectOfType <ControlsManager>(); }
public bool RefineMentTest(int halfedge) { ExtrudableMesh _extrudableMesh = modellingObject.GetComponentInChildren <ExtrudableMesh>(); Manifold manifold = _extrudableMesh._manifold; if (manifold.IsHalfedgeInUse(halfedge)) { int h2 = manifold.GetNextHalfEdge(halfedge); h2 = manifold.GetNextHalfEdge(h2); if (manifold.IsHalfedgeInUse(h2)) { int v1 = _extrudableMesh._manifold.SplitEdge(halfedge); int v2 = _extrudableMesh._manifold.SplitEdge(h2); int output = _extrudableMesh._manifold.SplitFaceByEdges(manifold.GetIncidentFace(halfedge), v1, v2); _extrudableMesh.UpdateMesh(); ControlsManager man = modellingObject.GetComponentInChildren <Controls.ControlsManager>(); man.UpdateControls(); return(true); } } return(false); }
private void Awake() { if (CM == null) { DontDestroyOnLoad(gameObject); CM = this; } else if (CM != null) { Destroy(gameObject); } /*Assign each keycode when the game starts. * Loads data from PlayerPrefs so if a user quits the game, * their bindings are loaded next time. Default values * are assigned to each Keycode via the second parameter * of the GetString() function */ up = (KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("upKey", "W")); down = (KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("downKey", "S")); left = (KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("leftKey", "A")); right = (KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("rightKey", "D")); interact = (KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("interactKey", "Space")); }
void Awake() { LevelIndex = Application.loadedLevel; instance = this; if (controlsManager == null) { GameObject newCM = new GameObject("Control_Manager"); controlsManager = newCM.AddComponent<ControlsManager>(); newCM.transform.SetParent(this.transform); } // GET THE SCORE MANAGER // if (scoreManager == null) { GameObject newScM = new GameObject("Score_Manager"); scoreManager = newScM.AddComponent<ScoreManager>(); newScM.transform.SetParent(this.transform); } // LETS SETUP A SCENE // if (sceneManager == null) { GameObject newSM = new GameObject("Scene_Manager"); sceneManager = newSM.AddComponent<SceneManager>(); newSM.transform.SetParent(this.transform); } // link the debugger // GameObject dbg = GameObject.Find ("Debugger"); debugger = dbg.GetComponent<Debugger> (); }
// Use this for initialization void Start() { initialScale = transform.localScale.x; _controlsManager = FindObjectOfType <ControlsManager>(); _controlsManager.globalScaleChange += ControlsManagerOnGlobalScaleChange; ControlsManagerOnGlobalScaleChange(_controlsManager.globalScale); }
// Use this for initialization void Start() { this.state = this.GetComponent<ItemState>(); this.gameManager = GameManager.GetMainGame().GetComponent<GameManager>(); this.controls = gameManager.GetComponent<ControlsManager>(); this.state.ReferenceName = Constants.Items.Hammer; }
void SetActiveProfile(int _index) { if (controlMan == null) { controlMan = FindObjectOfType <ControlsManager>(); } controlMan.SetActiveProfile(GetNameFromProfileDropdown()); }
public void OnGrab(GameObject go) { Debug.Log("Grab " + transform.name + ", " + actions.GetPersistentTarget(0)); if (whileHeldOnly) { ControlsManager.AddControl(go.name.Contains("Left") ? (ControlName)((int)controlButton - 1) : controlButton, this); } }
void Awake() { if (CM == null) { CM = this; } controls = controlGameObject.GetComponent <Controls>(); }
// Use this for initialization void Start() { this.initiativePanel = GameObject.Find("InitiativePanel"); mapManager = GameObject.Find("MapManager").GetComponent <MapManager>(); controlsManager = GameObject.Find("ControlsManager").GetComponent <ControlsManager>(); CreateUnit(3, 3); //CreateUnit (1, 1); }
void Awake() { _interactableObjects = new List <IInteractableObject>(); controls = FindObjectOfType <ControlsManager>(); controllerSphereCollider = transform.childCount > 0 ? transform.GetChild(0).GetComponent <SphereCollider>() : GetComponent <SphereCollider>(); _meshRenderer = GetComponent <MeshRenderer>(); defaultColor = _meshRenderer.material.color; }
public CommonDialog() : base() { Maximizable = false; Minimizable = false; Resizable = false; ShowInTaskbar = false; fControlsManager = new ControlsManager(); }
void Start() { this.game = GameManager.GetMainGame(); this.controls = game.GetComponent <ControlsManager>(); this.inventory = game.GetComponent <GameInventory>(); this.render = this.GetComponent <ItemRender>(); this.itemCountManager = this.GetComponent <ItemCount>(); }
private void Awake() { /// Persist managers between scenes DontDestroyOnLoad(gameObject); Controls = GetComponent <ControlsManager>(); Controls.Startup(); }
void SetActiveProfile(string _name) { if (controlMan == null) { controlMan = FindObjectOfType <ControlsManager>(); } controlMan.SetActiveProfile(_name); }
// Use this for initialization private void Start() { _controlsManager = GameObject.Find("GameManager").GetComponent <ControlsManager>(); _boardManager = GameObject.Find("GameManager").GetComponent <BoardManager>(); _thisCollider = GetComponent <Collider2D>(); _thisCollider.enabled = true; _spriteRenderer = GetComponent <SpriteRenderer>(); _spriteRenderer.enabled = false; }
IEnumerator AddListenerAfterFrame() { yield return(null); if (!whileHeldOnly) { ControlsManager.AddControl(controlButton, this); } }
private void Awake() { instance = this; inputActions = new ControlsManager(); //When the input for rotating the camera is detected //Call function Rotate90deg() inputActions.Controls.RotateCamera.performed += context => Rotate90deg(context.ReadValue <float>()); }
public DataPanel() { BackColor = SystemColors.Control; BorderStyle = BorderStyle.FixedSingle; Dock = DockStyle.Fill; fActions = new List <UserAction>(); fControlsManager = new ControlsManager(); }
void Start() { if (instance != null) { Debug.LogError("Error: Cannot have two ControlsManager"); } instance = this; }
protected override void Initialize() { controlsManager = GetComponent <ControlsManager>(); physics = GetComponent <EntityMovePhysics>(); if (bulletSpeed <= 0) { bulletSpeed = DEFAULT_PLAYER_BULLET_SPEED; } health = GameData.Singleton.GameOptionData.Health; }
private void Start() { this.controlsManager = (ControlsManager)Object.FindObjectOfType(typeof(ControlsManager)); this.rigidbody.useGravity = false; this.rigidbody.freezeRotation = true; this.rigidbody.sleepVelocity = 0.1f; this.eyes = this.GetComponent <Character>().eyes; this.rotationVertical = this.eyes.transform.rotation.x; this.distanceToGround = collider.bounds.extents.y; }
protected override void Start() { base.Start(); var renderer = this.GetComponent <SpriteRenderer>(); this.HasFinished = true; this.Started = true; this.controls = gameManager.GetComponent <ControlsManager>(); this.initialSize = this.RectTransform.sizeDelta; }
void Awake() { controlsManager = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<ControlsManager>(); objectsToShowOnGameOver = GameObject.FindGameObjectsWithTag(Tags.gameOverObject); setObjectsToShowOnGameOver(false); objectsToShowOnGameWin = GameObject.FindGameObjectsWithTag(Tags.gameWinObject); setObjectsToShowOnGameWin(false); charactersOnMissionList = GameObject.FindGameObjectWithTag(Tags.charactersOnMissionList).GetComponent<CharactersOnMissionList>(); availableCharactersList = GameObject.FindGameObjectWithTag(Tags.availableCharactersList).GetComponent<AvailableCharactersList>(); charactersManager = GetComponent<CharactersManager>(); }
void Awake() { instance = this; }
void Awake() { charactersManager = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<CharactersManager>(); GameObject[] buttons = GameObject.FindGameObjectsWithTag(Tags.characterSelectButton); characterSelectButtons = new CharacterSelectButton[buttons.Length]; for(int i=0; i<buttons.Length; i++){ characterSelectButtons[i] = buttons[i].GetComponent<CharacterSelectButton>(); } if(charactersManager.getAllButtons() == null){ charactersManager.setAllButtons(characterSelectButtons); } controlsManager = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<ControlsManager>(); button = GetComponent<Button>(); }
void Awake() { controlsManager = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<ControlsManager>(); }