// public GameObject Cam; //public GameObject Bgshka; void Start() { BG = GetComponent <Rigidbody2D>(); Movingpla = GameObject.Find("kucha"); script = Movingpla.GetComponent <MovingPlayer>(); // BG.transform.position = new Vector3( 0, Cam.transform.position.y, 10); }
// Use this for initialization void Start() { counter = TimeUntilDeleted; rigid = GetComponent <Rigidbody2D>(); player = FindObjectOfType <MovingPlayer>(); baseDamage = damage; }
void Start() { Player = GameObject.Find("kucha"); script = Player.GetComponent <PlayerHP>(); scriptMove = Player.GetComponent <MovingPlayer>(); rb = GetComponent <Rigidbody2D>(); }
// Use this for initialization void Start() { player = FindObjectOfType <PlayerInput>().gameObject.transform; player2 = FindObjectOfType <MovingPlayer>(); rigid = GetComponent <Rigidbody2D>(); score = FindObjectOfType <Score>(); isInvis = false; }
// Use this for initialization void Start() { GetComponent <SpriteRenderer>().color = Color.green; player = FindObjectOfType <MovingPlayer>(); coll = GetComponent <BoxCollider2D>(); baseSpeed = player.speed; c = GetComponent <SpriteRenderer>().color; }
void Start() { radius = spawner.GetComponent <Spawner>(); mov = gameObject.GetComponent <MovingPlayer>(); gameWorld = new List <GameObject>(); SpawnObject(gameObject.transform.position); }
public override void NetworkStart() { netptransform = GetComponent <MovingPlayer>(); if (IsOwner) { InvokeRepeating("TransmitAnimationStates", 0f, (1f / FixedSendsPerSecond)); } }
private void Start() { gridArray = _buildPlane.gridArray; rows = _buildPlane.rows; columns = _buildPlane.columns; scale = _buildPlane.scale; movingPlayer = _player.GetComponent <MovingPlayer>(); }
private void Awake() { if (Singleton != null) { Destroy(gameObject); } else { Singleton = this; } }
void Start() { Placescript = GameObject.Find("kucha"); script = Placescript.GetComponent <SpawnGround>(); ZombieA = script.newZombie; Trigger = ZombieA.transform.Find("PlayerTarget").gameObject; scriptTrig = Trigger.GetComponent <TargetPlayerZombie1>(); Zombie1 = GetComponent <Rigidbody2D>(); scriptPlayer = Placescript.GetComponent <MovingPlayer>(); }
public virtual void NetworkStart() { player = context.GetComponent <PlayerController>(); moving_player = context.GetComponent <MovingPlayer>(); isOwner = (context as PhysicsPropHandler).isOwner; networkId = (context as PhysicsPropHandler).networkId; isServer = (context as PhysicsPropHandler).IsServer(); networkedObject = (context as PhysicsPropHandler).networkedObject; enabled = true; }
void Start() { playerVel = GameObject.FindGameObjectWithTag("Player").GetComponent <Rigidbody2D>(); target = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>(); player = GameObject.FindGameObjectWithTag("Player").GetComponent <MovingPlayer>(); //Текущая позиция камеры offset = transform.position; Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; }
protected override Vector3 CalculatePlayerVelocity() { MovingPlayer player = GetComponentInChildren <MovingPlayer>(); Vector3 player_pos = Vector3.zero; if (player != null) { player_pos = player.transform.position - transform.position; } Vector3 rotating_velocity = Vector3.Cross(transform.TransformDirection(AngularVelocity), player_pos) * Mathf.Deg2Rad; return(velocity + rotating_velocity); }
// Use this for initialization void Start() { player = FindObjectOfType <MovingPlayer>(); tiles = GetComponentsInChildren <Tile>(); list1 = new List <Tile>(); list2 = new List <Tile>(); list3 = new List <Tile>(); list4 = new List <Tile>(); timeUntilNextTiles = timeUntilTileChange; timeAfterFirst = 0; firstDone = false; secondDone = false; }
void Start() { // PlayerPrefs.SetInt("coundDiamond", 2354); PlayerGO = GameObject.Find("kucha"); Player = PlayerGO.GetComponent <Rigidbody2D>(); scriptMovePlayer = PlayerGO.GetComponent <MovingPlayer>(); scriptPlayerHP = PlayerGO.GetComponent <PlayerHP>(); //Diamond = GameObject.Find("Diamond"); //Box if (!PlayerPrefs.HasKey("coundDiamond")) { PlayerPrefs.SetInt("coundDiamond", 0); } CountDiamond = PlayerPrefs.GetInt("coundDiamond"); NewCountDiamond = CountDiamond; }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Player") { MovingPlayer script = collision.GetComponent <MovingPlayer>(); script.health -= damage; script.hurtSound.Play(); //ShakeScript sk = FindObjectOfType<ShakeScript>(); //sk.shakeScreen(); Destroy(gameObject); } if (collision.tag == "Tile") { if (collision.GetComponent <Tile>().getColor().Equals(Color.gray)) { Destroy(gameObject); } } }
static void switchPlayer(NetworkMessage netMsg) { canSwitchCameraView = true; var msg = netMsg.ReadMessage <MyMessage>(); if (currentPlayer != null) { currentMovingPlayer.enabled = false; currentPlayer.transform.Find("UIoverlay").gameObject.SetActive(false); //hide that player's UI frame } GameObject go = ClientScene.FindLocalObject(msg.netId); currentPlayer = go.GetComponent <Player>(); currentMovingPlayer = go.GetComponent <MovingPlayer>(); currObservedPlayerId = currentPlayer.netId; currentMovingPlayer.enabled = true; Transform uioverlay = currentPlayer.transform.Find("UIoverlay"); uioverlay.gameObject.SetActive(true); }
// Use this for initialization void Start() { timeUntilSoundCounter = timeUntilSound; player = FindObjectOfType <MovingPlayer>(); baseFireRate = fireRate; }
private void Awake() { movement2D = GetComponent <MovingPlayer>(); }
void Start() { Player = GameObject.Find("kucha"); scriptPlayer = Player.GetComponent <MovingPlayer>(); }
public void SetPlayer() { script = FindObjectOfType <MovingPlayer>(); }
// Use this for initialization void Start() { healthBar = GetComponent <Image>(); script = FindObjectOfType <MovingPlayer>(); }
void Start() { anim = GetComponent <Animator>(); motor = GetComponent <MovingPlayer>(); }