public override void Create(int number) { GameObject go = GameObject.CreatePrimitive(PrimitiveType.Cube); go.name = $"Cube_{number}"; ObjectTranslation t = go.AddComponent <ObjectTranslation>(); t.Set(Random.Range(-2.0f, 2.0f), Random.Range(-2.0f, 2.0f), Random.Range(-2.0f, 2.0f)); go.AddComponent <ObjectRotation>(); }
public override void Create(int number) { GameObject go = GameObject.CreatePrimitive(PrimitiveType.Sphere); go.name = $"Sphere_{number}"; ObjectTranslation t = go.AddComponent <ObjectTranslation>(); t.Set(Random.Range(-2.0f, 2.0f), Random.Range(-2.0f, 2.0f), Random.Range(-2.0f, 2.0f)); ObjectScale scale = go.AddComponent <ObjectScale>(); scale.Scale = Random.Range(0.5f, 1.5f); }
public override ITranslatable GetFunctionType(ObjectTranslation translation) { //translation is of type ObjectRotation if (translation is ObjectRotation) { switch (functionName) { case "LerpRotation": return(new LerpRotation(translateSpeed, translateTime, transform.eulerAngles)); default: return(new StandardRotation(translateSpeed, translateTime, transform.eulerAngles)); } } else //translation is of type ObjectMovement { return(new StandardMovement(translateSpeed, translateTime, translation.Navigation.LastTarget.position)); } }