示例#1
0
    public override void Init(Character host)
    {
        base.Init(host);

        // setup transforms
        tr_player       = transform;
        tr_breastRoot   = transform.Find("Breast");
        tr_breastOrigin = tr_breastRoot.Find("Origin");
        tr_breastBody   = tr_breastRoot.Find("Body");

        rb_player = tr_player.GetComponent <Rigidbody>();
        rb_breast = tr_breastBody.GetComponent <Rigidbody>();

        // setup components
        drawer       = slaveContainer.CreateSlaveComponent <BreastDrawer>(this, tr_breastRoot.gameObject);
        constraint   = slaveContainer.CreateSlaveComponent <BreastConstraint>(this, tr_breastRoot.gameObject);
        collision    = slaveContainer.CreateSlaveComponent <BreastCollision>(this, tr_breastBody.gameObject);
        helpThruster = slaveContainer.AddExistingSlaveComponent <BreastHelpThruster>(this, tr_breastRoot.gameObject);
    }
    public override void Init(Character ch)
    {
        base.Init(ch);

        drawer          = GetComponent <BreastDrawer>();
        constraint      = GetComponent <BreastConstraint>();
        ch_rigidbody    = character.ch_rigidbody;
        breastRigidBody = GetComponent <Rigidbody>();
        springJoint     = GetComponent <SpringJoint>();

        tipTransform    = transform;
        playerTransform = tipTransform.parent;

        initMass    = breastRigidBody.mass;
        initSpringk = springJoint.spring;

        hurtBoxMask = 1 << LayerMask.NameToLayer("HurtBox");
        boobMask    = 1 << LayerMask.NameToLayer("Boob");

        drawer.Init(null);
        // TODO:
        constraint.Init(null);
    }