// Use this for initialization
 void Start()
 {
     if(networkView.isMine)
         cam = GameObject.FindGameObjectWithTag("GameController").GetComponent<CameraControllerScript>();
     else
         cam = null;
     relativeCastPos = new Vector3(0f, 1.5f, 0f);
     cone = (GameObject)Resources.Load("ConePushCone");
 }
 // Use this for initialization
 void Start()
 {
     character = GetComponent <CharacterBuildScript>();
     movement = GetComponent<CharacterMoveScript>();
     GameObject game = GameObject.FindGameObjectWithTag("GameController");
     cameraController = game.GetComponent<CameraControllerScript>();
     settings = game.GetComponent<PlayerSettingsScript>();
     ability1IsHeld = false;
     ability2IsHeld = false;
 }
Exemple #3
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         DisplayText.text = " ";
         for (int counter = 0; counter < 20; counter++)
         {
             BlastBalls [counter].GetComponent <ConstantForce> ().force = new Vector3(50f, 1f, 0f);
         }
         CameraControllerScript camControl = Camera.main.GetComponent <CameraControllerScript> ();
         camControl.lookAtTarget = BlastBalls [19].GetComponent <Transform> ();
     }
 }
Exemple #4
0
    void Start()
    {
        cameraControll = GameObject.Find("Camera Manager").GetComponent <CameraControllerScript>();
        startPoint     = transform.position;
        rb             = GetComponent <Rigidbody>();

        audioSource = GetComponent <AudioSource>();
        StartCoroutine(StartCam());

        activeScene = SceneManager.GetActiveScene();
        sceneName   = activeScene.name;
        PlayerPrefs.SetInt("fireCount", 0);
    }
    void Awake()
    {
        GameObject game = GameObject.FindGameObjectWithTag ("GameController");
        networkManager = game.GetComponent<NetworkManagerScript> ();

        if (networkView.isMine)
            cam = game.GetComponent<CameraControllerScript> ();
        else
            cam = null;

        wall = (GameObject)Resources.Load ("WallObject");

        castPos = Vector3.zero;
        ClearCooldown ();
    }
    void OnTriggerEnter(Collider activator)
    {
        CameraControllerScript camControl = Camera.main.GetComponent <CameraControllerScript> ();

        if (lookOverride != null)
        {
            camControl.lookAtTarget = lookOverride;
        }

        if (moveOverride != null)
        {
            camControl.moveToTarget = moveOverride;
        }

        Destroy(GetComponent <BoxCollider>());
    }
Exemple #7
0
 // Use this for initialization
 void Start()
 {
     CCS           = GameObject.Find("Main Camera").GetComponent <CameraControllerScript>();
     PCS           = GetComponent <PlayerControlScript> ();
     PlayerColor   = GetComponent <SpriteRenderer> ().color;
     RHS           = GameObject.Find("WinTextObj").GetComponent <RoundHandlerScript> ();
     BoarderColor  = HitBoarder.color;
     SPS           = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
     Stats         = GameObject.Find("TotalStatsHolder").GetComponent <EndGameStatsScript>();
     ES            = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
     Invincible    = true;
     bulletNumbers = new int[4];
     for (int x = 0; x < 4; x++)
     {
         bulletNumbers[x] = -1;
     }
     Invoke("RemoveIncincible", 2f);
 }
Exemple #8
0
 // Use this for initialization
 void Awake()
 {
     GameObject game = GameObject.FindGameObjectWithTag("GameController");
     camController = game.GetComponent<CameraControllerScript>();
     settings = game.GetComponent<PlayerSettingsScript>();
 }
 void Awake()
 {
     instance = this;
     ResetCamera();          // reset camera
 }
Exemple #10
0
 void Awake()
 {
     instance = this;
 }
    void Awake()
    {
        parentObject = transform.parent.gameObject;
        modelMaterial = parentObject.transform.Find("CharacterModel").renderer.material;
        GameObject game = GameObject.FindGameObjectWithTag("GameController");
        camController = game.GetComponent<CameraControllerScript>();
        settings = game.GetComponent<PlayerSettingsScript>();
        currLookDist = goalLookDist = 10f;

        //calculate the lower and upper limits based on the currect proportion in characterCamLocProportion
        lookBoundsUpper = Mathf.Abs( Mathf.Atan(GameSettings.characterCamLocProportion.z / GameSettings.characterCamLocProportion.y) ) * Mathf.Rad2Deg;
        lookBoundsLower = lookBoundsUpper - 180;

        //apply an offset, so the camera won't look over the top, or under the bottom
        lookBoundsUpper -= GameSettings.characterCamVerticalOffset;
        lookBoundsLower += GameSettings.characterCamVerticalOffset;
    }