void Start() { Rat = GameObject.FindGameObjectWithTag("Player"); jumpScript = Rat.GetComponent<JumpScript>(); }
// Use this for initialization void Start() { jumpScript = GetComponentInParent <JumpScript>(); lineRenderer = GetComponent <LineRenderer>(); if (jumpScript == null) { enabled = false; } }
void Awake() { // get the car controller car = GetComponent<CarController>(); jumpScript = GetComponent<JumpScript>(); nitroScript = GetComponent<NitroScript>(); speedMeterScript = GetComponent<SpeedMeterScript>(); pathIndicatorScript = GetComponent<PathIndicatorScript>(); respawnScript = GetComponent<RespawnScript>(); }
// Start is called before the first frame update void Start() { Assert.IsNotNull(dashSFX, "Dash SFX was null, ensure a sound is assigned to the dashScript on the player game object"); playerState = GetComponent <PlayerState>(); p_rigidbody = GetComponent <Rigidbody2D>(); initialGravityScale = p_rigidbody.gravityScale; movescript = GetComponent <MoveScript>(); jumpScript = GetComponent <JumpScript>(); }
private void Start() { jumpScript = GetComponent <JumpScript>(); rb = GetComponent <Rigidbody2D>(); rotateScript = GetComponent <RotateScript>(); spring = GetComponent <SpringJoint2D>(); animator = GetComponent <Animator>(); spawner = GameObject.FindGameObjectWithTag("spawner"); PlayerCollisions.OnObstacleHit += OnDeath; initialPos = transform.position; }
public void HandOverBunny() { if (nextBunny == null) { nextBunny = GameObject.Instantiate(bunnyPrefab) as JumpScript; nextBunny.ForcePlacement(startPos, startRot); } JumpScript bunnyToPass = nextBunny; nextBunnyHasStarted = false; startLocClear = false; nextBunny = GameObject.Instantiate(bunnyPrefab) as JumpScript; startDir = new Vector2(Mathf.Sin(Mathf.Deg2Rad * startRot.eulerAngles.y), Mathf.Cos(Mathf.Deg2Rad * startRot.eulerAngles.y)); nextBunny.ForcePlacement(startPos - (respawnDistance * new Vector3(startDir.x, 0, startDir.y)), startRot); delayBunnyTimer.SetEventFunction(() => { player.SetBunny(bunnyToPass); Debug.Log("Bunny Attached"); }); // delayBunnyTimer.SetTargetTime(nextBunnyMoveInTimer.RemainingTime + -0.2f); delayBunnyTimer.Restart(); return; }
public override void Enter(IAgent pAgent) { player = GameObject.FindGameObjectWithTag("Player"); jumpScript = player.GetComponent <JumpScript>(); rotateScript = player.GetComponent <RotateScript>(); base.Enter(pAgent); levelCanvas.SetActive(true); finishLine.SetActive(true); levelManagers.SetActive(true); jumpScript.enabled = true; rotateScript.enabled = true; spawnObstacles.enabled = true; menuCanvas.SetActive(false); }
// Update is called once per frame void Update() { if (player == null) { player = GameObject.FindGameObjectWithTag("Player"); } if (player != null && !init) { rotateScript = player.GetComponent <RotateScript>(); jumpScript = player.GetComponent <JumpScript>(); rotateScript.enabled = true; jumpScript.enabled = true; init = true; } }
public void DestroyBunny() { GameObject.Destroy(bunny.gameObject); bunny = null; }
public void SetBunny(JumpScript bunny) { this.bunny = bunny; }
private void Start() { animator = GetComponent <Animator>(); body = GetComponent <Rigidbody2D>(); jumpScript = GetComponent <JumpScript>(); }
void Start() { bunny = GetComponent<JumpScript>(); timer = new Timer(); }
// Start is called before the first frame update void Start() { player = FindObjectOfType <PlayerMovement>(); jumpgrav = FindObjectOfType <JumpScript>(); }
void Start() { bunny = GetComponent <JumpScript>(); timer = new Timer(); }
void Awake() { if (alPrScr == null) { alPrScr = FindObjectOfType <AllPrefsScript>(); } if (univFunc == null) { univFunc = FindObjectOfType <UniversalFunctions>(); } if (gM == null) { gM = FindObjectOfType <GameManager> (); } if (adMob == null) { adMob = FindObjectOfType <AndroidAdMob_0>(); } if (buf == null) { buf = FindObjectOfType <Buffer>(); } if (cntrL == null) { cntrL = FindObjectOfType <CountriesList>(); } if (plL == null) { plL = FindObjectOfType <PlayersList>(); } if (prMng == null) { prMng = FindObjectOfType <ProfileManager>(); } switch (SceneManager.GetActiveScene().buildIndex) { case 1: if (upgr == null) { upgr = FindObjectOfType <Upgrades>(); } if (allAw == null) { allAw = FindObjectOfType <AllAwardsScript>(); } if (topPanMng == null) { topPanMng = FindObjectOfType <TopPanelManager>(); } if (objM == null) { objM = FindObjectOfType <Objects_Menu>(); } if (currPrPan == null) { currPrPan = FindObjectOfType <CurrentProfilePanel>(); } if (everyDayReward == null) { everyDayReward = FindObjectOfType <EverydayReward>(); } if (carMng == null) { carMng = FindObjectOfType <CareerManager>(); } break; case 2: if (fwScr == null) { fwScr = FindObjectOfType <FireworkScript>(); } if (molnia == null) { molnia = FindObjectOfType <LighteningScript>(); } if (practScr == null) { practScr = FindObjectOfType <Practice>(); } if (timFr == null) { timFr = FindObjectOfType <TimeFreeze>(); } if (rainMan == null) { rainMan = FindObjectOfType <RainManager>(); } if (bonObjMan == null) { bonObjMan = FindObjectOfType <BonusObjManager>(); } if (enOrDis == null) { enOrDis = FindObjectOfType <EnableOrDisable>(); } if (monWin == null) { monWin = FindObjectOfType <MoneyWinScript>(); } if (camSize == null) { camSize = FindObjectOfType <CameraSize>(); } if (colCorr == null) { colCorr = FindObjectOfType <ColorCorrectionControl>(); } if (marks == null) { marks = FindObjectOfType <Markers>(); } if (goalPanScr == null) { goalPanScr = FindObjectOfType <GoalPanelScript>(); } if (objLev == null) { objLev = FindObjectOfType <Objects_Level>(); } if (scoreScr == null) { scoreScr = FindObjectOfType <Score>(); } if (pMov == null) { pMov = FindObjectOfType <PlayerMovement>(); } if (tM == null) { tM = FindObjectOfType <TimeManager>(); } if (ballScr == null) { ballScr = FindObjectOfType <BallScript>(); } if (grTr == null) { grTr = FindObjectOfType <GroundTrigger1>(); } if (congrPan == null) { congrPan = FindObjectOfType <CongradulationsPanel>(); } if (levAudScr == null) { levAudScr = FindObjectOfType <LevelAudioScript>(); } if (stChScr == null) { stChScr = FindObjectOfType <StadiumChooseScript>(); } if (ballTScr == null) { ballTScr = FindObjectOfType <BallTouchScript>(); } if (jScr == null) { jScr = FindObjectOfType <JumpScript>(); } if (skyScr == null) { skyScr = FindObjectOfType <SkyScript>(); } //if (enAlg == null) enAlg = FindObjectOfType<Enemy>(); break; } }
private void Awake() { playerRb = GetComponent <Rigidbody2D>(); myJumpScript = GetComponent <JumpScript>(); }
void Start() { animator = GetComponent <Animator>(); js = GetComponent <JumpScript>() as JumpScript; }
private void Start() { _rigidbody = GetComponent <Rigidbody>(); _jumpScript = GetComponent <JumpScript>(); }