예제 #1
0
 public void SetDragged(GearArea newGearArea, Sprite newIcon)
 {
     gearArea = newGearArea;
     SetGearArea();
     spriteRenderer = gameObject.AddComponent <SpriteRenderer> ();
     spriteRenderer.sortingLayerName = "Gear";
     spriteRenderer.sortingOrder     = 10;
     icon                  = newIcon;
     followMouse           = true;
     spriteRenderer.sprite = icon;
 }
예제 #2
0
파일: Gear.cs 프로젝트: ccadori/mecha
 //Editor
 public virtual void SetGearArea(GearArea newGearArea)
 {
     gearArea = newGearArea;
     foreach (Vector2 pos in gearArea.addArea)
     {
         Vector2    newPos         = SetNewPosition(pos);
         GameObject gearAreaObject = Instantiate(StoreController.singleton.addAreaPrefab) as GameObject;
         SetAreaObject(gearAreaObject, newPos);
         gearAreaObjects.Add(gearAreaObject);
     }
     foreach (Vector2 pos in gearArea.blockArea)
     {
         Vector2    newPos         = SetNewPosition(pos);
         GameObject gearAreaObject = Instantiate(StoreController.singleton.blockAreaPrefab) as GameObject;
         SetAreaObject(gearAreaObject, newPos);
         gearAreaObjects.Add(gearAreaObject);
     }
 }