本文整理汇总了C#中UnityEngine.TrailRenderer类的典型用法代码示例。如果您正苦于以下问题:C# TrailRenderer类的具体用法?C# TrailRenderer怎么用?C# TrailRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TrailRenderer类属于UnityEngine命名空间,在下文中一共展示了TrailRenderer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ManualStart
// Use this for initialization
public void ManualStart()
{
_rigidbody = GetComponent<Rigidbody>();
_trail = GetComponent<TrailRenderer>();
_startTime = _trail.time;
_gameObject = gameObject;
}
示例2: Start
void Start()
{
tr = GetComponent<TrailRenderer>();
tr.sortingLayerName = "Default";
tr.sortingOrder = 50;
}
示例3: Awake
void Awake()
{
m_trailRenderer = GetComponent<TrailRenderer>();
m_points = new List<Vector3>();
m_camera = Camera.main;
m_toCommence = true;
}
示例4: Start
void Start()
{
trail = transform.GetChild(0).GetComponent<TrailRenderer>();
myRigidbody = GetComponent<Rigidbody2D>();
myRigidbody.isKinematic = true;
oldTime = trail.time;
}
示例5: Awake
void Awake()
{
owner = GetComponentInParent<AliveEntity>();
_collider = GetComponent<Collider>();
_sound = GetComponent<AudioSource>();
_trail = GetComponentInChildren<TrailRenderer>();
}
示例6: Start
void Start()
{
trail = GetComponent<TrailRenderer>();
SpriteRenderer spriteRenderer = GetComponent<SpriteRenderer>();
trail.sortingLayerID = spriteRenderer.sortingLayerID;
trail.sortingOrder = spriteRenderer.sortingOrder;
}
示例7: Start
void Start()
{
m = (transform.position - target.transform.position).magnitude;
_TR = GetComponent<TrailRenderer>();
t = 0;
apply = false;
}
示例8: Start
void Start()
{
obj = (GameObject)GameObject.Instantiate(obj);
// trailSub = transform.GetChild (0).gameObject;
trail = obj.GetComponent<TrailRenderer>();
player = transform.parent.transform.parent.gameObject;
pMov = player.GetComponent<Player_Movement>();
obj.collider2D.enabled = false;
obj.transform.parent = transform;
obj.GetComponent<HingeJoint2D>().anchor = new Vector2(-0.5f, 0);
obj.GetComponent<HingeJoint2D>().connectedBody = player.rigidbody2D;
obj.collider2D.enabled = true;
objMid = obj.GetComponentInChildren<GrapplingStalk>();
obj.SetActive(false);
end = (GameObject)GameObject.Instantiate(end);
end.transform.parent = transform.parent;
endScript = end.GetComponent<GrapplingEnd>();
endScript.setLayersToGrapple(possibleLayers);
endScript.Setup(obj);
endJoint = obj.AddComponent<HingeJoint2D>();
endJoint.anchor = new Vector2(0.5f, 0);
endJoint.connectedBody = end.rigidbody2D;
lasCon = obj.GetComponent<laserConnector>();
lasCon.endPoint = end.transform;
lasCon.startPoint = transform.parent;
lasCon.player = player.transform;
}
示例9: ResetTrail
static IEnumerator ResetTrail(TrailRenderer trail)
{
var trailTime = trail.time;
trail.time = -1;
yield return new WaitForEndOfFrame();
trail.time = trailTime;
}
示例10: Awake
void Awake()
{
tr = this.GetComponent<TrailRenderer>();
rb = root.GetComponent<Rigidbody>();
animator = root.GetComponent<Animator>();
//ps = root.GetComponent<PlayerState>();
}
示例11: Awake
//Gets the balls rigid body
void Awake()
{
audio = GetComponent<AudioSource>();
rb = GetComponent < Rigidbody > ();
trail = gameObject.GetComponent<TrailRenderer>();
trail.material.color = Color.blue;
}
示例12: Awake
void Awake()
{
trigger = GetComponent<CircleCollider2D> ();
body = GetComponent<Rigidbody2D> ();
trail = GetComponent<TrailRenderer> ();
aud = GetComponent<AudioSource> ();
}
示例13: Start
void Start()
{
Debug.Log("instantiating bullet");
rigidBody = this.GetComponent<Rigidbody2D>();
trail = this.gameObject.GetComponentInChildren<TrailRenderer>();
}
示例14: Awake
void Awake()
{
defaultMat = GetComponent<Renderer>().material;
trail = GetComponent<TrailRenderer>();
trail.enabled = true;
halo = (Behaviour)GetComponent("Halo");
}
示例15: ManualStart
public void ManualStart()
{
transform.position = new Vector3(-1000, -1000, -1000);
spitRigidbody = GetComponent<Rigidbody>();
_trail = GetComponent<TrailRenderer>();
Disable();
}