Exemplo n.º 1
0
    private void MoveTo()
    {
        Corditanes Delta = new Corditanes();

        Delta.SetCoordinates(SityGenerator.Instance.ArrayOfSity[SityGoalID].SityPlace.SDegree - SityGenerator.Instance.ArrayOfSity[SityID].SityPlace.SDegree, SityGenerator.Instance.ArrayOfSity[SityGoalID].SityPlace.DDegree - SityGenerator.Instance.ArrayOfSity[SityID].SityPlace.DDegree);
        if (Delta.DDegree > 180)
        {
            Delta.DDegree = -360 + Delta.DDegree;
        }
        if (Delta.DDegree < -180)
        {
            Delta.DDegree = 360 + Delta.DDegree;
        }
        Corditanes Step = new Corditanes();

        Step.SetCoordinates(Delta.SDegree / Setting.Instance.Speed, Delta.DDegree / Setting.Instance.Speed);
        Place.SetCoordinates(Place.SDegree + Step.SDegree, Place.DDegree + Step.DDegree);
        UpdatePosition();
    }
Exemplo n.º 2
0
 public void SetInsect(int InsectID, string IName, float Pheromone, float Regen = 0)
 {
     SityID        = 0;
     SityGoalID    = 0;
     ID            = InsectID;
     InsectName    = IName;
     PheromoneLeft = Pheromone;
     Regeneration  = Regen;
     Place         = new Corditanes();
     Place.SetCoordinates(SityGenerator.Instance.ArrayOfSity[SityID].SityPlace.SDegree, SityGenerator.Instance.ArrayOfSity[SityID].SityPlace.DDegree);
     Memory       = new List <int>();
     InsectObject = this.gameObject;
     UpdatePosition();
     UpdateMemory();
 }
Exemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     Cord1.SetCoordinates(SH1, DL1);
     Cord2.SetCoordinates(SH2, DL2);
     Debug.Log(Corditanes.Distance(Cord1, Cord2));
 }