大连中石油电子沙盘
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

23 lines
846 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CloneWarningLine : CloneMultiLine {
// Use this for initialization
public override void Awake () {
variableX = 100;
variableY = 50;
variableZ = 80;
cloneObjType = CloneObjType.WarningLine;
ResourcesName = "Prefab/Tool/WarningLine";
parentResourcesName = "Prefab/Tool/WarningLineParent";
base.Awake();
}
protected override void SetClonedObj(GameObject clonedObj)
{
clonedObj.transform.forward = (curPos - prePos).normalized;//改变线条的朝向
float distance = Vector3.Distance(prePos, curPos);//计算两点的距离
clonedObj.transform.localScale = new Vector3(variableX, variableY, distance * variableZ);//延长线条,连接两点。
}
}