58 lines
2.1 KiB
C#
58 lines
2.1 KiB
C#
using SHADE;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
public class RaccoonShowcase : Script
|
|
{
|
|
[SerializeField]
|
|
[Tooltip("Speed of the rotation in radians per second.")]
|
|
[Range(-1.0f, 2.0f)]
|
|
private double RotateSpeed = 1.0;
|
|
//[SerializeField]
|
|
//[Range(-5, 20)]
|
|
//private int test = 5;
|
|
[SerializeField]
|
|
[Tooltip("Speed of the scaling in radians per second around each axis.")]
|
|
private Vector3 ScaleSpeed = Vector3.One;
|
|
private Transform Transform;
|
|
private double rotation = 0.0;
|
|
private Vector3 scale = Vector3.Zero;
|
|
private double originalScale = 1.0f;
|
|
[Tooltip("Sample list of Vector3s.")]
|
|
public List<Vector3> vecList = new List<Vector3>(new Vector3[] { new Vector3(1, 2, 3), new Vector3(4, 5, 6) });
|
|
[Range(-5, 5)]
|
|
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 });
|
|
public List<int> nullList;
|
|
public FontAsset fontAsset;
|
|
public MeshAsset mesh;
|
|
public MaterialAsset matAsset;
|
|
protected override void awake()
|
|
{
|
|
Transform = GetComponent<Transform>();
|
|
if (Transform == null)
|
|
{
|
|
Debug.LogError("Transform is NULL!");
|
|
}
|
|
|
|
foreach (var child in Owner)
|
|
{
|
|
Debug.Log(child.Name);
|
|
}
|
|
|
|
originalScale = Transform.LocalScale.z;
|
|
}
|
|
protected override void update()
|
|
{
|
|
//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);
|
|
}
|
|
|
|
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);
|
|
}
|
|
} |