Resume() private method

private Resume ( ) : void
return void
Esempio n. 1
0
    void Update()
    {
        player = sCharactersManager.characters[0].gameObject;
        agent = GetComponent<NavMeshAgent>();
        if(!gameObject.GetComponent<Character>().isDead)
        {
            if(agent.isOnNavMesh)
            {
                agent.SetDestination(player.transform.position);
                if(Vector3.Distance(player.transform.position,transform.position) > 1.5f)
                {
                    agent.Resume();
                }else{
                    agent.Stop();
                }
            }

            if(Vector3.Distance(player.transform.position,transform.position) < 5)
            {
                Vector3 lookPos = new Vector3(player.transform.position.x, gameObject.transform.position.y, player.transform.position.z);
                gameObject.transform.LookAt(lookPos);
            }
        }else{
            agent.Stop();
        }
    }
Esempio n. 2
0
 static public int Resume(IntPtr l)
 {
     try {
         UnityEngine.NavMeshAgent self = (UnityEngine.NavMeshAgent)checkSelf(l);
         self.Resume();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 3
0
 static public int Resume(IntPtr l)
 {
     try {
         UnityEngine.NavMeshAgent self = (UnityEngine.NavMeshAgent)checkSelf(l);
         self.Resume();
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Esempio n. 4
0
 static int Resume(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityEngine.NavMeshAgent obj = (UnityEngine.NavMeshAgent)ToLua.CheckObject(L, 1, typeof(UnityEngine.NavMeshAgent));
         obj.Resume();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 5
0
    public void AnimateNavMesh(NavMeshAgent nmAgent)
    {
        if (nmAgent.isOnOffMeshLink && !isJumping)
        {
            isJumping = true;
        }
        else
        {
            nmAgent.CompleteOffMeshLink();
            nmAgent.Resume();
            isJumping = false;
        }

        if (Vector3.Distance(transform.position, nmAgent.destination) > 0.5f)
        {
            Animate(0.0f, 0.5f);
            reset = true;
        }
        else if (reset)
        {
            Animate(0.0f, 0.0f);
            reset = false;
        }
    }