Exemple #1
0
 public PlayerHandBehaviours(PlayerBehaviours abb, PropHandler ph, FBIKChain hc, IKEffector iKEffector) : base(abb, ph)
 {
     handChain    = hc;
     hp           = ac.humanoidParts;
     handEffector = iKEffector;
     //Muscle handMuscle = ph.attachedMuscleGroup.muscles[ph.attachedMuscleGroup.muscles.Length - 1];// 最后一个位置即为 最末尾的 hand 的 muscle
 }
Exemple #2
0
    //public override Animation
    public override void Init(ActorManager am)
    {
        base.Init(am);
        HumanoidParts temp = new HumanoidParts(am.puppet);

        temp.aimPart   = humanoidParts.aimPart;
        temp.rigidRoot = humanoidParts.rigidRoot;
        humanoidParts  = temp;
    }
Exemple #3
0
    // 消息函数
    public override void Init(ActorManager am)
    {
        base.Init(am);
        // 变量初始化
        HumanoidParts temp = new HumanoidParts(am.puppet);

        temp.aimPart    = humanoidParts.aimPart;
        temp.rigidRoot  = humanoidParts.rigidRoot;
        humanoidParts   = temp;
        animationHash   = new AnimationHash(animator);
        actorBehaviours = new PlayerBehaviours(this, new FBIKChain[] { fullBodyBipedIK.solver.rightArmChain }, new IKEffector[] { fullBodyBipedIK.solver.rightHandEffector });

        // 事件的绑定:
        MessageManager.AddListener("OnStabIn", OnStabIn, transform);
    }
    protected override void Awake()
    {
        // Setting up references.
        base.Awake();
        _parts = GetComponent <HumanoidParts>();

        // Instance the foot physics material so that we can adjust it without affecting other users of the same material
        var footMat = _parts.footR.GetComponent <Collider2D>().sharedMaterial;

        _footFrictionMat = new PhysicsMaterial2D(footMat.name + " (Instance)")
        {
            friction = footMat.friction
        };
        _parts.footR.GetComponent <Collider2D>().sharedMaterial = _footFrictionMat;
        _parts.footL.GetComponent <Collider2D>().sharedMaterial = _footFrictionMat;

        _grabDownDist = grabDistance * grabDownDistMult;
        _initLayer    = gameObject.layer;
    }
Exemple #5
0
 public PlayerBodyBehaviours(PlayerBehaviours abb) : base(abb)
 {
     hp = abb.ac.humanoidParts;
 }