Пример #1
0
    }                                                   // スピードの実効値を取得する。ストッピング計算に使用するだけなので、微妙。



    // メッシュ単一化(使わなくてもいい) ----------------------------------------------

    public virtual GameObject combineMesh(bool isForcePackTexture = false)
    {
        var tfmeshbody = transform.Find("body/Mesh");


        var meshbody = tfmeshbody.gameObject;


        if (isForcePackTexture)
        // 単体でテクスチャをパックしてしまうか
        {
            var tpacker = new TexturePacker();

            tpacker.regist(meshbody);

            tpacker.packTextures();
        }


        var csm = new CombineSkinnedMesh();

        csm.combine(meshbody);

        csm.addRenderer(meshbody, Shader.Find("Custom/SkinnedMesh_1bone_nolit"));


        return(meshbody);
    }
Пример #2
0
    // 初期化 ---------------------------------

    //protected override void deepInit()
    new protected void Awake()
    {
        base.Awake();



        var meshbody = tf.Find("body/Mesh").gameObject;
        var tpacker  = new TexturePacker();       //3();

        tpacker.regist(meshbody);
        tpacker.packTextures();
        var csm = new CombineSkinnedMesh();

        csm.combine(meshbody);
        csm.addRenderer(meshbody, Shader.Find("Custom/SkinnedMesh_1bone_nolit"));
        tfBody.gameObject.SetActive(false);
        tfBody.gameObject.SetActive(true);

        //ragdoll = GetComponentInChildren<PlayerRagdoll>();
        ragdoll = tfBody.getComponentInDirectChildren <RagdollSwitcher>();

        //ragdoll.setup( this );
        ragdoll.deepInit(tfBody.getComponentInDirectChildren <SkinnedMeshRender>(), ragdoll.transform);


        wall.setup();


        figure.setup(this);



        cam = GameObject.Find("players/camera base").GetComponent <PlayerCamera>();

        cam.init(rb, tfBody.Find("base/chest/head").GetComponent <Rigidbody>(), rb.rotation.eulerAngles.y, 0.0f);


        initMotions();



        playerShoot = GetComponentInChildren <_PlayerShoot3>();

        playerShoot.deepInit(this);
    }