public void load_character(CharacterLoader aLoader)
    {
        NGM.mManager.mBackgroundManager.load_character(aLoader);

        FlatBodyObject flatbody = new FlatBodyObject(aLoader, -1);

        flatbody.set_target_pose(NGM.CurrentPose, true);
        flatbody.HardPosition = new Vector3(10, 0, 0);
        flatbody.update(0);
        flatbody.set_layer(1 << 1);

        flatbody.PrimaryGameObject.name = "SIMIANBODY";


        //needed to make debugviewerthing work
        var cam = mManager.gameObject.AddComponent <Camera>();

        cam.transform.position = mManager.mCameraManager.MainBodyCamera.transform.position;
        cam.transform.rotation = mManager.mCameraManager.MainBodyCamera.transform.rotation;
        cam.fieldOfView        = mManager.mCameraManager.MainBodyCamera.fieldOfView;
        cam.orthographic       = mManager.mCameraManager.MainBodyCamera.orthographic;
        cam.orthographicSize   = mManager.mCameraManager.MainBodyCamera.orthographicSize;
        Debug.Log(mManager.mCameraManager.MainBodyCamera.orthographicSize);
        cam.depth       = 9999999;
        cam.clearFlags  = CameraClearFlags.Depth;
        cam.cullingMask = 0;

        mSimian = new FarseerSimian();
        mSimian.initialize(mManager.gameObject);
        mSimian.setup_with_body(flatbody);

        //this is stupid
        mSimian.add_environment(GameObject.FindObjectsOfType(typeof(Transform)).Where(e => e.name.StartsWith("FS_")).Select(e => ((Transform)e).gameObject));
    }
Beispiel #2
0
 public void set_layer(int layer)
 {
     mLayer = layer;
     if (mFlat != null)
     {
         mFlat.set_layer(mLayer);
     }
 }