2022-09-28 23:55:44 +08:00
|
|
|
using SHADE;
|
|
|
|
using System;
|
2022-11-12 02:33:12 +08:00
|
|
|
using System.Collections.Generic;
|
2022-09-28 23:55:44 +08:00
|
|
|
|
|
|
|
public class RaccoonShowcase : Script
|
|
|
|
{
|
2022-10-18 20:09:50 +08:00
|
|
|
[SerializeField]
|
|
|
|
[Tooltip("Speed of the rotation in radians per second.")]
|
2022-10-18 22:34:46 +08:00
|
|
|
[Range(-1.0f, 2.0f)]
|
2022-10-18 20:09:50 +08:00
|
|
|
private double RotateSpeed = 1.0;
|
2022-10-18 22:34:46 +08:00
|
|
|
//[SerializeField]
|
|
|
|
//[Range(-5, 20)]
|
|
|
|
//private int test = 5;
|
2022-10-18 20:09:50 +08:00
|
|
|
[SerializeField]
|
|
|
|
[Tooltip("Speed of the scaling in radians per second around each axis.")]
|
2022-10-27 12:32:06 +08:00
|
|
|
private Vector3 ScaleSpeed = Vector3.One;
|
2022-09-28 23:55:44 +08:00
|
|
|
private Transform Transform;
|
|
|
|
private double rotation = 0.0;
|
|
|
|
private Vector3 scale = Vector3.Zero;
|
|
|
|
private double originalScale = 1.0f;
|
2022-11-12 12:17:11 +08:00
|
|
|
[Tooltip("Sample list of Vector3s.")]
|
2022-11-12 02:33:12 +08:00
|
|
|
public List<Vector3> vecList = new List<Vector3>(new Vector3[] { new Vector3(1, 2, 3), new Vector3(4, 5, 6) });
|
2022-11-12 12:17:11 +08:00
|
|
|
[Range(-5, 5)]
|
2022-11-12 02:33:12 +08:00
|
|
|
public List<int> intList = new List<int>(new int[] { 2, 8, 2, 6, 8, 0, 1 });
|
|
|
|
public List<Light.Type> enumList = new List<Light.Type>(new Light.Type[] { Light.Type.Point, Light.Type.Directional, Light.Type.Ambient });
|
2022-09-28 23:55:44 +08:00
|
|
|
|
|
|
|
protected override void awake()
|
|
|
|
{
|
|
|
|
Transform = GetComponent<Transform>();
|
|
|
|
if (Transform == null)
|
|
|
|
{
|
|
|
|
Debug.LogError("Transform is NULL!");
|
|
|
|
}
|
|
|
|
|
2022-11-08 18:32:47 +08:00
|
|
|
foreach (var child in Owner)
|
|
|
|
{
|
|
|
|
Debug.Log(child.Name);
|
|
|
|
}
|
|
|
|
|
2022-09-28 23:55:44 +08:00
|
|
|
originalScale = Transform.LocalScale.z;
|
|
|
|
}
|
|
|
|
protected override void update()
|
|
|
|
{
|
2022-10-27 12:32:06 +08:00
|
|
|
//rotation += RotateSpeed * 0.16;
|
|
|
|
//scale += ScaleSpeed * 0.16;
|
|
|
|
//Transform.LocalRotation = new Vector3(0.0f, rotation, 0.0f);
|
|
|
|
//Transform.LocalScale = new Vector3(System.Math.Abs(System.Math.Sin(scale.x)) * originalScale, System.Math.Abs(System.Math.Cos(scale.y)) * originalScale, System.Math.Abs(System.Math.Sin(scale.z)) * originalScale);
|
2022-09-28 23:55:44 +08:00
|
|
|
}
|
2022-11-09 10:22:11 +08:00
|
|
|
|
|
|
|
protected override void onDrawGizmos()
|
|
|
|
{
|
|
|
|
Gizmos.DrawLine(new Vector3(-1.0f, 0.0f, 0.0f), new Vector3(1.0f, 0.0f, 0.0f));
|
|
|
|
Gizmos.DrawLine(new Vector3(-1.0f, 1.0f, 0.0f), new Vector3(1.0f, 1.0f, 0.0f), Color.Red);
|
|
|
|
}
|
2022-09-28 23:55:44 +08:00
|
|
|
}
|