예제 #1
0
 void FixedUpdate()
 {
     transform.position += moveSpeed * Time.fixedDeltaTime * direction;
     rotatePartTransform.eulerAngles += Time.fixedDeltaTime * rotateSpeed * (new Vector3(0, 0, 1));
     if (m_world.GetBlockType(Mathf.RoundToInt(transform.position.x - 0.5f), Mathf.RoundToInt(transform.position.y - 0.5f)) != MeshCreator.MAP_TYPE.EMPTY)
     {
         Destroy(this.gameObject);
     }
 }
예제 #2
0
    void FixedUpdate()
    {
        float factor = (Time.fixedTime - startTime) / lifeTime;

        if (factor > 1)
        {
            Destroy(this.gameObject);
        }
        else
        {
            transform.localScale = new Vector3(m_scale, factor * targetScale, m_scale);
        }
        if (m_world.GetBlockType(Mathf.RoundToInt(attackPartTransform.position.x - 0.5f), Mathf.RoundToInt(attackPartTransform.position.y - 0.5f)) != MeshCreator.MAP_TYPE.EMPTY)
        {
            Destroy(this.gameObject);
        }
    }
예제 #3
0
 protected bool CheckDirtValid(Vector2 offset)
 {
     return(m_world.GetBlockType(Mathf.RoundToInt(transform.position.x - m_gap + offset.x), Mathf.RoundToInt(transform.position.y - m_gap + offset.y)) == MeshCreator.MAP_TYPE.EMPTY);
 }