Ejemplo n.º 1
0
    public void ConnectHandToHandTarget(CActorArm oActorArm)
    {
        //###IMPROVE: smooth progression to target (sin)

        _oActorArm = oActorArm;
        //_nTimeNextPosChange = -1;
        if (_oActorArm != null) {
            oActorArm.transform.parent = transform;					// Reparent to the hand target's node so we move/rotate along with the node
            oActorArm.transform.localPosition = Vector3.zero;
            oActorArm.transform.localRotation = Quaternion.identity;
            oActorArm._oObj.PropSet(EActorArm.Pinned, 1);			// Hand target now in requested position.  Pin to make it move
            //GetNextRandomVector();
            enabled = true;
        } else {
            enabled = false;
        }
    }
Ejemplo n.º 2
0
    public void Body_InitActors()
    {
        //=== Fetch the body part components, assign them to easy-to-access variables (and a collection for easy iteration) and initialize them by telling them their 'side' ===
        _aActors.Add(_oActor_Base	= CUtility.FindChild(_oBodyBase._oBodyRootGO.transform, "Base")					.GetComponent<CActorNode>());
        _aActors.Add(_oActor_Torso	= CUtility.FindChild(_oBodyBase._oBodyRootGO.transform, "Base/Torso")			.GetComponent<CActorNode>());
        _aActors.Add(_oActor_Chest	= CUtility.FindChild(_oBodyBase._oBodyRootGO.transform, "Base/Torso/Chest")		.GetComponent<CActorChest>());
        _aActors.Add(_oActor_Pelvis	= CUtility.FindChild(_oBodyBase._oBodyRootGO.transform, "Base/Torso/Pelvis")	.GetComponent<CActorPelvis>());
        _aActors.Add(_oActor_ArmL	= CUtility.FindChild(_oBodyBase._oBodyRootGO.transform, "Base/ArmL")			.GetComponent<CActorArm>());
        _aActors.Add(_oActor_ArmR	= CUtility.FindChild(_oBodyBase._oBodyRootGO.transform, "Base/ArmR")			.GetComponent<CActorArm>());
        _aActors.Add(_oActor_LegL	= CUtility.FindChild(_oBodyBase._oBodyRootGO.transform, "Base/LegL")			.GetComponent<CActorLeg>());
        _aActors.Add(_oActor_LegR	= CUtility.FindChild(_oBodyBase._oBodyRootGO.transform, "Base/LegR")			.GetComponent<CActorLeg>());

        foreach (CActor oActor in _aActors)
            oActor.OnStart(this);
    }