//Vector3 oldpos; //Vector3 newpos; void Start() { player = GetComponent<NavMeshAgent>(); anim = player.GetComponent<Animator> (); //oldpos = newpos = transform.position; }
public StateAgro(NavMeshAgent _agent, Vector3 _point, Transform _transform, ref StateSet _set) { set = _set; transform = _transform; agent = _agent; point = _point; }
// Use this for initialization void Start() { meshub = GameObject.Find("MessageHub").GetComponent<MessageHub>(); navagent = this.gameObject.GetComponent<NavMeshAgent>(); fullhealth = health; }
static public int constructor(IntPtr l) { UnityEngine.NavMeshAgent o; o = new UnityEngine.NavMeshAgent(); pushObject(l, o); return(1); }
static void NavMeshAgent_nextOffMeshLinkData(JSVCall vc) { UnityEngine.NavMeshAgent _this = (UnityEngine.NavMeshAgent)vc.csObj; var result = _this.nextOffMeshLinkData; JSMgr.datax.setObject((int)JSApi.SetType.Rval, result); }
void Awake() { // Set up the references. enemyHealth = GetComponent<EnemyHealth>(); nav = GetComponent<NavMeshAgent>(); i = 0; }
// Use this for initialization void Start() { m_Trans = transform; m_Agent = m_Trans.GetComponent<NavMeshAgent>(); m_Agent.SetDestination(new Vector3(0, 0, 0)); }
void Start() { plyr = GameObject.FindGameObjectWithTag("Player"); agent = GetComponent<NavMeshAgent>(); enemySightSeal = this.GetComponent<EnemySight>(); readInPatrol(startingRoom); }
// void Awake () { player = GameObject.FindGameObjectWithTag ("Player").transform; //playerHealth = player.GetComponent <PlayerHealth> (); //enemyHealth = GetComponent <EnemyHealth> (); nav = GetComponent <NavMeshAgent> (); }
void Start() { mobGun = GameObject.Find("mobGun"); anim = GetComponent<Animator>(); agent = GetComponent<NavMeshAgent>(); player = GameObject.Find("Player"); }
static void NavMeshAgent_isPathStale(JSVCall vc) { UnityEngine.NavMeshAgent _this = (UnityEngine.NavMeshAgent)vc.csObj; var result = _this.isPathStale; JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(result)); }
void Start() { animator = GetComponent<Animator> (); target = GameObject.Find ("Player").transform; agent = GetComponent<NavMeshAgent>(); destination = agent.destination; }
// Use this for initialization void Start() { agent = GetComponent<NavMeshAgent>(); agent.updateRotation = true; anim = GetComponent<Animator>(); target = GameObject.Find("Player").transform; }
public void Awake() { //Initialize components nav = GetComponent<NavMeshAgent>(); player = GameObject.FindWithTag("Player").transform; playerHealth = player.GetComponent<PlayerHealth>(); }
static void NavMeshAgent_pathStatus(JSVCall vc) { UnityEngine.NavMeshAgent _this = (UnityEngine.NavMeshAgent)vc.csObj; var result = _this.pathStatus; JSApi.setEnum((int)JSApi.SetType.Rval, (int)result); }
static void NavMeshAgent_remainingDistance(JSVCall vc) { UnityEngine.NavMeshAgent _this = (UnityEngine.NavMeshAgent)vc.csObj; var result = _this.remainingDistance; JSApi.setSingle((int)JSApi.SetType.Rval, (System.Single)(result)); }
PlayerHealth playerHealth; // Reference to the player's health. #endregion Fields #region Methods void Awake() { enemyHealth = GetComponent<EnemyHealth>(); nav = GetComponent<NavMeshAgent>(); animation = GetComponent<Animation>(); lebosspeutbouger = true; }
void Reset() { characterController = GetComponentInChildren<CharacterController>(); navMeshAgent = GetComponentInChildren<NavMeshAgent>(); joystickNavigationController = GetComponent<JoystickNavigationController>(); camera = GetComponentInChildren<Camera>().gameObject; }
static void NavMeshAgent_desiredVelocity(JSVCall vc) { UnityEngine.NavMeshAgent _this = (UnityEngine.NavMeshAgent)vc.csObj; var result = _this.desiredVelocity; JSApi.setVector3S((int)JSApi.SetType.Rval, result); }
// Use this for initialization void Start() { CreatureAnimator = GetComponent<Animator>(); Player = GameObject.FindGameObjectWithTag("Player"); Agente = GetComponent<NavMeshAgent>(); StartCoroutine(attack()); }
void Start() { //Check to see if times are in the correct range and order agent = GetComponent<NavMeshAgent>(); player = GameObject.FindGameObjectWithTag(Tags.player); AssertTimeOrder(); }
////////////////////////////////////////////////////////////////////////////// // // //Unity Functions // // // ////////////////////////////////////////////////////////////////////////////// void Start() { agent = GetComponent<NavMeshAgent>(); agent.speed *= Random.Range(1.2f, 0.8f); SetDestination(); }
void Start() { anim = GetComponent<Animator>(); agent = GetComponent<NavMeshAgent>(); agent.updatePosition = false; agent.autoTraverseOffMeshLink = false; }
void Start() { agent = GetComponentInChildren<NavMeshAgent> (); VP = GetComponentInParent<VehicleParent> ();//берем контроллер rigBody = GetComponent<Rigidbody> (); currentSteer = 0; }
void Start() { setWay(way); agent = GetComponent<NavMeshAgent>(); curPathIndex = 0; GoToNextPoint(); }
static public int Stop(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); if (argc == 1) { UnityEngine.NavMeshAgent self = (UnityEngine.NavMeshAgent)checkSelf(l); self.Stop(); return(0); } else if (argc == 2) { UnityEngine.NavMeshAgent self = (UnityEngine.NavMeshAgent)checkSelf(l); System.Boolean a1; checkType(l, 2, out a1); self.Stop(a1); return(0); } LuaDLL.luaL_error(l, "No matched override function to call"); return(0); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }
// Use this for initialization void Start() { dl0=GameObject.Find("dl0").transform; dm1=GameObject.Find("dm1").transform; dr2=GameObject.Find("dr2").transform; ml3=GameObject.Find("ml3").transform; mm4=GameObject.Find("mm4").transform; mr5=GameObject.Find("mr5").transform; ul6=GameObject.Find("ul6").transform; um7=GameObject.Find("um7").transform; ur8=GameObject.Find("ur8").transform; points.Add(dl0); points.Add(dm1); points.Add(dr2); points.Add(ml3); points.Add(mm4); points.Add(mr5); points.Add(ul6); points.Add(um7); points.Add(ur8); cc=GetComponent<CharacterController>(); nma=GetComponent<NavMeshAgent>(); target=mr5.position; }
static void NavMeshAgent_steeringTarget(JSVCall vc) { UnityEngine.NavMeshAgent _this = (UnityEngine.NavMeshAgent)vc.csObj; var result = _this.steeringTarget; JSApi.setVector3S((int)JSApi.SetType.Rval, result); }
void Start() { agent = GetComponent<NavMeshAgent>(); gameStatus = GameObject.FindWithTag("Respawn"); baza = GameObject.FindWithTag("Finish"); }
static void NavMeshAgent_pathEndPosition(JSVCall vc) { UnityEngine.NavMeshAgent _this = (UnityEngine.NavMeshAgent)vc.csObj; var result = _this.pathEndPosition; JSApi.setVector3S((int)JSApi.SetType.Rval, result); }
private void Start() { m_Agent = GetComponentInChildren<NavMeshAgent>(); m_Character = GetComponent<FPSController>(); m_Agent.updateRotation = true; m_Agent.updatePosition = true; }
public void Start() { GetComponent<AudioSource> ().clip = murina; agent = GetComponent<NavMeshAgent> (); agent.destination = player.position; agent.speed = turboMörkö; }
// Use this for initialization //void Start () { //} void Start() { icon = PlayerUIMgr.instance.AddHunterIcon(); icon.GetComponent<BoundObject>().SetBoundTranform(this.transform); //icon.onClick.AddListener(this.GetComponent<NvigationGame>().Select); hunter_nav = this.GetComponent<NvigationGame>(); name_text = PlayerUIMgr.instance.AddText(); name_text.GetComponent<BoundObject>().SetBoundTranform(this.transform); name_text.GetComponent<BoundObject>().SetGap(new Vector2(0,20)); hunter_name_ui = HunterListPanel.instance.AddHunterName("hunter1"); hunter_name_ui.hunter = this; SetName("hunter1"); icon.GetComponent<HunterUI>().hunter = this; floor_mask = 1 << 8 + 1 << 9 + 1 << 10; my_agent = this.transform.parent.GetComponent<NavMeshAgent>(); //追跡フラッグをoff target = null; }
// Use this for initialization void Start() { navMeshAgentCompornent = this.GetComponent<NavMeshAgent>(); startPos = targetNavMeshObjects[0].transform.localPosition; startRot = targetNavMeshObjects[0].transform.localEulerAngles; targetNavMeshObjectCounts = targetNavMeshObjects.Length -1; }
//初始化寻路代理 public void InitNavAgent() { //为了确保玩家身上一定挂有NavMeshAgent,先删除对起引用 NavAgent = null; if (NavAgent == null) { NavAgent = gameObject.GetComponent <NavMeshAgent>(); //如果玩家没有NavMeshAgent,主动给其绑定 if (NavAgent == null) { NavAgent = gameObject.AddComponent <NavMeshAgent>(); } } //初始化自动寻路 if (null != NavAgent && 0 != gameObject.transform.localScale.x) { NavAgent.enabled = true; //设置成0,否则gameobject之间会互相碰撞 NavAgent.speed = BaseAttr.MoveSpeed; NavAgent.radius = 0.0f; NavAgent.height = 2.0f / gameObject.transform.localScale.x; NavAgent.acceleration = 10000.0f; NavAgent.angularSpeed = 30000.0f; NavAgent.autoRepath = false; NavAgent.autoBraking = true; } }
void Awake() { agent = GetComponent<NavMeshAgent>(); obstacle = GetComponent<NavMeshObstacle>(); m_Animation = GetComponentInChildren<Animation>(); enemyAttack = GetComponent<EnemyAttack>(); stats = GetComponent<UnitStats>(); m_AudioSource = GetComponent<AudioSource>(); baseAttackSpeedCache = timeBetweenAttacks; switch (unitType) { case EnemyTypes.Minion: selectedAction = "Punch"; break; case EnemyTypes.Brute: selectedAction = "Slam"; break; case EnemyTypes.Evoker: selectedAction = "Shoot"; break; case EnemyTypes.Bob: selectedAction = "Explode"; break; default: break; } }
void Change() { target = GameObject.FindGameObjectWithTag ("dead").transform; nav = GetComponent <NavMeshAgent> (); nav.SetDestination (target.position); }
// Use this for initialization void Start() { destination = transform.position; navMeshAgent = GetComponent<NavMeshAgent> (); animator = GetComponent<Animator> (); target = GameObject.FindGameObjectWithTag ("Player"); }
protected override void OnGameStart(SceneScript scene) { agent = GetComponent<NavMeshAgent>(); detection = GetComponentInChildren<AIRangeDetection>(); detection.Load(this); }
// Use this for initialization void Start () { agent = GetComponent < NavMeshAgent > (); player = GameObject.Find ("Player"); agent.updateRotation = false; //InvokeRepeating("spawn", spawnDelay, spawnDelay); }
public override void OnEnter() { agent = ownerDefault.GetComponent <UnityEngine.NavMeshAgent> (); float angle = FindAngle(ownerDefault.transform.forward, agent.desiredVelocity, ownerDefault.transform.up); float v = angle / responseTime; owner.SetFloat(angularSpeed, v); }
static public int set_nextPosition(IntPtr l) { UnityEngine.NavMeshAgent o = (UnityEngine.NavMeshAgent)checkSelf(l); UnityEngine.Vector3 v; checkType(l, 2, out v); o.nextPosition = v; return(0); }
static public int set_path(IntPtr l) { UnityEngine.NavMeshAgent o = (UnityEngine.NavMeshAgent)checkSelf(l); UnityEngine.NavMeshPath v; checkType(l, 2, out v); o.path = v; return(0); }
static public int set_obstacleAvoidanceType(IntPtr l) { UnityEngine.NavMeshAgent o = (UnityEngine.NavMeshAgent)checkSelf(l); UnityEngine.ObstacleAvoidanceType v; checkEnum(l, 2, out v); o.obstacleAvoidanceType = v; return(0); }
static public int set_velocity(IntPtr l) { UnityEngine.NavMeshAgent o = (UnityEngine.NavMeshAgent)checkSelf(l); UnityEngine.Vector3 v; checkType(l, 2, out v); o.velocity = v; return(0); }
static public int set_walkableMask(IntPtr l) { UnityEngine.NavMeshAgent o = (UnityEngine.NavMeshAgent)checkSelf(l); int v; checkType(l, 2, out v); o.walkableMask = v; return(0); }
static public int set_autoTraverseOffMeshLink(IntPtr l) { UnityEngine.NavMeshAgent o = (UnityEngine.NavMeshAgent)checkSelf(l); bool v; checkType(l, 2, out v); o.autoTraverseOffMeshLink = v; return(0); }
static public int set_acceleration(IntPtr l) { UnityEngine.NavMeshAgent o = (UnityEngine.NavMeshAgent)checkSelf(l); float v; checkType(l, 2, out v); o.acceleration = v; return(0); }
static public int set_angularSpeed(IntPtr l) { UnityEngine.NavMeshAgent o = (UnityEngine.NavMeshAgent)checkSelf(l); float v; checkType(l, 2, out v); o.angularSpeed = v; return(0); }
static public int set_height(IntPtr l) { UnityEngine.NavMeshAgent o = (UnityEngine.NavMeshAgent)checkSelf(l); float v; checkType(l, 2, out v); o.height = v; return(0); }
static public int set_updateRotation(IntPtr l) { UnityEngine.NavMeshAgent o = (UnityEngine.NavMeshAgent)checkSelf(l); bool v; checkType(l, 2, out v); o.updateRotation = v; return(0); }
static public int set_stoppingDistance(IntPtr l) { UnityEngine.NavMeshAgent o = (UnityEngine.NavMeshAgent)checkSelf(l); float v; checkType(l, 2, out v); o.stoppingDistance = v; return(0); }
static public int set_avoidancePriority(IntPtr l) { UnityEngine.NavMeshAgent o = (UnityEngine.NavMeshAgent)checkSelf(l); int v; checkType(l, 2, out v); o.avoidancePriority = v; return(0); }
static public int set_autoRepath(IntPtr l) { UnityEngine.NavMeshAgent o = (UnityEngine.NavMeshAgent)checkSelf(l); bool v; checkType(l, 2, out v); o.autoRepath = v; return(0); }
static public int get_autoTraverseOffMeshLink(IntPtr l) { try { UnityEngine.NavMeshAgent self = (UnityEngine.NavMeshAgent)checkSelf(l); pushValue(l, self.autoTraverseOffMeshLink); return(1); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }
static public int CompleteOffMeshLink(IntPtr l) { try { UnityEngine.NavMeshAgent self = (UnityEngine.NavMeshAgent)checkSelf(l); self.CompleteOffMeshLink(); return(0); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }
static public int get_pathStatus(IntPtr l) { try { UnityEngine.NavMeshAgent self = (UnityEngine.NavMeshAgent)checkSelf(l); pushEnum(l, (int)self.pathStatus); return(1); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }
static public int get_updatePosition(IntPtr l) { try { UnityEngine.NavMeshAgent self = (UnityEngine.NavMeshAgent)checkSelf(l); pushValue(l, self.updatePosition); return(1); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }
static public int get_obstacleAvoidanceType(IntPtr l) { try { UnityEngine.NavMeshAgent self = (UnityEngine.NavMeshAgent)checkSelf(l); pushEnum(l, (int)self.obstacleAvoidanceType); return(1); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }
static public int get_avoidancePriority(IntPtr l) { try { UnityEngine.NavMeshAgent self = (UnityEngine.NavMeshAgent)checkSelf(l); pushValue(l, self.avoidancePriority); return(1); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }