45 lines
1.0 KiB
C#
45 lines
1.0 KiB
C#
// ***********************************************************************
|
|
// Assembly : Unity
|
|
// Author : Kimch
|
|
// Created : 2017-11-14
|
|
//
|
|
// Last Modified By : Kimch
|
|
// Last Modified On :
|
|
// ***********************************************************************
|
|
// <copyright file= "Obj_Pocket" company=""></copyright>
|
|
// <summary></summary>
|
|
// ***********************************************************************
|
|
using UnityEngine;
|
|
|
|
namespace G
|
|
{
|
|
public class Obj_Pocket : MonoBehaviour
|
|
{
|
|
private Transform _targetHand;
|
|
private bool _pick;
|
|
|
|
private void Awake()
|
|
{
|
|
transform.localScale = Vector3.zero;
|
|
}
|
|
|
|
public void PickPocket()
|
|
{
|
|
_targetHand = GameObject.Find("Bip01 L Finger0").transform;
|
|
|
|
_pick = true;
|
|
transform.position = _targetHand.position;
|
|
transform.parent = _targetHand;
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (_pick)
|
|
{
|
|
transform.localScale = Vector3.Lerp(transform.localScale, Vector3.one * 0.6f, Time.deltaTime * 7f);
|
|
transform.up = Vector3.up;
|
|
}
|
|
}
|
|
}
|
|
}
|