本文整理汇总了C#中Seeker类的典型用法代码示例。如果您正苦于以下问题:C# Seeker类的具体用法?C# Seeker怎么用?C# Seeker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Seeker类属于命名空间,在下文中一共展示了Seeker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
/** Use this for initialization */
public void Start () {
seeker = GetComponent<Seeker>();
controller = GetComponent<CharacterController>();
tr = transform;
Repath();
}
示例2: Start
void Start()
{
_seeker = GetComponent<Seeker>();
_characterController = GetComponent<CharacterController>();
_compass = transform.Find("Compass");
}
示例3: Update
// Update is called once per frame
void Update () {
if(Vector3.Distance(transform.position,player.position)<10){
sighted = true;
target = player.position;
Debug.Log(sighted);
}
float distA = Vector3.Distance(transform.position,pointA.position);
float distB = Vector3.Distance(transform.position,pointB.position);
if(distA<2){
atA = true;
atB = false;
target = pointB.position;
}
if(distB<2){
atB = true;
atA = false;
target = pointA.position;
}
if(Time.time > curTime+waitTime){
seeker = GetComponent<Seeker>();
seeker.StartPath(transform.position,target,OnPathComplete);
charctlr = GetComponent<CharacterController>();
curTime = Time.time;
}
}
示例4: Start
void Start () {
pathFinder = GetComponent<Seeker>();
pathFinder.StartPath(transform.position, SceneManager.Instance.creeperTargetPosition);
var waveMultiplier = 1 + (SceneManager.Instance.WaveCount / 5f);
life *= waveMultiplier;
GetComponent<AIPath>().speed *= waveMultiplier;
}
示例5: Start
void Start()
{
var distanceFirstPlayer = Vector3.Distance(firstPlayer.transform.position, transform.position);
var distanceSecondPlayer = Vector3.Distance(secondPlayer.transform.position, transform.position);
if (distanceFirstPlayer > distanceSecondPlayer)
{
target = secondPlayer;
}
else
{
target = firstPlayer;
}
startTime = Time.time;
seeker = GetComponent<Seeker>();
rb = GetComponent<Rigidbody2D>();
if (target == null)
{
Debug.Log("pesho");
return;
}
seeker.StartPath(transform.position, target.position, OnPathComplete);
StartCoroutine(UpdatePath());
}
示例6: Start
void Start ()
{
target = GameObject.Find("Player");
cachedTargetPosition = new Vector3(target.transform.position.x,target.transform.position.y,target.transform.position.z);
seeker = GetComponent<Seeker> ();
characterController = GetComponent<CharacterController>();
switch (currentMode) {
case MODE.STRAIGHT:
seeker.StartPath (this.transform.position, target.transform.position, OnPathComplete);
isSearching = true;
break;
case MODE.HUNT:
seeker.StartPath (this.transform.position, target.transform.position, OnPathComplete);
isSearching = true;
break;
case MODE.HIDE:
if(isInLOS()){
Vector3 hidingPoint = findHidingPoint();
seeker.StartPath (this.transform.position, hidingPoint, OnPathComplete);
isSearching = true;
};
break;
default:
break;
}
}
示例7: Start
public void Start ()
{
seeker = GetComponent<Seeker>();
body = GetComponent<Rigidbody2D>();
//Start a new path to the targetPosition, return the result to the OnPathComplete function
seeker.StartPath(body.position,target.position,OnPathComplete );
}
示例8: Start
public void Start()
{
seeker = GetComponent<Seeker>();
controller = GetComponent<CharacterController>();
//Start a new path to the targetPosition, return the result to the OnPathComplete function
seeker.StartPath(transform.position, targetPosition, OnPathComplete);
}
示例9: Start
// Use this for initialization
void Start () {
//target = GameObject.FindGameObjectWithTag("Target").transform;
seeker = GetComponent<Seeker>();
seeker.StartPath (transform.position, target.position, OnPathComplete);
}
示例10: Start
// Use this for initialization
void Start()
{
oldPosition = targetPosition;
seeker = GetComponent<Seeker>();
StartCoroutine(repathTime());
seeker.StartPath(transform.position,GameObject.Find("Player").transform.position,OnPathComplete);
}
示例11: Start
public void Start()
{
seeker = GetComponent<Seeker>();
controller = GetComponent<CharacterController>();
FindTarget();
StartCoroutine(GetNewPath());
}
示例12: Start
void Start()
{
m_Seeker = GetComponent<Seeker>();
m_Seeker.pathCallback += OnPathComplete;
m_Path = GetComponent<AIPath>();
m_Path.MoveComplete += OnMoveComplete;
}
示例13: AddSeeker
public int AddSeeker(LoginSeeker ObjSeeker, Seeker Objs)
{
try
{
_unitOfWork.Repository<Seeker>().Insert(Objs);
// _unitOfWork.Save();
ObjSeeker.SeekerID = _unitOfWork.Repository<Seeker>().GetAll().Where(c => c.EmailID == Objs.EmailID).Select(c => c.SeekerID).FirstOrDefault();
_unitOfWork.Repository<LoginSeeker>().Insert(ObjSeeker);
_unitOfWork.Save();
return 1;
}
catch (Exception)
{
return 0;
}
//using (JobASPContext context = new JobASPContext())
//{
// try
// {
// context.Seekers.Add(Objs);
// context.SaveChanges();
// ObjSeeker.SeekerID = context.Seekers.Where(c => c.EmailID == Objs.EmailID).Select(c => c.SeekerID).FirstOrDefault();
// context.LoginSeeker.Add(ObjSeeker);
// context.SaveChanges();
// return 1;
// }
// catch (Exception)
// {
// return 0;
// }
//}
}
示例14: Start
void Start()
{
GameObject goItemManager = GameObject.FindGameObjectsWithTag("GameManager").FirstOrDefault( (go) => go.name == "Item Manager" );
if( null == goItemManager )
Debug.LogError( "Failed to find Item Manager game object");
else
m_Inventory = new Inventory( goItemManager.GetComponent<InventoryManager>() );
m_Path = GetComponent<AIPath>();
m_Seeker = GetComponent<Seeker>();
// Find the start locator and set our position/orientation
if( !string.IsNullOrEmpty( m_StartLocatorName ) )
{
GameObject[] locators = GameObject.FindGameObjectsWithTag( "Locator" );
if( locators.Length > 0 )
{
GameObject startLocator = locators.FirstOrDefault( (i) => { return i.name == m_StartLocatorName; } );
if( null != startLocator )
{
transform.position = startLocator.transform.position;
transform.rotation = startLocator.transform.rotation;
}
}
}
}
示例15: Start
// Use this for initialization
void Start () {
instance = this;
ConsoleControl.Log("Start called");
float theBeforeTime = Time.realtimeSinceStartup;
/*for (int i = 0; i < floors.Length; i++){
floors[i].Id = i+1;
//floors[i].make();
}*/
line = this.GetComponent<LineRenderer>();//get a reference to the line
seeker = GetComponent<Seeker>();
//astarPath = GetComponent<AstarPath>();
//logs["Getting components"] = Time.realtimeSinceStartup - theBeforeTime;
//logs["Set active floor"] = Time.realtimeSinceStartup - theBeforeTime;
//add the waypoints to the graph
//float thebeforetime = Time.realtimeSinceStartup;
PlayerPrefs.SetString("MarkerSave", "");
MapLabel.loadMarkers();
//logs["Initial marker load"] = Time.realtimeSinceStartup - theBeforeTime;
if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork){
startMarkerUpdate();
}
//logs["Start update of markers"] = Time.realtimeSinceStartup - theBeforeTime;
logs["Startup time"] = Time.realtimeSinceStartup - theBeforeTime;
setLogs();
}