// Use this for initialization protected override void Start() { transform.localScale = Vector3.zero; pathfinder = GetComponent <scrPathfinder>(); pathfinder.Target = scrAICore.Instance.gameObject; pathfinder.Resume(); link = GetComponent <LineRenderer>(); base.Start(); }
public override void Init() { // Create a segment for each character, which will trail after the head. Segments = new scrEnemy[Name.Length]; prevPositions = new Vector2[Name.Length]; nextPositions = new Vector2[Name.Length]; for (int i = 0; i < Name.Length; ++i) { Segments[i] = ((GameObject)Instantiate(SegmentPrefab, transform.position, Quaternion.identity)).GetComponent <scrEnemy>(); Segments[i].GetComponentInChildren <TextMesh>().text = Name[i].ToString(); Segments[i].Name += "[" + Name[i].ToString() + "]"; Segments[i].DamageToDestroy = 3; prevPositions[i] = transform.position; nextPositions[i] = transform.position; } prevHeadPosition = transform.position; pathfinder = GetComponent <scrPathfinder>(); pathfinder.Target = scrPlayer.Instance.gameObject; DamageToDestroy = 30; DestroyOnExpire = false; }
public override void Init() { GetComponentInChildren <TextMesh>().text = Name; SiegeNode = null; pathfinder = GetComponent <scrPathfinder>(); pathfinder.Target = scrPlayer.Instance.gameObject; powerup.Colour = NameToColour(Name); powerup.Size = 0.5f + (Mathf.Max(Name.Length, 16)) / 10.0f; powerup.Speed = 220.0f / powerup.Size; powerup.Wiggle = Name[0] < 'M' ? Name[0] * 0.5f : 0; powerup.Erratic = (Mathf.Abs(Name[Name.Length - 1] - Name[0]) % 10) / 7.0f; powerup.Homing = Name[0].ToString().ToUpper()[0] < 'H'; powerup.Penetrative = Name[Name.Length - 1] <= '9'; Transform ship = transform.Find("Ship"); ship.Find("Core_Core").renderer.material.color = powerup.Colour; ship.Find("Core_Glow").renderer.material.SetColor("_TintColor", new Color(powerup.Colour.r * 0.5f, powerup.Colour.g * 0.5f, powerup.Colour.b * 0.5f, 0.0625f)); transform.GetComponentInChildren <TrailRenderer>().material.SetColor("_TintColor", powerup.Colour); ExplosionColour = powerup.Colour; }
// Use this for initialization void Start() { pathfinder = GetComponent <scrPathfinder>(); pathfinder.Target = GameObject.Find("AICore"); Init(null, null, Vector3.zero, DataState.BLOCKED); }