// Start is called before the first frame update void Start() { // Assuming there will only ever be one player player = GetComponentInParent <Player>(); jetPack = GetComponentInParent <JetPack>(); boingSound = GetComponent <AudioSource>(); }
private void Start() { instance = this; jetpack = GetComponentInChildren <JetPack>(); rb = GetComponentInChildren <Rigidbody>(); healthBar = GameObject.Find("HealthBar").GetComponent <RectTransform>(); }
public void UpdateLabel(float val) { val = GetComponent <Slider> ().value; if (property == Property.MAX_FORCE) { val *= 10; } value.text = (val.ToString() + sufix); switch (property) { case Property.YOUR_WEIGHT: weight = val; break; case Property.MAX_FORCE: force = val; break; case Property.FUEL_AMOUNT: fuel = val; break; } GameObject player = GameObject.FindGameObjectWithTag("Player"); Rigidbody body = player.GetComponent <Rigidbody>(); JetPack pack = player.GetComponent <JetPack>(); body.mass = SUIT_WEIGHT + FUEL_WEIGHT * fuel + weight; pack.rocketPowerScale = force; pack.fuel = fuel; }
// Use this for initialization void Start() { tScript = this.GetComponent <Teleporter>(); cScript = this.GetComponent <Controller>(); hScript = this.GetComponent <Hoverboard>(); gScript = this.GetComponent <Grappling>(); pScript = this.GetComponent <PlatformMvt>(); sScript = this.GetComponent <SwingingArms>(); zScript = this.GetComponent <PinchZoom>(); jScript = this.GetComponent <JetPack>(); spScript = this.GetComponent <SkiPole>(); eScript = this.GetComponent <Soar_Earth>(); TeleMsg = GameObject.Find("ModeUpdate/Canvas/TeleMsg"); ControlMsg = GameObject.Find("ModeUpdate/Canvas/ControlMsg"); HoverMsg = GameObject.Find("ModeUpdate/Canvas/HoverMsg"); GrappleMsg = GameObject.Find("ModeUpdate/Canvas/GrappleMsg"); PlatformMsg = GameObject.Find("ModeUpdate/Canvas/PlatformMsg"); SwingingMsg = GameObject.Find("ModeUpdate/Canvas/SwingingMsg"); PinchMsg = GameObject.Find("ModeUpdate/Canvas/PinchMsg"); JetMsg = GameObject.Find("ModeUpdate/Canvas/JetMsg"); SkiMsg = GameObject.Find("ModeUpdate/Canvas/SkiMsg"); EarthMsg = GameObject.Find("ModeUpdate/Canvas/EarthMsg"); TeleInstr = GameObject.Find("ModeUpdate/Canvas/TeleInstr"); ControlInstr = GameObject.Find("ModeUpdate/Canvas/ControlInstr"); HoverInstr = GameObject.Find("ModeUpdate/Canvas/HoverInstr"); GrappleInstr = GameObject.Find("ModeUpdate/Canvas/GrappleInstr"); PlatformInstr = GameObject.Find("ModeUpdate/Canvas/PlatformInstr"); SwingingInstr = GameObject.Find("ModeUpdate/Canvas/SwingingInstr"); PinchInstr = GameObject.Find("ModeUpdate/Canvas/PinchInstr"); JetInstr = GameObject.Find("ModeUpdate/Canvas/JetInstr"); SkiInstr = GameObject.Find("ModeUpdate/Canvas/SkiInstr"); EarthInstr = GameObject.Find("ModeUpdate/Canvas/EarthInstr"); Timer = GameObject.Find("ModeUpdate/Canvas/Timer"); Body = this.GetComponent <Rigidbody>(); }
// Use this for initialization void Awake() { body = GetComponent <Rigidbody> (); groundController = GetComponent <FirstPersonController> (); characterController = GetComponent <CharacterController> (); airController = GetComponent <JetPack> (); }
// Default constructor public void ConstructPlayer() { body = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); jetPack = GetComponent <JetPack>(); body.mass = playerMass; body.gravityScale = 0f; }
void OnDisableJetpack() { transform.GetChild(0).gameObject.SetActive(false); //EjectCheck(); parachuteActivated = true; PlayParachuteSound(); jetpack = null; jetpackEquipped = false; }
//public CinemachineVirtualCamera deathCam; // Start is called before the first frame update void Start() { //Cursor.visible = false; playerMovScript = FindObjectOfType <PlayerMovement>(); playerJet = FindObjectOfType <JetPack>(); player = FindObjectOfType <Player>(); hudController = FindObjectOfType <HUDController>(); jetPack = FindObjectOfType <JetPack>(); }
// Start is called before the first frame update void Start() { levelMan = FindObjectOfType <LevelManager>(); anim = GetComponent <Animator>(); playerMov = GetComponent <PlayerMovement>(); playerJet = GetComponent <JetPack>(); currentAir = startingAir; airBar.SetMaxAir(maxAir); }
private void Awake() { fuelIndicator = transform.GetChild(1).GetChild(0).GetComponent <RectTransform>(); heightText = GetComponentInChildren <Text>(); bar = GetComponentInChildren <BarAnimationVertical>(); jetpack = FindObjectOfType <JetPack>(); }
protected void OnPickUp(int PlayerID) { Debug.Log("PicKuP"); JetPack Playerjet = PhotonView.Find(PlayerID).gameObject.GetComponent <JetPack>(); Playerjet.JetActivate = true; Destroy(gameObject); }
private void Awake() { fadePlane = GameObject.FindGameObjectWithTag("FadeScreen").GetComponent <Image>(); scorchMark = GameObject.FindGameObjectWithTag("ScorchMark").GetComponent <SpriteRenderer>(); resultsUI = GameObject.FindGameObjectWithTag("Results").GetComponent <DropDownMenu>(); endOfDayUI = GameObject.FindGameObjectWithTag("EndOfDay").GetComponent <DropDownMenu>(); endOfWeekUI = GameObject.FindGameObjectWithTag("EndOfWeek").GetComponent <DropDownMenu>(); rightButton = GameObject.FindGameObjectWithTag("RightArrow").GetComponent <SlideInUI>(); leftButton = GameObject.FindGameObjectWithTag("LeftArrow").GetComponent <SlideInUI>(); day = GameObject.FindGameObjectWithTag("DayManager").GetComponent <Day>(); BarAnimation[] statBars = FindObjectsOfType <BarAnimation>(); burnTimeBar = statBars[0]; turningPowerBar = statBars[1]; jetPack = FindObjectOfType <JetPack>(); jCamera = FindObjectOfType <JetpackCamera>(); fadePlane.gameObject.SetActive(true); selectedCatagories = new bool[3]; shop = GetComponent <Shop>(); fireButton = GameObject.FindGameObjectWithTag("FireButton").GetComponent <SlideInUI>(); flyHUD = GameObject.FindGameObjectWithTag("FlyHUD").GetComponent <SlideInUI>(); destinationUI = GameObject.FindGameObjectWithTag("DestinationUI").GetComponent <SlideInUI>(); destinationText = GameObject.FindGameObjectWithTag("DestinationUI").GetComponentInChildren <Text>(); destinationUIDown = GameObject.FindGameObjectWithTag("DestinationUI").GetComponent <DropDownMenu>(); Transform ComponentSelection = GameObject.FindGameObjectWithTag("ComponentSelection").transform; currentStats = GameObject.FindGameObjectWithTag("CurrentStats").GetComponent <DropDownMenu>(); componentsSelection = ComponentSelection.GetComponent <DropDownMenu>(); componentButtons = new RectTransform[3]; componentButtons[0] = ComponentSelection.GetChild(0).GetComponent <RectTransform>(); componentButtons[1] = ComponentSelection.GetChild(1).GetComponent <RectTransform>(); componentButtons[2] = ComponentSelection.GetChild(2).GetComponent <RectTransform>(); scorchMarkStartAlpha = scorchMark.color.a; }
void OnEnableJetpack() { if (jetpackEquipped) { jetpack.Refuel(); } else { transform.GetChild(0).gameObject.SetActive(true); jetpack = transform.GetChild(0).gameObject.GetComponent <JetPack>(); jetpack.Refuel(); } }
private void Awake() { jetPack = FindObjectOfType <JetPack>(); customerGen = GetComponent <CustomerGenerator>(); day = GameObject.FindGameObjectWithTag("DayManager").GetComponent <Day>(); UI = GetComponent <UIManager>(); selectedComponent = -1; currentComponent = new int[3]; currentCustomer = FindObjectOfType <Customer>(); flying = false; }
void Start() { point = GetComponent <Point>(); skeletonAnimation = GetComponent <SkeletonAnimation>(); skeleton = skeletonAnimation.skeleton; audioSource = GetComponent <AudioSource>(); animationState = skeletonAnimation.AnimationState; skeletonAnimation.state.Event += HandleEvent; rigidbody2D = GetComponent <Rigidbody2D>(); meshRenderer = GetComponent <MeshRenderer>(); jetpack = GetComponent <JetPack>(); collider = GetComponent <BoxCollider2D>(); allMask = (1 << LayerMask.NameToLayer("Ground")) | (1 << LayerMask.NameToLayer("Platform")); platformMask = 1 << LayerMask.NameToLayer("Platform"); if (ignoreCollider != null) { Physics2D.IgnoreCollision(ignoreCollider, collider); } ballTime = ballStartTime; }
// Side effect gets the new player's jet pack also public void SetNewPlayer(Player newPlayer) { player = newPlayer; jetPack = newPlayer.GetComponent <JetPack>(); }
// Use this for initialization void Start() { jetpack = gameObject.GetComponent <JetPack>(); }
// Start is called before the first frame update void Start() { jetpackScript = GetComponent <JetPack>(); //jetpackScript.enabled = true; // change this to false if you want to play the level //StartCoroutine(FirstUI()); }
// Use this for initialization void Start() { renderer = GetComponent <SpriteRenderer>(); jetPack = GetComponent <JetPack>(); }