void Start() { hsm = FindObjectOfType <hellSceneManager>(); rb.velocity = new Vector3(2 * MAX_INITIAL_SPEED * (Random.value - .5f), 0, 2 * MAX_INITIAL_SPEED * (Random.value - .5f)); goal = new Vector3(0, 0, 0); moveCountdown = Random.Range(minStartCountdown, maxStartCountdown); healthScript = HealthScript.AddHealthScript(gameObject, max_health, 4f, Resources.Load <GameObject>("BloodSplatter"), null, DeathFunction); hsm.registerSheep(gameObject); }
void Start() { chaseTimer = chasingTimeout; directionTimer = directionTimeout; velocityResetTimer = velocityResetTimeout; terrainTimer = 0; health = 30; rb = gameObject.GetComponent <Rigidbody>(); HealthScript.AddHealthScript(gameObject, 40, 4f, Resources.Load <GameObject>("BloodSplatter")); }
private Vector3 playerTargetDisplacement = new Vector3(0, 5, 0); // bolts are aimed at player's position plus this // Start is called before the first frame update void Start() { spawnPoint = transform.position; rb = gameObject.GetComponent <Rigidbody>(); hsm = FindObjectOfType <hellSceneManager>(); // create abduction beam lineRenderer = gameObject.AddComponent <LineRenderer>(); lineRenderer.material = abductBeamMat; lineRenderer.widthMultiplier = beamWidth; Gradient gradient = new Gradient(); gradient.SetKeys( new GradientColorKey[] { new GradientColorKey(beamStartCol, 0.0f), new GradientColorKey(beamEndCol, 1.0f) }, new GradientAlphaKey[] { new GradientAlphaKey(beamStartAlpha, 0.0f), new GradientAlphaKey(beamEndAlpha, 1.0f) } ); lineRenderer.colorGradient = gradient; lineRenderer.positionCount = 0; HealthScript.AddHealthScript(gameObject, startHealth, .6f * transform.localScale.x, null, WoundAction, DeathFunction); state = AngelState.JUST_CREATED; }