Esempio n. 1
0
        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
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 public bool IsLiteral()
 {
     return(Tree.literals.Contains(tree.leaves[Leaves.First()].Kind));
 }