/*
 *  public virtual void Anim(float time)
 *  {
 *      count++;
 *      anim_time += time;
 *      if (anim_time <= animTime)
 *      {
 *          float process = anim_time / animTime;
 *          process= EasingFunction.EaseInCubic(0, 1, process);
 *          Vector2 nowOffset = offset;
 *          Vector2 dist = nowTraget.transform.position - transform.position;
 *          if (Mathf.Abs(dist.x) < nowOffset.x)
 *          {
 *              nowOffset.x = Mathf.Abs(dist.x);
 *          }
 *          if (Mathf.Abs(dist.y) < nowOffset.y)
 *          {
 *              nowOffset.y = Mathf.Abs(dist.y);
 *          }
 *          //Debug.Log("count"+count+" tragetPos:" + (Vector2)nowTraget.transform.position + " oriPos:" + oriPos+" ans:" + ((Vector2)nowTraget.transform.position - oriPos) * process);
 *          Vector2 toTraget= ((Vector2)nowTraget.transform.position - oriPos);
 *          if(toTraget.x > 0)
 *          {
 *              toTraget.x -= nowOffset.x;
 *          }
 *          else
 *          {
 *              toTraget.x += nowOffset.x;
 *          }
 *          if(toTraget.y > 0)
 *          {
 *              toTraget.y -= nowOffset.y;
 *          }
 *          else
 *          {
 *              toTraget.y += nowOffset.y;
 *          }
 *          transform.position = oriPos+ toTraget* process;
 *
 *      }
 *      else if (stay_time < stayTime)
 *      {
 *          if (!triggerEff)
 *          {
 *              if (effNo >= 0)
 *              {
 *                  GameObject neweff = Instantiate(objectList.main.prafebList[effNo], transform);
 *                  float Zangle = objectList.main.prafebList[effNo].transform.eulerAngles.z;
 *                  neweff.transform.localPosition = Vector2.zero;
 *                  Vector2 toTraget = (Vector2)transform.position - (Vector2)nowTraget.transform.position;
 *                  neweff.transform.up = toTraget;
 *
 *                  //Debug.Log(gameObject.name+" neweff rotation:" + neweff.transform.eulerAngles);
 *                  Vector3 nowEuler = neweff.transform.eulerAngles;
 *                  //Debug.Log("nowEuler = " + nowEuler);
 *                  nowEuler.z += Zangle;
 *                  neweff.transform.eulerAngles = nowEuler;
 *                  //Debug.Log("neweff rotation +90:" + neweff.transform.eulerAngles);
 *
 *                  sp_effection shaker = nowTraget.GetComponent<sp_effection>();
 *                  shaker.shakeStart(0.3f, 0.1f);
 *                  triggerEff = true;
 *              }
 *              if(effNo_hit >= 0)
 *              {
 *                  GameObject hitPrefab = objectList.main.prafebList[effNo_hit];
 *                  GameObject hiteff = Instantiate( hitPrefab,hitPrefab.transform.position,hitPrefab.transform.rotation, nowTraget.transform);
 *                  hiteff.transform.localPosition = hitPrefab.transform.position;
 *              }
 *          }
 *          //Debug.Log("count" + count + "staying");
 *          stay_time += time;
 *      }
 *      else
 *      {
 *          transform.position = oriPos;
 *          Timer.main.loginOutTimer(Anim);
 *      }
 *  }
 */
    public void Effection()
    {
        if (effNo >= 0)
        {
            GameObject neweff = Instantiate(objectList.main.prafebList[effNo], transform);
            float      Zangle = objectList.main.prafebList[effNo].transform.eulerAngles.z;
            neweff.transform.localPosition = Vector2.zero;
            Vector2 toTraget = (Vector2)transform.position - (Vector2)nowTraget.transform.position;
            neweff.transform.up = toTraget;

            //Debug.Log(gameObject.name+" neweff rotation:" + neweff.transform.eulerAngles);
            Vector3 nowEuler = neweff.transform.eulerAngles;
            //Debug.Log("nowEuler = " + nowEuler);
            nowEuler.z += Zangle;
            neweff.transform.eulerAngles = nowEuler;
            //Debug.Log("neweff rotation +90:" + neweff.transform.eulerAngles);

            sp_effection shaker = nowTraget.GetComponent <sp_effection>();
            shaker.shakeStart(0.3f, 0.1f);
        }
        if (effNo_hit >= 0)
        {
            GameObject hitPrefab = objectList.main.prafebList[effNo_hit];
            GameObject hiteff    = Instantiate(hitPrefab, hitPrefab.transform.position, hitPrefab.transform.rotation, nowTraget.transform);
            hiteff.transform.localPosition = hitPrefab.transform.position;
        }
    }
 public override void onInit(unitControler owner, Callback4Unit deleg)
 {
     this.owner       = (BasicControler)owner;
     this.information = new SkillInf(true, true, true, new List <string>()
     {
         SkillInf.TAG_DAMAGE
     });
     oriPos    = transform.position;
     effection = GetComponent <sp_effection>();
 }