Here are the examples of the csharp api FoodManager.areCrossing(UnityEngine.Vector2, UnityEngine.Vector2, UnityEngine.Vector2, UnityEngine.Vector2) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
19
View Source File : FoodManager.cs
License : MIT License
Project Creator : BelkinAndrey
License : MIT License
Project Creator : BelkinAndrey
void Smell()
{
Vector2 L1 = head.GetComponent<HeadTadpole>().pointL1.transform.position;
Vector2 L2 = head.GetComponent<HeadTadpole>().pointL2.transform.position;
Vector2 FL = head.GetComponent<HeadTadpole>().LF.transform.position;
Vector2 FR = head.GetComponent<HeadTadpole>().RF.transform.position;
Vector2 FoodPoint = transform.position;
if (!areCrossing(L1, L2, FL, FoodPoint))
{
float distanceL = Vector2.SqrMagnitude(FoodPoint - FL);
if (distanceL < 300000)
{
if (Mathf.RoundToInt(distanceL / 3000) == 0) manager.GetComponent<IndicatorFlair>().LeftUp();
else
if (counter % Mathf.RoundToInt(distanceL / 3000) == 0)
{
manager.GetComponent<IndicatorFlair>().LeftUp();
}
}
}
if (!areCrossing(L1, L2, FR, FoodPoint))
{
float distanceR = Vector2.SqrMagnitude(FoodPoint - FR);
if (distanceR < 300000)
{
if (Mathf.RoundToInt(distanceR / 3000) == 0) manager.GetComponent<IndicatorFlair>().RightUp();
else
if (counter % Mathf.RoundToInt(distanceR / 3000) == 0)
{
manager.GetComponent<IndicatorFlair>().RightUp();
}
}
}
counter++;
if (counter > 10000000) counter = 1;
}