void Start() { goal = GameObject.FindWithTag("goal"); reset = goal.GetComponent <reset3>(); Player = GameObject.Find("Player"); //Playerという名前のオブジェクトを探しPlayerに入れる script = Player.GetComponent <PlayerController>(); //PlayerControllerというスクリプトの情報をscriptにいれる Transform startTransform = this.transform; //このスクリプトをアタッチしているオブジェクトのトランスフォームを読み込む Vector2 startpos = startTransform.position; //読み込んだトランスフォームのポジションをVector2 posに入れる startX = (float)startpos.x; startY = (float)startpos.y; }
void Start() { goal = GameObject.FindWithTag("goal"); reset = goal.GetComponent <reset3>(); rd2d = GetComponent <Rigidbody2D>(); boxCollider = GetComponent <BoxCollider2D>(); animator = GetComponent <Animator>(); //Component取得 audioSource = GetComponent <AudioSource>(); anim = GetComponent <Animator>(); Player = GameObject.Find("Player"); //Playerという名前のオブジェクトを探しPlayerに入れる script = Player.GetComponent <ModeChange>(); dm = GetComponent <damegeAnimation>(); }
private void Start() { goal = GameObject.FindWithTag("goal"); reset = goal.GetComponent <reset3>(); anim = GetComponent <Animator>(); Enemyobj = GameObject.Find("hanntei"); jer = Enemyobj.GetComponent <junnkaiEnemyroot>(); my = this.transform; pos = my.position; timemove = 0.0f; moveflg = false; Vector2 startpos = my.position; //読み込んだトランスフォームのポジションをVector2 posに入れる startX = (int)startpos.x; startY = (int)startpos.y; }