您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
23 行
466 B
23 行
466 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class lightMover : MonoBehaviour {
|
|
|
|
private Vector3 m_pos;
|
|
public float test = 0.0f;
|
|
|
|
// Use this for initialization
|
|
void Start ()
|
|
{
|
|
m_pos = transform.position;
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update ()
|
|
{
|
|
Vector3 pos = m_pos;
|
|
pos.z = m_pos.z + 5.0f * Mathf.Sin(Time.time * test);
|
|
transform.position = pos;
|
|
}
|
|
}
|