private void Awake() { platformer = GetComponent <Platformer2D>(); animations = GetComponent <PlayerAnimations>(); flashlight = GetComponent <FlashlightController>(); }
private void Start() { Instance = this; _controllersGameObject = new GameObject { name = "Controllers" }; _inputController = _controllersGameObject.AddComponent <InputController>(); _flashlightController = _controllersGameObject.AddComponent <FlashlightController>(); _weaponsController = _controllersGameObject.AddComponent <WeaponsController>(); _objectManager = GetComponent <ObjectManager>(); }
private void Awake() { Instance = this; Player = GameObject.FindGameObjectWithTag("Player").transform; InputController = new InputController(); FlashlightController = new FlashlightController(); WeaponController = new WeaponController(); ObjectManager = new ObjectManager(); _updates.AddRange(new IUpdate[] { InputController, FlashlightController, WeaponController }); }
// Use this for initialization void Start() { inventory = new GameObject[] { emptyItem, flashlightItem, batonItem, powerItem }; currentItem = 0; flashlightController = flashlightItem.GetComponent <FlashlightController>(); flashlightController.SetFlashlight(false); powerController = powerItem.GetComponent <TimeChangeController>(); batonController = batonItem.GetComponent <BatonController>(); emptyController = emptyItem.GetComponent <EmptyHandController>(); SetCurrentItem(inventory[currentItem]); }
private void Awake() { otherMenus.Add(FindObjectOfType <PauseMenu>().gameObject); PickupMenu[] pickupMenus = FindObjectsOfType <PickupMenu>(); foreach (PickupMenu menu in pickupMenus) { if (menu != this) { otherMenus.Add(menu.gameObject); } } pauseMenu = GetComponentInChildren <Canvas>().gameObject; controller = FindObjectOfType <FlashlightController>(); movement = FindObjectOfType <PlayerMovement>(); pauseMenu.SetActive(false); }
//----------------------------------------------------------------------------BEGIN FUNCTIONS--------------------------------------------------------------------------------------// //run on game load (before start) void Awake() { CharacterController = GetComponent("CharacterController") as CharacterController; Instance = this; //grab Camera's anchor point, the Head cameraAnchorPoint = HelperK.FindSearchAllChildren(this.transform, "AnchorPointHead"); //grab the Camera focus point, (ie what we are aiming at), and the laserStartPoint for our weapon cameraFocusPoint = GameObject.Find("Camera Focus Point"); laserStartPoint = GameObject.Find("LaserStartPoint"); //grab the player models for 1st / 3rd person //TODO: Update this to work within all player model status, check model for Player Instance. For now its just testing code firstPersonModel = HelperK.FindSearchAllChildren(this.transform, "FatiguesMaleBody"); thirdPersonModel = HelperK.FindSearchAllChildren(this.transform, "Kaiden"); changeCameraState(); //grab the flashlight flashlight = HelperK.FindSearchAllChildren(this.transform.parent.transform, "FlashLight").GetComponent <FlashlightController>(); }
private new void Awake() { base.Awake(); m_movementController.InitializeCharacterController(45f, 0.3f, 0.01f, 0.25f, 1.76f); m_movementController.InitializeCharacterMotor(false, 1f, 1f, 1f, false, false, false); interactor = gameObject.GetComponent <Interactor>(); camTransitioner = thisCamera.GetComponent <CameraTransitioner>(); cameraFollow = thisCamera.GetComponent <CameraFollow>(); flshCtrl = gameObject.GetComponent <FlashlightController>(); firstPersonRig.gameObject.SetActive(false); var neckBone = siljaAnimation.GetBoneTransform(HumanBodyBones.Neck); cameraFollow.cameraFocusTarget = neckBone; m_eyesTransform = siljaAnimation.GetBoneTransform(HumanBodyBones.Head); }
public GameObject en; // tmp private void Awake() { Instance = this; MapBuilder = new MapBuilder(FindObjectOfType <MapObjectsManager>(), 40, 40); MapBuilder.Generate(); Player = GameObject.FindGameObjectWithTag("Player"); Hand = GameObject.FindGameObjectWithTag("Hand").transform; CameraCurrent = Camera.main; Invertory = new Invertory(); ParticleManager = GameObject.FindGameObjectWithTag("ParticleManager").GetComponent <ParticleManager>(); CameraController = new CameraController(CameraCurrent.transform); CameraController.Follow(Player.transform); CameraController.On(); _controllers.Add(CameraController); InputController = new InputController(); InputController.On(); _controllers.Add(InputController); PlayerController = new PlayerController(new UnitMotor(Player.transform)); PlayerController.On(); _controllers.Add(PlayerController); InHandController = new InHandController(); InHandController.On(); _controllers.Add(InHandController); FlashlightController = new FlashlightController(); FlashlightController.Off(); _controllers.Add(FlashlightController); NpcController = new NpcController(); NpcController.On(); _controllers.Add(NpcController); }
private void Start() { camera = GameObject.FindGameObjectWithTag("MainCamera"); //Find the camera CamControl = camera.GetComponent<CameraController>(); hud = GameObject.FindGameObjectWithTag("HUD"); player = GameObject.FindGameObjectWithTag("Player"); GameObject notificationLog = GameObject.FindWithTag("Log"); Log = notificationLog.GetComponent<LogScript>(); movement_controller = GetComponent<MovementController>(); weapon_backpack_controller = GetComponent<WeaponBackpackController>(); healthController = GetComponent<HealthController>(); RB = GetComponent<Rigidbody>(); Flashlight = GetComponentInChildren<FlashlightController>(); //Attach the flashlight Particles = GetComponentsInChildren<ParticleSystem>(); //Attach the powerfists SetPowerfists(false); Drop = false; TrackFace = true; this.toggle_movement = false; ScreenSize = new Vector3(Screen.width, Screen.height); doubleTapCountdown = 0; //doubleTapCounts = new int[4]; doubleTapCount = 0; //resetDoubleTapCount(); dashDirection = new Vector2(0, 0); //dashCooldownCountdown = 0; this.isDashing = false; dashForceCurrent = 1; dashStartTime = 0; isStunned = false; stunCountdown = 0; SetStunElectricity(false); //currentFloor = 0; dialogueLevel = 0; deepestLevelVisited = 0; currLevel = 0; level = 0; defense = 1f; }
private new void Awake() { base.Awake(); m_movementController.InitializeCharacterController(45f, 0.3f, 0.01f, 0.25f, 1.76f); m_movementController.InitializeCharacterMotor(false, 1f, 1f, 1f, false, false, false); interactor = gameObject.GetComponent<Interactor>(); camTransitioner = thisCamera.GetComponent<CameraTransitioner>(); cameraFollow = thisCamera.GetComponent<CameraFollow>(); flshCtrl = gameObject.GetComponent<FlashlightController>(); firstPersonRig.gameObject.SetActive(false); var neckBone = siljaAnimation.GetBoneTransform(HumanBodyBones.Neck); cameraFollow.cameraFocusTarget = neckBone; }