using UnityEngine;
using System.Collections;
public class PowerCell : MonoBehaviour {
public float Speed = 3.0f;
// Update is called once per frame
void Update () {
gameObject.transform.Rotate(Vector3.up * Speed * Time.deltaTime);
}
void OnTriggerEnter(Collider col){
if(col.gameObject.tag == "Player")
{
//col.gameObject.GetComponent<scriptName>().CellPickUP();
col.gameObject.SendMessage("CellPickUp");
Destroy(gameObject);
}
}
}
'유니티3D > 예제' 카테고리의 다른 글
StreetLight.cs (0) | 2013.08.26 |
---|---|
gamemanagel.cs (0) | 2013.08.26 |
wall.cs (0) | 2013.08.26 |
All Script in ThirdPersonShooingGame (0) | 2013.08.23 |
plane size 동적할당 (0) | 2013.08.21 |