// Use this for initialization
    void Start()
    {
        fpc = GetComponent<FirstPersonController>();
        helpPanel = GameObject.Find("Help Panel");

        mouseLookCtrl(false);
    }
Beispiel #2
0
    private void Update()
    {
        if (SceneManager.GetActiveScene().name == "PCG" && gameObject.name == "TutorialPaper") {
            gameObject.SetActive(false);
            return;
        }

        if (_fpc == null)
            _fpc = FindObjectOfType<FirstPersonController>();

        if (_fpc != null)
            if (CheckImage()) {
                if (_fpc.GetRun())
                    _fpc.SetOff(gameObject.name);
                _timereading += Time.deltaTime;
                if (!_once)
                    _once = true;
                // Debug.Log(_timereading);
            } else {
                if (!_fpc.GetRun())
                    _fpc.SetOn(gameObject.name);
                _timeread += _timereading;
                if (_once) {
                    _once = false;
                    _countread += 1;
                }
                // if (_timeread > 0)
                // Debug.Log(gameObject.name + ": " + _timeread + ", times: " + _countread);
                _timereading = 0;
            }
    }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     playerTransform = player.GetComponent<Transform>();
     theTransform = GetComponent<Transform>();
     playerController = player.GetComponent<FirstPersonController>();
     theLight = GetComponent<Light>();
 }
	// Use this for initialization
	void Start () {
		FPSController = GetComponent<FirstPersonController>();

		walkSpeed = FPSController.m_WalkSpeed;
		runSpeed = FPSController.m_RunSpeed;
		gravity = FPSController.m_GravityMultiplier;
	}
Beispiel #5
0
 // Use this for initialization
 private void Start()
 {
     _normalColor = new Color(0.5f, 0.5f, 0.5f, 0.5f);
     _underwaterColor = new Color(0.22f, 0.45f, 0.77f, 0.5f);
     _controller = FindObjectOfType<FirstPersonController>();
     _breathBar = GameObject.FindGameObjectWithTag("BreathBar").GetComponent<Image>();
 }
Beispiel #6
0
 void Start()
 {
     player = GameObject.FindGameObjectWithTag ("Player");
     controller = player.GetComponent<FirstPersonController> ();
     start = true;
     end = false;
 }
    void Awake()
    {
        playerAudio = GetComponent<AudioSource>();
        firstPersonController = GetComponent<FirstPersonController>();

           // damageImage = GetComponent<Image>();
        currentHP = health;
    }
Beispiel #8
0
 void Awake()
 {
     //anim = GetComponent<Animator>();
     playerAudio = GetComponent<AudioSource>();
     playerController = GetComponent<FirstPersonController>();
     //playerShooting = GetComponentInChildren <PlayerShooting> ();
     currentHealth = startingHealth;
 }
Beispiel #9
0
	void Start () {
		fps = GameObject.FindGameObjectWithTag ("Player").GetComponent<FirstPersonController> ();
        Canvas canvas = GameObject.Find ("Canvas").GetComponent<Canvas> ();
        GameObject hideText = Resources.Load ("Prefabs/hideText") as GameObject;
        textHide = Instantiate (hideText, new Vector2(Screen.width/2,80), Quaternion.identity) as GameObject;
        textHide.transform.parent = canvas.transform;
        textHide.SetActive (false);
	}
	public override void Fire(FirstPersonController player) {
		foreach (Transform child in firePositions) {
			SeekerMissile clone = (SeekerMissile)Instantiate(projectile);
			clone.transform.position = child.position;
			clone.transform.rotation = child.rotation;
			clone.target = GetComponent<WeaponLockOn>().lockedShip.transform;
			clone.owner = player;
		}
	}
 void Start()
 {
     player = GameObject.FindGameObjectWithTag ("Player");
     playerController = player.GetComponent<FirstPersonController> ();
     dynamicObjects = GameObject.FindWithTag ("Dynamic");
     freezeGameObjects = dynamicObjects.GetComponent<FreezeGameObjects> ();
     PauseMenuGameObjects = GameObject.FindGameObjectsWithTag ("Pause Menu");
     setIsPaused (false);
 }
Beispiel #12
0
	void Start ()
	{
		animator = GetComponent <Animator> ();
		gameController = GameObject.FindGameObjectWithTag ("GameController").GetComponent<GameController> ();
		fpsController = GameObject.FindGameObjectWithTag ("Player").GetComponent<FirstPersonController> ();
		cross = GameObject.FindGameObjectWithTag ("Cross");
		cross.GetComponent<Image> ().enabled=false;
		audio = gameObject.GetComponents<AudioSource> ();
	}
Beispiel #13
0
    // Use this for initialization
    void Start()
    {
        fpsController = GetComponent<FirstPersonController>();
        gameController = GameObject.FindWithTag( "GameController" ).GetComponent<GameController>();
        mainCamera = GameObject.FindWithTag( "MainCamera" ).GetComponent<Camera>();
        cameraAnimation = mainCamera.GetComponent<Animation>();

        RefManager.Instance.fadeToBlack.SetColor( "_Color", new Color( 0.0f, 0.0f, 0.0f, fadeToBlackAlpha ) );
    }
 void Start()
 {
     audioSource = GameObject.Find ("FPSController").GetComponent<AudioSource> ();
     fpsController = GameObject.FindGameObjectWithTag ("Player").GetComponent<FirstPersonController>();
     anim = GameObject.Find ("TxtGUI").GetComponent<Animation> ();
     textGUI = GameObject.Find ("NPC Text").GetComponent<Text> ();
     nameGUI = GameObject.Find ("NPC Name").GetComponent<Text> ();
     image = GameObject.Find ("NPC Image").GetComponent<Image> ();
     sameTagList = GameObject.FindGameObjectsWithTag (gameObject.tag);
 }
Beispiel #15
0
    //private GameObject LedgeOBJ;
    //private Vector3 Intermediate;
    //private Vector3 Landing;
    void Start()
    {
        Player = GameObject.FindGameObjectWithTag ("Player");
        playerController = Player.GetComponent<FirstPersonController>();

        // Used for manual transform of character (Legacy mode for clamber)
        //LedgeOBJ = gameObject;
        //Intermediate = new Vector3 (LedgeOBJ.transform.position.x,LedgeOBJ.transform.position.y +0.9f,LedgeOBJ.transform.position.z);
        //Landing = new Vector3 (LedgeOBJ.transform.position.x + 2f,LedgeOBJ.transform.position.y +0.8f,LedgeOBJ.transform.position.z);
    }
Beispiel #16
0
	void Start () {
		portal1 = Instantiate (portal1Prefab); //Load the two portals
		portal2 = Instantiate (portal2Prefab);
		laserLine = laser.GetComponent<LineRenderer> (); //Load the line renderer for the portal gun's lasers
		portalGunAnimator = portalGunObj.GetComponent<Animator> (); //Load the animator for the portal gun

		fpsControllerScript = GetComponent<FirstPersonController>(); //To change speed of fps player

		camFov = Camera.main.fieldOfView; //Initial Fov to zoom/reset
	}
	void Start () {
		currentResistance = resistancePoints;
		forceDomePosition = new Vector3(6f, -1f, 100f);
	    fpc = GetComponent<FirstPersonController>();
	    originalSize = transform.localScale;
	    localCamera = GetComponentInChildren<Camera>();
	    originalFOV = localCamera.fieldOfView;
	    originalWalkspeed = fpc.m_WalkSpeed;
	    //GameObject thisReciever = GameObject.Find (this.name);
	    //Debug.Log(((MonoBehaviour)thisReciever.GetComponent("FirstPersonController")).WalkSpeed = 1f);
	}
Beispiel #18
0
	// Update is called once per frame
	public void Configure (PlayerID data, int playerCount) {
		if (playerController == null) playerController = GetComponent<FirstPersonController>();
		if (camera == null) camera = GetComponentInChildren<Camera>();

		playerController.playerID = data;

		playerController.init();

		ConfigureCamera(playerCount);

	}
 void Start()
 {
     talkManager = GameObject.Find("TalkManager").GetComponent<TalkManager>();
     stageManager = GameObject.Find("StageManager").GetComponent<StageManager>();
     charas = GameObject.FindGameObjectsWithTag("Character");
     fpController = GetComponent<FirstPersonController>();
     for(int i=0; i<charas.Length; i++){
         character.Add(new CharacterViewController());
         character[i] = charas[i].GetComponent<CharacterViewController>();
     }
 }
    void Start()
    {
        HealthComponent = new PlayerGUIComponent(TextureSize, new Vector2(20, 20), 150);
        HungerComponent = new PlayerGUIComponent(TextureSize, new Vector2(20, 60), 150);
        ThirstComponent = new PlayerGUIComponent(TextureSize, new Vector2(20, 100), 100);
        StaminaComponent = new PlayerGUIComponent(TextureSize, new Vector2(20, 140), 35);

        CharacterController = GetComponent<CharacterController>();
        CharacterMotor = GetComponent<CharacterMotor>();
        FirstPersonController = GetComponent<FirstPersonController>();
    }
Beispiel #21
0
    void Start()
    {
        menu = GameObject.Find("Canvas").transform.Find("Menu").gameObject;
        winScreen = GameObject.Find("Canvas").transform.Find("Victory").gameObject;
        defeatScreen = GameObject.Find("Canvas").transform.Find("Defeat").gameObject;
        fpsController = GameObject.Find("/Player").GetComponent<FirstPersonController>();
        boss = GameObject.Find("/Boss").GetComponent<Boss>();

        Cursor.visible = false;
        gameState = GameStates.Playing;
    }
Beispiel #22
0
    // Update is called once per frame
    void Update()
    {
        if (player == null)
        {
            player = GameObject.FindWithTag("Player").GetComponent<FirstPersonController>();
        }

        else
        {
            rect.anchorMax = new Vector2(player.remainingStamina / 20, 1);
        }
    }
 // Update is called once per frame
 public void ChangeSensitivity(float sensitivity)
 {
     if(fpsController == null) {
         GameObject playerGO = (GameObject) GameObject.FindGameObjectWithTag("Player");
         if(playerGO) {
             fpsController = playerGO.GetComponent<FirstPersonController>();
         }
     }
     if(fpsController != null) {
         fpsController.setMouseSens( sensitivity );
     }
 }
Beispiel #24
0
	void Start () {
		
		portal1 = Instantiate (portal1Prefab);
		//portal1.GetComponent<SpriteRenderer> ().color = Color.blue;
		portal2 = Instantiate (portal2Prefab);
		//portal2.GetComponent<SpriteRenderer> ().color = Color.red;
		camFov = Camera.main.fieldOfView;
		otherScript = GetComponent<FirstPersonController>();
		//laserLine[0] = laser.GetComponent<LineRenderer> ();
		for(int i = 0; i < 4; i++)
			laserLine[i] = Instantiate (laser).GetComponent<LineRenderer> ();
	}
	// Use this for initialization
	void Start () {
		this.isCasting = false;
		this.lastCastingVal = true;
		fpsScript = GetComponent<FirstPersonController> ();
		castingScript = GetComponent<CharacterCasting> ();
		
		smallList = new List<GameObject>();
		blackList = new List<GameObject>();
		isOnBoat = false;

		animBoat = boat.GetComponent<Animation> ();
		
	}
	// Use this for initialization
	void Start () {
//		PowerUpSpawner.PowerUpCollected += powerUpCollected;

		weapons = GetComponentsInChildren<WeaponComponent>();

		DisableAllWeapons();

		player  = transform.parent.gameObject.GetComponent<FirstPersonController>();
		weaponsBar  = player.GetComponentInChildren<SpecialWeaponsBar>();

		weaponsBar.SetShots (0);
		ChangeWeapon(startPrimaryWeapon);
		ChangeWeapon(startSecondaryWeapon, 5);

	}
Beispiel #27
0
	// Use this for initialization
	void Start () {
		mainMenuCanvas = GameObject.Find( "MainMenu" ).gameObject.GetComponent<Canvas>();
		optionsCanvas = GameObject.Find( "OptionsMenu" ).gameObject.GetComponent<Canvas>();
		loseCanvas = GameObject.Find( "LoseMenu" ).gameObject.GetComponent<Canvas>();
		winCanvas = GameObject.Find( "WinMenu" ).gameObject.GetComponent<Canvas>();
		player = GameObject.Find( "Player" ).gameObject.GetComponent<Player>();
		daycycle = GameObject.Find( "Stars" ).gameObject.GetComponent<Daycycle>();
		zombieSpawner = GameObject.Find( "ZombieSpawnPoints" ).gameObject.GetComponent<ZombieSpawner>();
		firstPersonController = GameObject.Find( "Player" ).GetComponent<FirstPersonController>();

		ChangeState( GameState.MainMenu );
		firstPersonController.enabled = false;
		Cursor.visible = true;
		daycycle.SetTimeScale( 20f );
	}
Beispiel #28
0
    /**
     * Called when the player character comes into the 'zone'
     * of the city pond
     */
    void OnTriggerEnter(Collider colide)
    {
        if (colide.gameObject.tag == "Player")
        {
            playerAtPond = true;

            //freeze mouse-look
            firstPerson = colide.gameObject.GetComponent<FirstPersonController> ();
            firstPerson.setInDialogueToggle();

            colide.gameObject.GetComponent<FirstPersonController> ().setInDialogueToggle();
            Debug.Log("player at pond");

        }
    }
Beispiel #29
0
	void Start ()
	{
		agent = GetComponent<NavMeshAgent> ();
		// Disabling auto-braking allows for continuous movement
		// between points (ie, the agent doesn't slow down as it
		// approaches a destination point).
		agent.autoBraking = false;
		GotoNextPoint ();

		player = GameObject.FindGameObjectWithTag ("Player");
		gameController = GameObject.FindGameObjectWithTag ("GameController").GetComponent<GameController> ();
		fpsController = player.GetComponent<FirstPersonController> ();
		col = GetComponent<SphereCollider> ();
		audioSources = GetComponents<AudioSource> ();
		animator = GetComponent<Animator>();
	}
Beispiel #30
0
	//Change networking to load levels via string instead of int
	
	void Start () 
	{
		//GENERAL
		combatStat = GetComponent<combatStats>();
		m_FirstPerson = GetComponent<FirstPersonController>();
		m_CharacterController = GetComponent<CharacterController>();
		gameStat = GameObject.Find("GameManager").GetComponent<currentClientStats>();
		grenadeObject = gameStat.toolID;
		
		if (photonView.isMine) 
		{	
			photonView.RPC ("spawnWeapon", PhotonTargets.AllBuffered, gameStat.weapon1ID);
			gunAnim = transform.GetChild (0).GetChild (0).GetChild (0).GetChild(1).GetChild(2).GetComponent<Animator> ();
			handAnim = transform.GetChild (0).GetChild (0).GetChild (0).GetChild(1).GetComponent<Animator> ();
//			gunAnim.GetComponent<Animation>()["reload"].wrapMode = WrapMode.Once;
//			handAnim.GetComponent<Animation>()["reload"].wrapMode = WrapMode.Once;
		} 
		
		//Ammo info
		
		TotalAmmo = 99999;
		totalAmmoMax = 99999;
		Ammo = 10;
		magazineMax = 10;
		regenTimer = 3;
		
//		switch(gameStat.weapon1ID)
//		{
//			case "00":
//			TotalAmmo = 99999;
//			totalAmmoMax = 99999;
//			Ammo = 10;
//			magazineMax = 10;
//			regenTimer = 3;
//			break;
//		}
		if (Application.loadedLevelName == "Level 1")
		{
			HUD = GameObject.Find("HUD");
		}
		
	}
Beispiel #31
0
 // Start is called before the first frame update
 void Start()
 {
     puttingPlaces         = GameObject.FindObjectsOfType <PuttingPlace>();
     firstPersonController = GameObject.FindGameObjectWithTag("Player").GetComponent <FirstPersonController>();
 }
Beispiel #32
0
 // Start is called before the first frame update
 void Start()
 {
     controller     = FPSController.GetComponent <FirstPersonController>();
     charController = FPSController.GetComponent <CharacterController>();
 }
Beispiel #33
0
    bool isDamaged = false; //If the player is currently taking damage.



    void Awake()
    {
        levelController       = FindObjectOfType <LevelController>();
        firstPersonController = FindObjectOfType <FirstPersonController>();
        playerShootController = FindObjectOfType <PlayerShootController>();
    }
 void Start()
 {
     player        = FindObjectOfType <FirstPersonController>();
     player_health = FindObjectOfType <HealthBar>();
 }