36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Valheim
|
|
{
|
|
public class CommonObj : MonoBehaviour
|
|
{
|
|
[Header("是否为障碍物")]
|
|
public bool isObs = false;
|
|
[Header("是否为遮挡物")]
|
|
public bool isOcc = false;
|
|
[Header("透明度")]
|
|
public float opacity = 1.0f;
|
|
|
|
public virtual EditObjInfo PreparData()
|
|
{
|
|
EditObjInfo info = new EditObjInfo();
|
|
info.isObs = isObs;
|
|
info.isOcc = isOcc;
|
|
info.x = transform.position.x;
|
|
info.y = transform.position.y;
|
|
info.z = transform.position.z;
|
|
info.angleX = transform.eulerAngles.x;
|
|
info.angleY = transform.eulerAngles.y;
|
|
info.angleZ = transform.eulerAngles.z;
|
|
info.scaleX = transform.localScale.x;
|
|
info.scaleY = transform.localScale.y;
|
|
info.scaleZ = transform.localScale.z;
|
|
info.opacity = opacity;
|
|
return info;
|
|
}
|
|
}
|
|
}
|