32 lines
894 B
C#
32 lines
894 B
C#
using DG.Tweening;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Modeldata : MonoBehaviour
|
|
{
|
|
private string path = "model/";//获取预设体的值
|
|
private string modename = null;
|
|
public Modelequipment modelequipment;//对应的模型路径
|
|
void Start()
|
|
{
|
|
modename = transform.name.Replace("(Clone)", "");//消除克隆的物体克隆的名字
|
|
modelequipment.str = path + modename;//获取预设体的路径
|
|
}
|
|
|
|
public void SetPos()//获取物体最终初始化的值
|
|
{
|
|
modelequipment.x = transform.position.x;
|
|
modelequipment.y = transform.position.y;
|
|
modelequipment.z = transform.position.z;
|
|
}
|
|
}
|
|
[System.Serializable]
|
|
public class Modelequipment//模型类的路径和位置参数
|
|
{
|
|
public string str;
|
|
public float x;
|
|
public float y;
|
|
public float z;
|
|
}
|