示例#1
0
        public static UICommandUnitIcon Instantiate(UICommandUnitIcon prefab, Transform parent, Vector3 pos, int nType)
        {
            UICommandUnitIcon uICommandUnitIcon = Object.Instantiate <UICommandUnitIcon>(prefab);

            uICommandUnitIcon.get_transform().set_parent(parent);
            uICommandUnitIcon.get_transform().set_localPosition(pos);
            uICommandUnitIcon.get_transform().localScaleOne();
            return(uICommandUnitIcon);
        }
 public void Absorded(UICommandUnitIcon unit)
 {
     this.isAbsorded = true;
     this.Magnify();
     unit.get_transform().set_position(this._uiIcon.get_transform().get_position());
     unit.isActiveIcon = true;
 }
 public void ChkSurfaceMagnifyDistance(UICommandUnitIcon unit)
 {
     if (Vector3.Distance(base.get_transform().get_position(), unit.get_transform().get_position()) < 0.09f)
     {
         this.Absorded(unit);
     }
     else if (Vector3.Distance(base.get_transform().get_position(), unit.get_transform().get_position()) < 0.5f)
     {
         this.isAbsorded = false;
         this.Magnify();
     }
     else
     {
         this.isAbsorded = false;
         this.Reduction();
     }
 }