void Awake()
    {
        //catapult = spring.connectedBody.transform;
        lerpScript = GameObject.Find("Main Camera").GetComponent<LerpObjectives>();
        projectileFollowScript = GameObject.Find("Main Camera").GetComponent<ProjectileFollow>();
        projectileFollowScript.projectile = transform;
        projectileFollowScript.script = this.gameObject.GetComponent<forceshooting>();
        projectileFollowScript.SetCameraToBallPosition();
        level = GameObject.Find("ScriptObject").GetComponent<LevelScript>();
        totalCheckpoints = level.totalCheckpoints;
        resetColliders = level.checkpoints;
        walls = level.walls;
        newBallPositions = level.ballPositions;
        newCatapultPositions = level.catapultPositions;
        force = level.force;
        level.ball = this.gameObject;

        createTrail = this.GetComponent<TrajectoryScript1>() as TrajectoryScript1;
        if(SceneManager.GetActiveScene().name == "DiscoveryClub")
        {
            if(projectileFollowScript.finishedTutorial == false)
            {
                finishedTutorial = false;
            }
            else
            {
                finishedTutorial = true;
            }
        }
    }
Exemple #2
0
    private void OnMouseDown()
    {
        isDragging = true;
        screenPos  = mainCamera.WorldToScreenPoint(rb.transform.position);
        direction  = (Vector2)Input.mousePosition - screenPos;

        // Reset launch time.
        timeToLaunch = rangeFinderLaunchPeriod;

        ProjectileFollow temp = mainCamera.GetComponent <ProjectileFollow>();

        temp.projectile = transform;
    }
	// Use this for initialization
	void Start () {
        script = GameObject.Find("Main Camera").GetComponent<ProjectileFollow>();
	}
    // Use this for initialization
    void Start () {
	    cameraScript = GameObject.Find("Main Camera").GetComponent<ProjectileFollow>() as ProjectileFollow;

        StartCoroutine(FadeInMusic());
    }