Example #1
0
    public void Awake()
    {
        _networkLocomotionComponentViewRPC = FindReplicationViewForComponent <NetworkLocomotionComponent>();
        _locomotion    = GetComponent <LocomotionComponentAPP>();
        _rvoController = GetComponent <RVOController>();

        _isCurrentlyLocal = AmILocal();
        _currentOwnerId   = _networkLocomotionComponentViewRPC.ownerId;
    }
Example #2
0
        // start the swivel
        private void StartSwivel(Vector3 dir)
        {
            LocomotionComponentAPP loco = player.GetComponent <LocomotionComponentAPP>();

            if (null != loco)
            {
                loco.LookAtPosition(player.transform.position + dir, true);
            }
        }
Example #3
0
 static public void OrientFacing(GameObject orient, GameObject lookAt)
 {
     if (null != orient && null != lookAt)
     {
         LocomotionComponentAPP loco = orient.GetComponent <LocomotionComponentAPP>();
         if (null != loco)
         {
             loco.LookAtPosition(lookAt.transform.position, true);
             Interaction activeInteraction = Dialogue.GetActiveInteraction();
             if (null != activeInteraction)
             {
                 activeInteraction.LockCharacterRotation(loco);
             }
         }
     }
 }
Example #4
0
    // lock a character's rotation
    public void LockCharacterRotation(LocomotionComponentAPP loco)
    {
        if (null != loco)
        {
            int index = _charactersInfo.FindIndex(charInfo => charInfo.gameObj == loco.gameObject);

            if (index < 0 || index >= _charactersInfo.Count)             // out of range
            {
                _charactersInfo.Add(new InteractionCharacterInfo(loco.gameObject, loco));
            }
            else if (loco != _charactersInfo[index].loco)             // update existing entry
            {
                InteractionCharacterInfo info = _charactersInfo[index];
                info.loco = loco;
                _charactersInfo[index] = info;
            }
            loco.ExclusivelyRotate(true);
        }
    }
Example #5
0
        //public NPCStatsComponent stats;

        public InteractionCharacterInfo(GameObject gameObj, LocomotionComponentAPP loco)
        {
            this.gameObj = gameObj;
            this.loco    = loco;
        }