Exemple #1
0
    static int SetLayerCost(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 3);
        NavMeshAgent obj  = LuaScriptMgr.GetNetObject <NavMeshAgent>(L, 1);
        int          arg0 = (int)LuaScriptMgr.GetNumber(L, 2);
        float        arg1 = (float)LuaScriptMgr.GetNumber(L, 3);

        obj.SetLayerCost(arg0, arg1);
        return(0);
    }
        public void SetAgro(Transform target)
        {
            var health = GetComponent <EnemyHealth>();

            if (health.currentHealth <= 0)
            {
                return;
            }

            if (target == null)
            {
                this.target = fountain;
                nav.SetLayerCost(4, 10);
            }
            else
            {
                this.target = target;
                nav.SetLayerCost(4, 1);
            }
        }
Exemple #3
0
        void DoSetLayerCost()
        {
            if (_agent == null)
            {
                return;
            }

            int layerId = layer.Value;

            if (ORlayerName.Value != "")
            {
                layerId = NavMesh.GetNavMeshLayerFromName(ORlayerName.Value);
            }

            _agent.SetLayerCost(layerId, cost.Value);
        }