Esempio n. 1
0
    void Start()
    {
        script         = GameObject.Find("ScoreManager").GetComponent <ScoreScriptLocal> ();
        script.mycolor = _renderer.material.color;
        script.isColor = true;
        player         = transform.parent;

        for (int i = 0; i < max; i++)
        {
            tofus [i] = Instantiate(tofu, okiba, Quaternion.identity) as GameObject;
            tofus [i].GetComponent <Renderer> ().material.color = script.mycolor;
            inGround [i]   = false;
            tofuScript [i] = tofus [i].GetComponent <TofuScriptLocal> ();
        }
        //ChargeObj = GameObject.FindGameObjectWithTag ("Charge");
    }
    // 初期化
    void Start()
    {
        // Animatorコンポーネントを取得する
        anim = GetComponent <Animator> ();
        // CapsuleColliderコンポーネントを取得する(カプセル型コリジョン)
        col = GetComponent <CapsuleCollider> ();
        rb  = GetComponent <Rigidbody> ();
        //メインカメラを取得する
        cameraObject = GameObject.FindWithTag("MainCamera");
        // CapsuleColliderコンポーネントのHeight、Centerの初期値を保存する
        orgColHight      = col.height;
        orgVectColCenter = col.center;

        script = GameObject.Find("ScoreManager").GetComponent <ScoreScriptLocal> ();
        source = GetComponent <AudioSource> ();
    }
Esempio n. 3
0
    // 初期化
    void Start()
    {
        // Animatorコンポーネントを取得する
        anim = GetComponent <Animator> ();
        // CapsuleColliderコンポーネントを取得する(カプセル型コリジョン)
        col = GetComponent <CapsuleCollider> ();
        rb  = GetComponent <Rigidbody> ();
        //メインカメラを取得する
        //cameraObject = GameObject.FindWithTag ("MainCamera");
        // CapsuleColliderコンポーネントのHeight、Centerの初期値を保存する
        orgColHight      = col.height;
        orgVectColCenter = col.center;

        script = GameObject.Find("ScoreManager").GetComponent <ScoreScriptLocal> ();
        source = GetComponent <AudioSource> ();

        /*points = new Transform[point.transform.childCount];
         * for (int i = 0; i < points.Length; i++) {
         *      points [i] = point.transform.GetChild (i).transform;
         * }*/
        GameObject[] points = GameObject.FindGameObjectsWithTag("StartPoint");
        destinaton = points [Random.Range(0, points.Length)].transform.position;
    }
Esempio n. 4
0
 // Use this for initialization
 void Start()
 {
     script        = GameObject.Find("ScoreManager").GetComponent <ScoreScriptLocal> ();
     myColorNumber = script.mycolor.r + script.mycolor.b * 10 + script.mycolor.g * 100;
     rb            = GetComponent <Rigidbody> ();
 }