Esempio n. 1
0
 private void Start()
 {
     if (target != null)
     {
         if (VectorEx.IsNaN(offset2Target))
         {
             SetOffsetAsCurrent();
         }
         MoveCameraInPosition();
     }
 }
Esempio n. 2
0
    void PutOnGround()
    {
        var scr = SelfColliderRect;
        var offsetY2ObjectCenter = scr.center - transform.position.ToVector2();
        var bottomOrigin         = new Vector2(scr.center.x, scr.yMin);
        var groundPos            = StageUtility.FindGroundPosition(bottomOrigin);

        if (!VectorEx.IsNaN(groundPos))
        {
            var standPos = groundPos + Vector2.up * scr.height * .5f - offsetY2ObjectCenter;
            transform.position = standPos;
        }
    }