// Start is called before the first frame update void Start() { WeaponH = gameObject.transform.GetChild(0).gameObject; plyGotScript = gameObject.GetComponent <PlayerGotHit>(); TimeStart = -10; TimeEnd = -10; isAttackingMelee = false; inicial_size = new Vector2(m_collider.size.x, m_collider.size.y); }
// Start is called before the first frame update void Start() { //Setamos todos para os componentes deste Rigidbody rb = this.gameObject.GetComponent <Rigidbody2D>(); animator = this.gameObject.GetComponent <Animator>(); playerHitScript = gameObject.GetComponent <PlayerGotHit>(); //selecionamos a posicao inicial; int default_ = PlayerPrefs.GetInt("use_position"); if (default_ == 1) { Debug.Log("Using Position"); float x_position = PlayerPrefs.GetFloat("x_position"); float y_position = PlayerPrefs.GetFloat("y_position"); Vector3 newpos = new Vector3(x_position, y_position, -9); this.gameObject.transform.position = newpos; PlayerPrefs.SetInt("use_position", 0); } }
void Awake() { playerMScript = GameObject.Find("player").GetComponent <playermelee>(); playerGHScript = GameObject.Find("player").GetComponent <PlayerGotHit>(); }