Esempio n. 1
0
    public void InitData(int _owerID, int _id, GameVector2 _logicPos, int _moveDir)
    {
//		owerID = _owerID;

        objShape = GetComponent <ShapeBase> ();
        objShape.InitSelf(ObjectType.bullet, _id);
        objShape.SetPosition(_logicPos);
        transform.position = objShape.GetPositionVec3(0.5f);

        logicSpeed = speed * BattleData.Instance.GetSpeed(_moveDir);
        curLife    = life;
    }
Esempio n. 2
0
 public virtual void Logic_Move()
 {
     curLife--;
     if (curLife > 0)
     {
         GameVector2 _targetPos = objShape.GetPosition() + logicSpeed;
         objShape.SetPosition(_targetPos);
         renderPosition = objShape.GetPositionVec3(0.5f);
     }
     else
     {
     }
 }
Esempio n. 3
0
 public virtual void Logic_Move()
 {
     if (logicSpeed != GameVector2.zero)
     {
         GameVector2 _targetPos = objShape.GetPosition() + logicSpeed;
         UpdateLogicPosition(_targetPos);
         renderPosition = objShape.GetPositionVec3();
     }
     if (curAttackTime > 0)
     {
         curAttackTime--;
     }
 }
Esempio n. 4
0
    public void InitData(int _id, GameVector2 _logicPos, int _blood)
    {
        isBroken = false;

        objShape = GetComponent <ShapeBase> ();
        objShape.InitSelf(ObjectType.obstacle, _id);
        objShape.SetPosition(_logicPos);
        transform.position = objShape.GetPositionVec3();

        blood = _blood;

        bloodText      = transform.Find("BloodNum").GetComponent <TextMesh> ();
        bloodText.text = blood.ToString();
    }
Esempio n. 5
0
    public void InitData(GameObject _ui, GameObject _modle, int _roleID, GameVector2 _logicPos)
    {
        objShape    = GetComponent <ShapeBase> ();
        logicSpeed  = GameVector2.zero;
        modleParent = transform.Find("Modle");

//		uiObj = _ui;

        _modle.transform.SetParent(modleParent);
        _modle.transform.localPosition = new Vector3(0, 0.5f, 0);

        objShape.InitSelf(ObjectType.role, _roleID);
        objShape.SetPosition(_logicPos);
        renderPosition     = objShape.GetPositionVec3();
        transform.position = renderPosition;

        roleDirection        = 0;
        renderDir            = Quaternion.LookRotation(new Vector3(1f, 0f, 0f));
        modleParent.rotation = renderDir;

        curAttackTime = 0;
    }