示例#1
0
    // at the start: //
    private void Start()
    {
        // track the locomotions managed by the hand's Locomotions Cycler as being managed by both Locomotions Cyclers //
        foreach (LocomotionCombination locomotionCombination in combinations)
        {
            foreach (GameObject cyclerManagedLocomotion in locomotionCombination.array)
            {
                if (!managedLocomotions.Contains(cyclerManagedLocomotion))
                {
                    managedLocomotions.Add(cyclerManagedLocomotion);
                }
            }
        }
        // track the locomotions that are children of the hand as being managed by both Locomotions Cyclers //
        foreach (GameObject handChildLocomotion in gameObject.localAndChildrenObjectsWithI <ILocomotion>())
        {
            if (managedLocomotions.doesNotContain(handChildLocomotion))
            {
                managedLocomotions.include(handChildLocomotion);
            }
        }
        // track the locomotions that are children of the player as being managed by both Locomotions Cyclers //
        foreach (GameObject playerChildLocomotion in MarsMotionPlayer.localAndChildrenObjectsWithI <ILocomotion>())
        {
            if (managedLocomotions.doesNotContain(playerChildLocomotion))
            {
                managedLocomotions.include(playerChildLocomotion);
            }
        }

        // track the other Locomotions Cycler instance //
        other = (leftInstance ? right : left);

        // refresh the locomotions //
        refreshLocomotions();
    }
示例#2
0
    // methods //


    // method: dash to the given raycast hit //
    private void dashTo(RaycastHit raycastHit)
    {
        MarsMotionPlayer.zeroVelocities();
        MarsMotionPlayer.setPositionForMovingBodyPositionTo(raycastHit);
    }