// Use this for initialization void Start() { // ヒット情報を送る親オブジェクトを設定 GameObject playerEat = gameObject.transform.parent.gameObject; sendCollider = playerEat.GetComponent <PlayerEat>(); }
public void Start() { #region GetComponents player = GetComponent <Player>(); playerMove = GetComponent <PlayerMove>(); playerRotate = GetComponent <PlayerRotate>(); playerEat = GetComponent <PlayerEat>(); playerPlay = GetComponent <PlayerPlay>(); playerIdle = GetComponent <PlayerIdle>(); tweens = GetComponent <Tweens>(); #endregion //player.spawnedPlayer.gameObject.transform.localScale = new Vector3(Random.Range(0, 10), Random.Range(0, 10), Random.Range(0, 10)); }
public void NotifyPlayerGotAway() { if (alertState == AlertState.Caught) { return; } alertState = AlertState.GotAway; PlayerEat playerEat = FindObjectOfType <PlayerEat>(); int escapeBonus = (int)(playerEat.calories * escapeBonusRatio); gotAwayText.color = new Color(gotAwayText.color.r, gotAwayText.color.g, gotAwayText.color.b, 255); gotAwayText.text = MakeGotAwayText(playerEat.calories, escapeBonus); playerEat.calories += escapeBonus; dogText.text.text = ""; Invoke("LoadMainMenu", 5.0f); }
// Use this for initialization void Start() { playerMove = GetComponent <PlayerMoveJoystick>(); playerEat = GetComponent <PlayerEat>(); }