public override void Setup(Beast beast, GameObject holder) { base.Setup(beast, holder); SpriteRenderer r = Leaves.First().GetComponent <SpriteRenderer>(); Leaves.First().transform.localPosition = startPos; //100 pixels per unit }
protected void Update() { var temp = Leaves.First().transform; //current time(to sync it up with others) * pi * frequency(higher is faster) * amplitude float y = startPos.y + Mathf.Sin(Time.fixedTime * Mathf.PI * 1f) * 0.05f; Leaves.First().transform.localPosition = new Vector3(temp.localPosition.x, y, temp.localPosition.z); }
public override void Setup(Beast beast, GameObject holder) { base.Setup(beast, holder); GameObject lightObject = new GameObject("Glow"); lightObject.transform.localPosition = Leaves.First().transform.localPosition; lightObject.transform.SetParent(Leaves.First().transform); int[] colors = Array.ConvertAll(beast.data.ModelProps["color"].InnerText.Split(','), int.Parse); Color color = new Color(colors[0] / 255f, colors[1] / 255f, colors[2] / 255f); float intensity = float.Parse(beast.data.ModelProps["intensity"].InnerText); Light light = lightObject.AddComponent <Light>(); light.color = color; light.intensity = intensity; //Debug.Log(lightObject.transform.localPosition); }
public bool IsLiteral() { return(Tree.literals.Contains(tree.leaves[Leaves.First()].Kind)); }