void Start() {


        Rat = GameObject.FindGameObjectWithTag("Player");
        jumpScript = Rat.GetComponent<JumpScript>();

	}
Exemple #2
0
 // 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>();
 }
Exemple #4
0
    // 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>();
    }
Exemple #5
0
    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;
 }
Exemple #7
0
    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);
    }
Exemple #8
0
    // 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;
        }
    }
Exemple #9
0
    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 void DestroyBunny()
 {
     GameObject.Destroy(bunny.gameObject);
     bunny = null;
 }
 public void SetBunny(JumpScript bunny)
 {
     this.bunny = bunny;
 }
Exemple #12
0
 private void Start()
 {
     animator   = GetComponent <Animator>();
     body       = GetComponent <Rigidbody2D>();
     jumpScript = GetComponent <JumpScript>();
 }
Exemple #13
0
 public void DestroyBunny()
 {
     GameObject.Destroy(bunny.gameObject);
     bunny = null;
 }
	void Start()
    {
        bunny = GetComponent<JumpScript>();
        timer = new Timer();
	}
Exemple #15
0
 // Start is called before the first frame update
 void Start()
 {
     player   = FindObjectOfType <PlayerMovement>();
     jumpgrav = FindObjectOfType <JumpScript>();
 }
Exemple #16
0
 void Start()
 {
     bunny = GetComponent <JumpScript>();
     timer = new Timer();
 }
Exemple #17
0
    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;
        }
    }
Exemple #18
0
 private void Awake()
 {
     playerRb     = GetComponent <Rigidbody2D>();
     myJumpScript = GetComponent <JumpScript>();
 }
Exemple #19
0
 public void SetBunny(JumpScript bunny)
 {
     this.bunny = bunny;
 }
Exemple #20
0
 void Start()
 {
     animator = GetComponent <Animator>();
     js       = GetComponent <JumpScript>() as JumpScript;
 }
 private void Start()
 {
     _rigidbody  = GetComponent <Rigidbody>();
     _jumpScript = GetComponent <JumpScript>();
 }